ent

package
v0.0.0-...-7ca28c2 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2020 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeItem          = "Item"
	TypeSystemSummary = "SystemSummary"
	TypeTask          = "Task"
	TypeTaskType      = "TaskType"
	TypeUser          = "User"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks nor 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 Client 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
	// Item is the client for interacting with the Item builders.
	Item *ItemClient
	// SystemSummary is the client for interacting with the SystemSummary builders.
	SystemSummary *SystemSummaryClient
	// Task is the client for interacting with the Task builders.
	Task *TaskClient
	// TaskType is the client for interacting with the TaskType builders.
	TaskType *TaskTypeClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns the Client stored in 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 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().
	Item.
	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(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 Committer method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflict 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"`
	// Source holds the value of the "source" field.
	Source string `json:"source,omitempty"`
	// Hash holds the value of the "hash" field.
	Hash string `json:"hash,omitempty"`
	// Data holds the value of the "data" field.
	Data domain.ItemData `json:"data,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) QueryTask

func (i *Item) QueryTask() *TaskQuery

QueryTask queries the task edge of the Item.

func (*Item) String

func (i *Item) String() string

String implements the fmt.Stringer.

func (*Item) Unwrap

func (i *Item) Unwrap() *Item

Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next 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

BulkCreate 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) QueryTask

func (c *ItemClient) QueryTask(i *Item) *TaskQuery

QueryTask queries the task 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) 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) SetData

func (ic *ItemCreate) SetData(dd domain.ItemData) *ItemCreate

SetData sets the data field.

func (*ItemCreate) SetHash

func (ic *ItemCreate) SetHash(s string) *ItemCreate

SetHash sets the hash field.

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

func (ic *ItemCreate) SetNillableData(dd *domain.ItemData) *ItemCreate

SetNillableData sets the data 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) SetSource

func (ic *ItemCreate) SetSource(s string) *ItemCreate

SetSource sets the source field.

func (*ItemCreate) SetTask

func (ic *ItemCreate) SetTask(t *Task) *ItemCreate

SetTask sets the task edge to Task.

func (*ItemCreate) SetTaskID

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

SetTaskID sets the task edge to Task by id.

func (*ItemCreate) SetUpdateTime

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

SetUpdateTime sets the update_time field.

type ItemCreateBulk

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

ItemCreateBulk is the builder for creating a bulk of Item entities.

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 calls Save and panics if Save returns an error.

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 adds a new predicate to the delete 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 {
	// Task holds the value of the task edge.
	Task *Task
	// contains filtered or unexported fields
}

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

func (ItemEdges) TaskOrErr

func (e ItemEdges) 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 ItemGroupBy

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

ItemGroupBy is the builder for group-by 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 group-by. It is only allowed when querying group-by 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 querying group-by 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 group-by. It is only allowed when querying group-by 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 querying group-by 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 group-by. It is only allowed when querying group-by 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 querying group-by 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 scan 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 group-by. It is only allowed when querying group-by 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 querying group-by 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 mutate the Items nodes in the graph.

func (*ItemMutation) AddField

func (m *ItemMutation) AddField(name string, value ent.Value) error

AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

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 in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*ItemMutation) AddedFields

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

AddedFields returns all numeric fields that were incremented or 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.

func (*ItemMutation) ClearData

func (m *ItemMutation) ClearData()

ClearData clears the value of data.

func (*ItemMutation) ClearEdge

func (m *ItemMutation) ClearEdge(name string) error

ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.

func (*ItemMutation) ClearField

func (m *ItemMutation) ClearField(name string) error

ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.

func (*ItemMutation) ClearTask

func (m *ItemMutation) ClearTask()

ClearTask clears the task edge to Task.

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 create_time value in the mutation.

func (*ItemMutation) Data

func (m *ItemMutation) Data() (r domain.ItemData, exists bool)

Data returns the data value in the mutation.

func (*ItemMutation) DataCleared

func (m *ItemMutation) DataCleared() bool

DataCleared returns if the field data was cleared in this mutation.

func (*ItemMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge 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 value indicates that this field was not set, or was not define in the schema.

func (*ItemMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field 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 in/decremented, call AddedFields().

func (*ItemMutation) Hash

func (m *ItemMutation) Hash() (r string, exists bool)

Hash returns the hash value in the mutation.

func (*ItemMutation) ID

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

ID returns the id value in the mutation. Note that, the id is available only if it was provided to the builder.

func (*ItemMutation) OldCreateTime

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

OldCreateTime returns the old create_time value of the Item. 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 database query fails.

func (*ItemMutation) OldData

func (m *ItemMutation) OldData(ctx context.Context) (v domain.ItemData, err error)

OldData returns the old data value of the Item. 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 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 was failed.

func (*ItemMutation) OldHash

func (m *ItemMutation) OldHash(ctx context.Context) (v string, err error)

OldHash returns the old hash value of the Item. 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 database query fails.

func (*ItemMutation) OldSource

func (m *ItemMutation) OldSource(ctx context.Context) (v string, err error)

OldSource returns the old source value of the Item. 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 database query fails.

func (*ItemMutation) OldUpdateTime

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

OldUpdateTime returns the old update_time value of the Item. 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 database query fails.

func (*ItemMutation) Op

func (m *ItemMutation) Op() Op

Op returns the operation name.

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 given edge name.

func (*ItemMutation) ResetCreateTime

func (m *ItemMutation) ResetCreateTime()

ResetCreateTime reset all changes of the "create_time" field.

func (*ItemMutation) ResetData

func (m *ItemMutation) ResetData()

ResetData reset all changes of the "data" field.

func (*ItemMutation) ResetEdge

func (m *ItemMutation) ResetEdge(name string) error

ResetEdge resets all changes in the mutation regarding the given edge name. 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 regarding the given field name. It returns an error if the field is not defined in the schema.

func (*ItemMutation) ResetHash

func (m *ItemMutation) ResetHash()

ResetHash reset all changes of the "hash" field.

func (*ItemMutation) ResetSource

func (m *ItemMutation) ResetSource()

ResetSource reset all changes of the "source" field.

func (*ItemMutation) ResetTask

func (m *ItemMutation) ResetTask()

ResetTask reset all changes of the "task" edge.

func (*ItemMutation) ResetUpdateTime

func (m *ItemMutation) ResetUpdateTime()

ResetUpdateTime reset all changes of the "update_time" field.

func (*ItemMutation) SetCreateTime

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

SetCreateTime sets the create_time field.

func (*ItemMutation) SetData

func (m *ItemMutation) SetData(dd domain.ItemData)

SetData sets the data field.

func (*ItemMutation) SetField

func (m *ItemMutation) SetField(name string, value ent.Value) error

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*ItemMutation) SetHash

func (m *ItemMutation) SetHash(s string)

SetHash sets the hash field.

func (*ItemMutation) SetSource

func (m *ItemMutation) SetSource(s string)

SetSource sets the source field.

func (*ItemMutation) SetTaskID

func (m *ItemMutation) SetTaskID(id int)

SetTaskID sets the task edge to Task by id.

func (*ItemMutation) SetUpdateTime

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

SetUpdateTime sets the update_time field.

func (*ItemMutation) Source

func (m *ItemMutation) Source() (r string, exists bool)

Source returns the source value in the mutation.

func (*ItemMutation) TaskCleared

func (m *ItemMutation) TaskCleared() bool

TaskCleared returns if the edge task was cleared.

func (*ItemMutation) TaskID

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

TaskID returns the task id in the mutation.

func (*ItemMutation) TaskIDs

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

TaskIDs returns the task 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 (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 update_time value in the mutation.

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 query 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 in the query. Returns *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 in the query. Returns *NotFoundError when no id was found.

func (*ItemQuery) FirstX

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

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

func (*ItemQuery) FirstXID

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

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

func (*ItemQuery) GroupBy

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

GroupBy 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 the only Item entity in the query, returns an error if not exactly one entity was returned.

func (*ItemQuery) OnlyID

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

OnlyID returns the only Item id in the query, returns an error if not exactly one id was returned.

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

func (iq *ItemQuery) QueryTask() *TaskQuery

QueryTask chains the current query on the task edge.

func (*ItemQuery) Select

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

Select one or more fields from the given query.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

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

func (*ItemQuery) Where

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

Where adds a new predicate for the builder.

func (*ItemQuery) WithTask

func (iq *ItemQuery) WithTask(opts ...func(*TaskQuery)) *ItemQuery
WithTask tells the query-builder to eager-loads the nodes that are connected to

the "task" edge. The optional arguments used to configure the query builder of the edge.

type ItemSelect

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

ItemSelect is the builder for select fields of Item entities.

func (*ItemSelect) Bool

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

Bool returns a single bool from 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 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 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 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 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 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 scan 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 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 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) ClearData

func (iu *ItemUpdate) ClearData() *ItemUpdate

ClearData clears the value of data.

func (*ItemUpdate) ClearTask

func (iu *ItemUpdate) ClearTask() *ItemUpdate

ClearTask clears the task edge to Task.

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

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

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*ItemUpdate) SaveX

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

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

func (*ItemUpdate) SetData

func (iu *ItemUpdate) SetData(dd domain.ItemData) *ItemUpdate

SetData sets the data field.

func (*ItemUpdate) SetHash

func (iu *ItemUpdate) SetHash(s string) *ItemUpdate

SetHash sets the hash field.

func (*ItemUpdate) SetNillableData

func (iu *ItemUpdate) SetNillableData(dd *domain.ItemData) *ItemUpdate

SetNillableData sets the data field if the given value is not nil.

func (*ItemUpdate) SetSource

func (iu *ItemUpdate) SetSource(s string) *ItemUpdate

SetSource sets the source field.

func (*ItemUpdate) SetTask

func (iu *ItemUpdate) SetTask(t *Task) *ItemUpdate

SetTask sets the task edge to Task.

func (*ItemUpdate) SetTaskID

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

SetTaskID sets the task edge to Task by id.

func (*ItemUpdate) Where

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

Where adds a new predicate for the builder.

type ItemUpdateOne

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

ItemUpdateOne is the builder for updating a single Item entity.

func (*ItemUpdateOne) ClearData

func (iuo *ItemUpdateOne) ClearData() *ItemUpdateOne

ClearData clears the value of data.

func (*ItemUpdateOne) ClearTask

func (iuo *ItemUpdateOne) ClearTask() *ItemUpdateOne

ClearTask clears the task edge to Task.

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

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

Save executes the query and returns the updated entity.

func (*ItemUpdateOne) SaveX

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

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

func (*ItemUpdateOne) SetData

func (iuo *ItemUpdateOne) SetData(dd domain.ItemData) *ItemUpdateOne

SetData sets the data field.

func (*ItemUpdateOne) SetHash

func (iuo *ItemUpdateOne) SetHash(s string) *ItemUpdateOne

SetHash sets the hash field.

func (*ItemUpdateOne) SetNillableData

func (iuo *ItemUpdateOne) SetNillableData(dd *domain.ItemData) *ItemUpdateOne

SetNillableData sets the data field if the given value is not nil.

func (*ItemUpdateOne) SetSource

func (iuo *ItemUpdateOne) SetSource(s string) *ItemUpdateOne

SetSource sets the source field.

func (*ItemUpdateOne) SetTask

func (iuo *ItemUpdateOne) SetTask(t *Task) *ItemUpdateOne

SetTask sets the task edge to Task.

func (*ItemUpdateOne) SetTaskID

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

SetTaskID sets the task edge to Task by id.

type Items

type Items []*Item

Items is a parsable slice of Item.

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflict 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 conflict 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 either graph traversal or 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 conflict in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflict 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(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 Rollbacker method.

type SystemSummaries

type SystemSummaries []*SystemSummary

SystemSummaries is a parsable slice of SystemSummary.

type SystemSummary

type SystemSummary 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"`
	// Users holds the value of the "users" field.
	Users int `json:"users,omitempty"`
	// Tasks holds the value of the "tasks" field.
	Tasks int `json:"tasks,omitempty"`
	// ActiveTasks holds the value of the "active_tasks" field.
	ActiveTasks int `json:"active_tasks,omitempty"`
	// Items holds the value of the "items" field.
	Items int `json:"items,omitempty"`
	// AvgItemsPerTask holds the value of the "avg_items_per_task" field.
	AvgItemsPerTask float64 `json:"avg_items_per_task,omitempty"`
	// contains filtered or unexported fields
}

SystemSummary is the model entity for the SystemSummary schema.

func (*SystemSummary) String

func (ss *SystemSummary) String() string

String implements the fmt.Stringer.

func (*SystemSummary) Unwrap

func (ss *SystemSummary) Unwrap() *SystemSummary

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

func (*SystemSummary) Update

func (ss *SystemSummary) Update() *SystemSummaryUpdateOne

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

type SystemSummaryClient

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

SystemSummaryClient is a client for the SystemSummary schema.

func NewSystemSummaryClient

func NewSystemSummaryClient(c config) *SystemSummaryClient

NewSystemSummaryClient returns a client for the SystemSummary from the given config.

func (*SystemSummaryClient) Create

Create returns a create builder for SystemSummary.

func (*SystemSummaryClient) CreateBulk

BulkCreate returns a builder for creating a bulk of SystemSummary entities.

func (*SystemSummaryClient) Delete

Delete returns a delete builder for SystemSummary.

func (*SystemSummaryClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*SystemSummaryClient) DeleteOneID

func (c *SystemSummaryClient) DeleteOneID(id int) *SystemSummaryDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*SystemSummaryClient) Get

Get returns a SystemSummary entity by its id.

func (*SystemSummaryClient) GetX

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

func (*SystemSummaryClient) Hooks

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

Hooks returns the client hooks.

func (*SystemSummaryClient) Query

Query returns a query builder for SystemSummary.

func (*SystemSummaryClient) Update

Update returns an update builder for SystemSummary.

func (*SystemSummaryClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*SystemSummaryClient) UpdateOneID

func (c *SystemSummaryClient) UpdateOneID(id int) *SystemSummaryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SystemSummaryClient) Use

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

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

type SystemSummaryCreate

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

SystemSummaryCreate is the builder for creating a SystemSummary entity.

func (*SystemSummaryCreate) Mutation

func (ssc *SystemSummaryCreate) Mutation() *SystemSummaryMutation

Mutation returns the SystemSummaryMutation object of the builder.

func (*SystemSummaryCreate) Save

Save creates the SystemSummary in the database.

func (*SystemSummaryCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*SystemSummaryCreate) SetActiveTasks

func (ssc *SystemSummaryCreate) SetActiveTasks(i int) *SystemSummaryCreate

SetActiveTasks sets the active_tasks field.

func (*SystemSummaryCreate) SetAvgItemsPerTask

func (ssc *SystemSummaryCreate) SetAvgItemsPerTask(f float64) *SystemSummaryCreate

SetAvgItemsPerTask sets the avg_items_per_task field.

func (*SystemSummaryCreate) SetCreateTime

func (ssc *SystemSummaryCreate) SetCreateTime(t time.Time) *SystemSummaryCreate

SetCreateTime sets the create_time field.

func (*SystemSummaryCreate) SetItems

func (ssc *SystemSummaryCreate) SetItems(i int) *SystemSummaryCreate

SetItems sets the items field.

func (*SystemSummaryCreate) SetNillableCreateTime

func (ssc *SystemSummaryCreate) SetNillableCreateTime(t *time.Time) *SystemSummaryCreate

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

func (*SystemSummaryCreate) SetTasks

func (ssc *SystemSummaryCreate) SetTasks(i int) *SystemSummaryCreate

SetTasks sets the tasks field.

func (*SystemSummaryCreate) SetUsers

func (ssc *SystemSummaryCreate) SetUsers(i int) *SystemSummaryCreate

SetUsers sets the users field.

type SystemSummaryCreateBulk

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

SystemSummaryCreateBulk is the builder for creating a bulk of SystemSummary entities.

func (*SystemSummaryCreateBulk) Save

Save creates the SystemSummary entities in the database.

func (*SystemSummaryCreateBulk) SaveX

SaveX calls Save and panics if Save returns an error.

type SystemSummaryDelete

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

SystemSummaryDelete is the builder for deleting a SystemSummary entity.

func (*SystemSummaryDelete) Exec

func (ssd *SystemSummaryDelete) Exec(ctx context.Context) (int, error)

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

func (*SystemSummaryDelete) ExecX

func (ssd *SystemSummaryDelete) ExecX(ctx context.Context) int

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

func (*SystemSummaryDelete) Where

Where adds a new predicate to the delete builder.

type SystemSummaryDeleteOne

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

SystemSummaryDeleteOne is the builder for deleting a single SystemSummary entity.

func (*SystemSummaryDeleteOne) Exec

func (ssdo *SystemSummaryDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SystemSummaryDeleteOne) ExecX

func (ssdo *SystemSummaryDeleteOne) ExecX(ctx context.Context)

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

type SystemSummaryGroupBy

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

SystemSummaryGroupBy is the builder for group-by SystemSummary entities.

func (*SystemSummaryGroupBy) Aggregate

func (ssgb *SystemSummaryGroupBy) Aggregate(fns ...AggregateFunc) *SystemSummaryGroupBy

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

func (*SystemSummaryGroupBy) Bool

func (ssgb *SystemSummaryGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*SystemSummaryGroupBy) BoolX

func (ssgb *SystemSummaryGroupBy) BoolX(ctx context.Context) bool

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

func (*SystemSummaryGroupBy) Bools

func (ssgb *SystemSummaryGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*SystemSummaryGroupBy) BoolsX

func (ssgb *SystemSummaryGroupBy) BoolsX(ctx context.Context) []bool

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

func (*SystemSummaryGroupBy) Float64

func (ssgb *SystemSummaryGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*SystemSummaryGroupBy) Float64X

func (ssgb *SystemSummaryGroupBy) Float64X(ctx context.Context) float64

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

func (*SystemSummaryGroupBy) Float64s

func (ssgb *SystemSummaryGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*SystemSummaryGroupBy) Float64sX

func (ssgb *SystemSummaryGroupBy) Float64sX(ctx context.Context) []float64

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

func (*SystemSummaryGroupBy) Int

func (ssgb *SystemSummaryGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*SystemSummaryGroupBy) IntX

func (ssgb *SystemSummaryGroupBy) IntX(ctx context.Context) int

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

func (*SystemSummaryGroupBy) Ints

func (ssgb *SystemSummaryGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*SystemSummaryGroupBy) IntsX

func (ssgb *SystemSummaryGroupBy) IntsX(ctx context.Context) []int

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

func (*SystemSummaryGroupBy) Scan

func (ssgb *SystemSummaryGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*SystemSummaryGroupBy) ScanX

func (ssgb *SystemSummaryGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*SystemSummaryGroupBy) String

func (ssgb *SystemSummaryGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*SystemSummaryGroupBy) StringX

func (ssgb *SystemSummaryGroupBy) StringX(ctx context.Context) string

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

func (*SystemSummaryGroupBy) Strings

func (ssgb *SystemSummaryGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*SystemSummaryGroupBy) StringsX

func (ssgb *SystemSummaryGroupBy) StringsX(ctx context.Context) []string

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

type SystemSummaryMutation

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

SystemSummaryMutation represents an operation that mutate the SystemSummaries nodes in the graph.

func (*SystemSummaryMutation) ActiveTasks

func (m *SystemSummaryMutation) ActiveTasks() (r int, exists bool)

ActiveTasks returns the active_tasks value in the mutation.

func (*SystemSummaryMutation) AddActiveTasks

func (m *SystemSummaryMutation) AddActiveTasks(i int)

AddActiveTasks adds i to active_tasks.

func (*SystemSummaryMutation) AddAvgItemsPerTask

func (m *SystemSummaryMutation) AddAvgItemsPerTask(f float64)

AddAvgItemsPerTask adds f to avg_items_per_task.

func (*SystemSummaryMutation) AddField

func (m *SystemSummaryMutation) AddField(name string, value ent.Value) error

AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*SystemSummaryMutation) AddItems

func (m *SystemSummaryMutation) AddItems(i int)

AddItems adds i to items.

func (*SystemSummaryMutation) AddTasks

func (m *SystemSummaryMutation) AddTasks(i int)

AddTasks adds i to tasks.

func (*SystemSummaryMutation) AddUsers

func (m *SystemSummaryMutation) AddUsers(i int)

AddUsers adds i to users.

func (*SystemSummaryMutation) AddedActiveTasks

func (m *SystemSummaryMutation) AddedActiveTasks() (r int, exists bool)

AddedActiveTasks returns the value that was added to the active_tasks field in this mutation.

func (*SystemSummaryMutation) AddedAvgItemsPerTask

func (m *SystemSummaryMutation) AddedAvgItemsPerTask() (r float64, exists bool)

AddedAvgItemsPerTask returns the value that was added to the avg_items_per_task field in this mutation.

func (*SystemSummaryMutation) AddedEdges

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

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

func (*SystemSummaryMutation) AddedField

func (m *SystemSummaryMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*SystemSummaryMutation) AddedFields

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

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

func (*SystemSummaryMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*SystemSummaryMutation) AddedItems

func (m *SystemSummaryMutation) AddedItems() (r int, exists bool)

AddedItems returns the value that was added to the items field in this mutation.

func (*SystemSummaryMutation) AddedTasks

func (m *SystemSummaryMutation) AddedTasks() (r int, exists bool)

AddedTasks returns the value that was added to the tasks field in this mutation.

func (*SystemSummaryMutation) AddedUsers

func (m *SystemSummaryMutation) AddedUsers() (r int, exists bool)

AddedUsers returns the value that was added to the users field in this mutation.

func (*SystemSummaryMutation) AvgItemsPerTask

func (m *SystemSummaryMutation) AvgItemsPerTask() (r float64, exists bool)

AvgItemsPerTask returns the avg_items_per_task value in the mutation.

func (*SystemSummaryMutation) ClearEdge

func (m *SystemSummaryMutation) ClearEdge(name string) error

ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.

func (*SystemSummaryMutation) ClearField

func (m *SystemSummaryMutation) ClearField(name string) error

ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.

func (*SystemSummaryMutation) ClearedEdges

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

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

func (*SystemSummaryMutation) ClearedFields

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

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

func (SystemSummaryMutation) Client

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

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

CreateTime returns the create_time value in the mutation.

func (*SystemSummaryMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*SystemSummaryMutation) Field

func (m *SystemSummaryMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean value indicates that this field was not set, or was not define in the schema.

func (*SystemSummaryMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*SystemSummaryMutation) Fields

func (m *SystemSummaryMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that, in order to get all numeric fields that were in/decremented, call AddedFields().

func (*SystemSummaryMutation) ID

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

ID returns the id value in the mutation. Note that, the id is available only if it was provided to the builder.

func (*SystemSummaryMutation) Items

func (m *SystemSummaryMutation) Items() (r int, exists bool)

Items returns the items value in the mutation.

func (*SystemSummaryMutation) OldActiveTasks

func (m *SystemSummaryMutation) OldActiveTasks(ctx context.Context) (v int, err error)

OldActiveTasks returns the old active_tasks value of the SystemSummary. If the SystemSummary 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 database query fails.

func (*SystemSummaryMutation) OldAvgItemsPerTask

func (m *SystemSummaryMutation) OldAvgItemsPerTask(ctx context.Context) (v float64, err error)

OldAvgItemsPerTask returns the old avg_items_per_task value of the SystemSummary. If the SystemSummary 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 database query fails.

func (*SystemSummaryMutation) OldCreateTime

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

OldCreateTime returns the old create_time value of the SystemSummary. If the SystemSummary 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 database query fails.

func (*SystemSummaryMutation) OldField

func (m *SystemSummaryMutation) 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 was failed.

func (*SystemSummaryMutation) OldItems

func (m *SystemSummaryMutation) OldItems(ctx context.Context) (v int, err error)

OldItems returns the old items value of the SystemSummary. If the SystemSummary 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 database query fails.

func (*SystemSummaryMutation) OldTasks

func (m *SystemSummaryMutation) OldTasks(ctx context.Context) (v int, err error)

OldTasks returns the old tasks value of the SystemSummary. If the SystemSummary 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 database query fails.

func (*SystemSummaryMutation) OldUsers

func (m *SystemSummaryMutation) OldUsers(ctx context.Context) (v int, err error)

OldUsers returns the old users value of the SystemSummary. If the SystemSummary 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 database query fails.

func (*SystemSummaryMutation) Op

func (m *SystemSummaryMutation) Op() Op

Op returns the operation name.

func (*SystemSummaryMutation) RemovedEdges

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

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

func (*SystemSummaryMutation) RemovedIDs

func (m *SystemSummaryMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*SystemSummaryMutation) ResetActiveTasks

func (m *SystemSummaryMutation) ResetActiveTasks()

ResetActiveTasks reset all changes of the "active_tasks" field.

func (*SystemSummaryMutation) ResetAvgItemsPerTask

func (m *SystemSummaryMutation) ResetAvgItemsPerTask()

ResetAvgItemsPerTask reset all changes of the "avg_items_per_task" field.

func (*SystemSummaryMutation) ResetCreateTime

func (m *SystemSummaryMutation) ResetCreateTime()

ResetCreateTime reset all changes of the "create_time" field.

func (*SystemSummaryMutation) ResetEdge

func (m *SystemSummaryMutation) ResetEdge(name string) error

ResetEdge resets all changes in the mutation regarding the given edge name. It returns an error if the edge is not defined in the schema.

func (*SystemSummaryMutation) ResetField

func (m *SystemSummaryMutation) ResetField(name string) error

ResetField resets all changes in the mutation regarding the given field name. It returns an error if the field is not defined in the schema.

func (*SystemSummaryMutation) ResetItems

func (m *SystemSummaryMutation) ResetItems()

ResetItems reset all changes of the "items" field.

func (*SystemSummaryMutation) ResetTasks

func (m *SystemSummaryMutation) ResetTasks()

ResetTasks reset all changes of the "tasks" field.

func (*SystemSummaryMutation) ResetUsers

func (m *SystemSummaryMutation) ResetUsers()

ResetUsers reset all changes of the "users" field.

func (*SystemSummaryMutation) SetActiveTasks

func (m *SystemSummaryMutation) SetActiveTasks(i int)

SetActiveTasks sets the active_tasks field.

func (*SystemSummaryMutation) SetAvgItemsPerTask

func (m *SystemSummaryMutation) SetAvgItemsPerTask(f float64)

SetAvgItemsPerTask sets the avg_items_per_task field.

func (*SystemSummaryMutation) SetCreateTime

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

SetCreateTime sets the create_time field.

func (*SystemSummaryMutation) SetField

func (m *SystemSummaryMutation) SetField(name string, value ent.Value) error

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*SystemSummaryMutation) SetItems

func (m *SystemSummaryMutation) SetItems(i int)

SetItems sets the items field.

func (*SystemSummaryMutation) SetTasks

func (m *SystemSummaryMutation) SetTasks(i int)

SetTasks sets the tasks field.

func (*SystemSummaryMutation) SetUsers

func (m *SystemSummaryMutation) SetUsers(i int)

SetUsers sets the users field.

func (*SystemSummaryMutation) Tasks

func (m *SystemSummaryMutation) Tasks() (r int, exists bool)

Tasks returns the tasks value in the mutation.

func (SystemSummaryMutation) Tx

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

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

func (*SystemSummaryMutation) Type

func (m *SystemSummaryMutation) Type() string

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

func (*SystemSummaryMutation) Users

func (m *SystemSummaryMutation) Users() (r int, exists bool)

Users returns the users value in the mutation.

type SystemSummaryQuery

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

SystemSummaryQuery is the builder for querying SystemSummary entities.

func (*SystemSummaryQuery) All

All executes the query and returns a list of SystemSummaries.

func (*SystemSummaryQuery) AllX

func (ssq *SystemSummaryQuery) AllX(ctx context.Context) []*SystemSummary

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

func (*SystemSummaryQuery) Clone

func (ssq *SystemSummaryQuery) Clone() *SystemSummaryQuery

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

func (*SystemSummaryQuery) Count

func (ssq *SystemSummaryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SystemSummaryQuery) CountX

func (ssq *SystemSummaryQuery) CountX(ctx context.Context) int

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

func (*SystemSummaryQuery) Exist

func (ssq *SystemSummaryQuery) Exist(ctx context.Context) (bool, error)

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

func (*SystemSummaryQuery) ExistX

func (ssq *SystemSummaryQuery) ExistX(ctx context.Context) bool

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

func (*SystemSummaryQuery) First

First returns the first SystemSummary entity in the query. Returns *NotFoundError when no systemsummary was found.

func (*SystemSummaryQuery) FirstID

func (ssq *SystemSummaryQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first SystemSummary id in the query. Returns *NotFoundError when no id was found.

func (*SystemSummaryQuery) FirstX

func (ssq *SystemSummaryQuery) FirstX(ctx context.Context) *SystemSummary

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

func (*SystemSummaryQuery) FirstXID

func (ssq *SystemSummaryQuery) FirstXID(ctx context.Context) int

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

func (*SystemSummaryQuery) GroupBy

func (ssq *SystemSummaryQuery) GroupBy(field string, fields ...string) *SystemSummaryGroupBy

GroupBy 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.SystemSummary.Query().
	GroupBy(systemsummary.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SystemSummaryQuery) IDs

func (ssq *SystemSummaryQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of SystemSummary ids.

func (*SystemSummaryQuery) IDsX

func (ssq *SystemSummaryQuery) IDsX(ctx context.Context) []int

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

func (*SystemSummaryQuery) Limit

func (ssq *SystemSummaryQuery) Limit(limit int) *SystemSummaryQuery

Limit adds a limit step to the query.

func (*SystemSummaryQuery) Offset

func (ssq *SystemSummaryQuery) Offset(offset int) *SystemSummaryQuery

Offset adds an offset step to the query.

func (*SystemSummaryQuery) Only

Only returns the only SystemSummary entity in the query, returns an error if not exactly one entity was returned.

func (*SystemSummaryQuery) OnlyID

func (ssq *SystemSummaryQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only SystemSummary id in the query, returns an error if not exactly one id was returned.

func (*SystemSummaryQuery) OnlyIDX

func (ssq *SystemSummaryQuery) OnlyIDX(ctx context.Context) int

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

func (*SystemSummaryQuery) OnlyX

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

func (*SystemSummaryQuery) Order

Order adds an order step to the query.

func (*SystemSummaryQuery) Select

func (ssq *SystemSummaryQuery) Select(field string, fields ...string) *SystemSummarySelect

Select one or more fields from the given query.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.SystemSummary.Query().
	Select(systemsummary.FieldCreateTime).
	Scan(ctx, &v)

func (*SystemSummaryQuery) Where

Where adds a new predicate for the builder.

type SystemSummarySelect

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

SystemSummarySelect is the builder for select fields of SystemSummary entities.

func (*SystemSummarySelect) Bool

func (sss *SystemSummarySelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*SystemSummarySelect) BoolX

func (sss *SystemSummarySelect) BoolX(ctx context.Context) bool

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

func (*SystemSummarySelect) Bools

func (sss *SystemSummarySelect) Bools(ctx context.Context) ([]bool, error)

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

func (*SystemSummarySelect) BoolsX

func (sss *SystemSummarySelect) BoolsX(ctx context.Context) []bool

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

func (*SystemSummarySelect) Float64

func (sss *SystemSummarySelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*SystemSummarySelect) Float64X

func (sss *SystemSummarySelect) Float64X(ctx context.Context) float64

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

func (*SystemSummarySelect) Float64s

func (sss *SystemSummarySelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*SystemSummarySelect) Float64sX

func (sss *SystemSummarySelect) Float64sX(ctx context.Context) []float64

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

func (*SystemSummarySelect) Int

func (sss *SystemSummarySelect) Int(ctx context.Context) (_ int, err error)

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

func (*SystemSummarySelect) IntX

func (sss *SystemSummarySelect) IntX(ctx context.Context) int

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

func (*SystemSummarySelect) Ints

func (sss *SystemSummarySelect) Ints(ctx context.Context) ([]int, error)

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

func (*SystemSummarySelect) IntsX

func (sss *SystemSummarySelect) IntsX(ctx context.Context) []int

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

func (*SystemSummarySelect) Scan

func (sss *SystemSummarySelect) Scan(ctx context.Context, v interface{}) error

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

func (*SystemSummarySelect) ScanX

func (sss *SystemSummarySelect) ScanX(ctx context.Context, v interface{})

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

func (*SystemSummarySelect) String

func (sss *SystemSummarySelect) String(ctx context.Context) (_ string, err error)

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

func (*SystemSummarySelect) StringX

func (sss *SystemSummarySelect) StringX(ctx context.Context) string

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

func (*SystemSummarySelect) Strings

func (sss *SystemSummarySelect) Strings(ctx context.Context) ([]string, error)

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

func (*SystemSummarySelect) StringsX

func (sss *SystemSummarySelect) StringsX(ctx context.Context) []string

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

type SystemSummaryUpdate

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

SystemSummaryUpdate is the builder for updating SystemSummary entities.

func (*SystemSummaryUpdate) AddActiveTasks

func (ssu *SystemSummaryUpdate) AddActiveTasks(i int) *SystemSummaryUpdate

AddActiveTasks adds i to active_tasks.

func (*SystemSummaryUpdate) AddAvgItemsPerTask

func (ssu *SystemSummaryUpdate) AddAvgItemsPerTask(f float64) *SystemSummaryUpdate

AddAvgItemsPerTask adds f to avg_items_per_task.

func (*SystemSummaryUpdate) AddItems

func (ssu *SystemSummaryUpdate) AddItems(i int) *SystemSummaryUpdate

AddItems adds i to items.

func (*SystemSummaryUpdate) AddTasks

func (ssu *SystemSummaryUpdate) AddTasks(i int) *SystemSummaryUpdate

AddTasks adds i to tasks.

func (*SystemSummaryUpdate) AddUsers

func (ssu *SystemSummaryUpdate) AddUsers(i int) *SystemSummaryUpdate

AddUsers adds i to users.

func (*SystemSummaryUpdate) Exec

func (ssu *SystemSummaryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SystemSummaryUpdate) ExecX

func (ssu *SystemSummaryUpdate) ExecX(ctx context.Context)

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

func (*SystemSummaryUpdate) Mutation

func (ssu *SystemSummaryUpdate) Mutation() *SystemSummaryMutation

Mutation returns the SystemSummaryMutation object of the builder.

func (*SystemSummaryUpdate) Save

func (ssu *SystemSummaryUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*SystemSummaryUpdate) SaveX

func (ssu *SystemSummaryUpdate) SaveX(ctx context.Context) int

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

func (*SystemSummaryUpdate) SetActiveTasks

func (ssu *SystemSummaryUpdate) SetActiveTasks(i int) *SystemSummaryUpdate

SetActiveTasks sets the active_tasks field.

func (*SystemSummaryUpdate) SetAvgItemsPerTask

func (ssu *SystemSummaryUpdate) SetAvgItemsPerTask(f float64) *SystemSummaryUpdate

SetAvgItemsPerTask sets the avg_items_per_task field.

func (*SystemSummaryUpdate) SetItems

func (ssu *SystemSummaryUpdate) SetItems(i int) *SystemSummaryUpdate

SetItems sets the items field.

func (*SystemSummaryUpdate) SetTasks

func (ssu *SystemSummaryUpdate) SetTasks(i int) *SystemSummaryUpdate

SetTasks sets the tasks field.

func (*SystemSummaryUpdate) SetUsers

func (ssu *SystemSummaryUpdate) SetUsers(i int) *SystemSummaryUpdate

SetUsers sets the users field.

func (*SystemSummaryUpdate) Where

Where adds a new predicate for the builder.

type SystemSummaryUpdateOne

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

SystemSummaryUpdateOne is the builder for updating a single SystemSummary entity.

func (*SystemSummaryUpdateOne) AddActiveTasks

func (ssuo *SystemSummaryUpdateOne) AddActiveTasks(i int) *SystemSummaryUpdateOne

AddActiveTasks adds i to active_tasks.

func (*SystemSummaryUpdateOne) AddAvgItemsPerTask

func (ssuo *SystemSummaryUpdateOne) AddAvgItemsPerTask(f float64) *SystemSummaryUpdateOne

AddAvgItemsPerTask adds f to avg_items_per_task.

func (*SystemSummaryUpdateOne) AddItems

AddItems adds i to items.

func (*SystemSummaryUpdateOne) AddTasks

AddTasks adds i to tasks.

func (*SystemSummaryUpdateOne) AddUsers

AddUsers adds i to users.

func (*SystemSummaryUpdateOne) Exec

func (ssuo *SystemSummaryUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SystemSummaryUpdateOne) ExecX

func (ssuo *SystemSummaryUpdateOne) ExecX(ctx context.Context)

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

func (*SystemSummaryUpdateOne) Mutation

Mutation returns the SystemSummaryMutation object of the builder.

func (*SystemSummaryUpdateOne) Save

Save executes the query and returns the updated entity.

func (*SystemSummaryUpdateOne) SaveX

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

func (*SystemSummaryUpdateOne) SetActiveTasks

func (ssuo *SystemSummaryUpdateOne) SetActiveTasks(i int) *SystemSummaryUpdateOne

SetActiveTasks sets the active_tasks field.

func (*SystemSummaryUpdateOne) SetAvgItemsPerTask

func (ssuo *SystemSummaryUpdateOne) SetAvgItemsPerTask(f float64) *SystemSummaryUpdateOne

SetAvgItemsPerTask sets the avg_items_per_task field.

func (*SystemSummaryUpdateOne) SetItems

SetItems sets the items field.

func (*SystemSummaryUpdateOne) SetTasks

SetTasks sets the tasks field.

func (*SystemSummaryUpdateOne) SetUsers

SetUsers sets the users field.

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"`
	// Slug holds the value of the "slug" field.
	Slug string `json:"slug,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"`
	// Code holds the value of the "code" field.
	Code string `json:"code,omitempty"`
	// Active holds the value of the "active" field.
	Active bool `json:"active,omitempty"`
	// DeleteTime holds the value of the "delete_time" field.
	DeleteTime time.Time `json:"delete_time,omitempty"`
	// Params holds the value of the "params" field.
	Params domain.TaskParams `json:"params,omitempty"`
	// Meta holds the value of the "meta" field.
	Meta domain.TaskMeta `json:"meta,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) QueryItems

func (t *Task) QueryItems() *ItemQuery

QueryItems queries the items edge of the Task.

func (*Task) QueryType

func (t *Task) QueryType() *TaskTypeQuery

QueryType queries the type edge of the Task.

func (*Task) QueryUser

func (t *Task) QueryUser() *UserQuery

QueryUser queries the user edge of the Task.

func (*Task) String

func (t *Task) String() string

String implements the fmt.Stringer.

func (*Task) Unwrap

func (t *Task) Unwrap() *Task

Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next 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 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

BulkCreate 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) QueryItems

func (c *TaskClient) QueryItems(t *Task) *ItemQuery

QueryItems queries the items edge of a Task.

func (*TaskClient) QueryType

func (c *TaskClient) QueryType(t *Task) *TaskTypeQuery

QueryType queries the type edge of a Task.

func (*TaskClient) QueryUser

func (c *TaskClient) QueryUser(t *Task) *UserQuery

QueryUser queries the user 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) AddItemIDs

func (tc *TaskCreate) AddItemIDs(ids ...int) *TaskCreate

AddItemIDs adds the items edge to Item by ids.

func (*TaskCreate) AddItems

func (tc *TaskCreate) AddItems(i ...*Item) *TaskCreate

AddItems adds the items edges to Item.

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

func (tc *TaskCreate) SetDeleteTime(t time.Time) *TaskCreate

SetDeleteTime sets the delete_time field.

func (*TaskCreate) SetDescription

func (tc *TaskCreate) SetDescription(s string) *TaskCreate

SetDescription sets the description field.

func (*TaskCreate) SetMeta

func (tc *TaskCreate) SetMeta(dm domain.TaskMeta) *TaskCreate

SetMeta sets the meta 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) SetNillableDeleteTime

func (tc *TaskCreate) SetNillableDeleteTime(t *time.Time) *TaskCreate

SetNillableDeleteTime sets the delete_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) SetNillableMeta

func (tc *TaskCreate) SetNillableMeta(dm *domain.TaskMeta) *TaskCreate

SetNillableMeta sets the meta field if the given value is not nil.

func (*TaskCreate) SetNillableParams

func (tc *TaskCreate) SetNillableParams(dp *domain.TaskParams) *TaskCreate

SetNillableParams sets the params 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) SetParams

func (tc *TaskCreate) SetParams(dp domain.TaskParams) *TaskCreate

SetParams sets the params field.

func (*TaskCreate) SetSlug

func (tc *TaskCreate) SetSlug(s string) *TaskCreate

SetSlug sets the slug field.

func (*TaskCreate) SetTitle

func (tc *TaskCreate) SetTitle(s string) *TaskCreate

SetTitle sets the title field.

func (*TaskCreate) SetType

func (tc *TaskCreate) SetType(t *TaskType) *TaskCreate

SetType sets the type edge to TaskType.

func (*TaskCreate) SetTypeID

func (tc *TaskCreate) SetTypeID(id int) *TaskCreate

SetTypeID sets the type edge to TaskType by id.

func (*TaskCreate) SetUpdateTime

func (tc *TaskCreate) SetUpdateTime(t time.Time) *TaskCreate

SetUpdateTime sets the update_time field.

func (*TaskCreate) SetUser

func (tc *TaskCreate) SetUser(u *User) *TaskCreate

SetUser sets the user edge to User.

func (*TaskCreate) SetUserID

func (tc *TaskCreate) SetUserID(id int) *TaskCreate

SetUserID sets the user edge to User by id.

type TaskCreateBulk

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

TaskCreateBulk is the builder for creating a bulk of Task entities.

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 calls Save and panics if Save returns an error.

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 adds a new predicate to the delete 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 {
	// Items holds the value of the items edge.
	Items []*Item
	// User holds the value of the user edge.
	User *User
	// Type holds the value of the type edge.
	Type *TaskType
	// contains filtered or unexported fields
}

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

func (TaskEdges) ItemsOrErr

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

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

func (TaskEdges) TypeOrErr

func (e TaskEdges) TypeOrErr() (*TaskType, error)

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

func (TaskEdges) UserOrErr

func (e TaskEdges) UserOrErr() (*User, error)

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

type TaskGroupBy

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

TaskGroupBy is the builder for group-by 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 group-by. It is only allowed when querying group-by 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 querying group-by 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 group-by. It is only allowed when querying group-by 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 querying group-by 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 group-by. It is only allowed when querying group-by 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 querying group-by 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 scan 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 group-by. It is only allowed when querying group-by 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 querying group-by 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 TaskMutation

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

TaskMutation represents an operation that mutate the Tasks nodes in the graph.

func (*TaskMutation) Active

func (m *TaskMutation) Active() (r bool, exists bool)

Active returns the active value in the mutation.

func (*TaskMutation) AddField

func (m *TaskMutation) AddField(name string, value ent.Value) error

AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*TaskMutation) AddItemIDs

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

AddItemIDs adds the items edge to Item 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 in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*TaskMutation) AddedFields

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

AddedFields returns all numeric fields that were incremented or 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.

func (*TaskMutation) ClearDeleteTime

func (m *TaskMutation) ClearDeleteTime()

ClearDeleteTime clears the value of delete_time.

func (*TaskMutation) ClearDescription

func (m *TaskMutation) ClearDescription()

ClearDescription clears the value of description.

func (*TaskMutation) ClearEdge

func (m *TaskMutation) ClearEdge(name string) error

ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.

func (*TaskMutation) ClearField

func (m *TaskMutation) ClearField(name string) error

ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.

func (*TaskMutation) ClearMeta

func (m *TaskMutation) ClearMeta()

ClearMeta clears the value of meta.

func (*TaskMutation) ClearParams

func (m *TaskMutation) ClearParams()

ClearParams clears the value of params.

func (*TaskMutation) ClearType

func (m *TaskMutation) ClearType()

ClearType clears the type edge to TaskType.

func (*TaskMutation) ClearUser

func (m *TaskMutation) ClearUser()

ClearUser clears the user edge to User.

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 code value in the mutation.

func (*TaskMutation) CreateTime

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

CreateTime returns the create_time value in the mutation.

func (*TaskMutation) DeleteTime

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

DeleteTime returns the delete_time value in the mutation.

func (*TaskMutation) DeleteTimeCleared

func (m *TaskMutation) DeleteTimeCleared() bool

DeleteTimeCleared returns if the field delete_time was cleared in this mutation.

func (*TaskMutation) Description

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

Description returns the description value in the mutation.

func (*TaskMutation) DescriptionCleared

func (m *TaskMutation) DescriptionCleared() bool

DescriptionCleared returns if the field description was cleared in this mutation.

func (*TaskMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge 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 value indicates that this field was not set, or was not define in the schema.

func (*TaskMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field 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 in/decremented, call AddedFields().

func (*TaskMutation) ID

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

ID returns the id value in the mutation. Note that, the id is available only if it was provided to the builder.

func (*TaskMutation) ItemsIDs

func (m *TaskMutation) ItemsIDs() (ids []int)

ItemsIDs returns the items ids in the mutation.

func (*TaskMutation) Meta

func (m *TaskMutation) Meta() (r domain.TaskMeta, exists bool)

Meta returns the meta value in the mutation.

func (*TaskMutation) MetaCleared

func (m *TaskMutation) MetaCleared() bool

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

func (*TaskMutation) OldActive

func (m *TaskMutation) OldActive(ctx context.Context) (v bool, err error)

OldActive returns the old active value of the Task. 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 database query fails.

func (*TaskMutation) OldCode

func (m *TaskMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old code value of the Task. 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 database query fails.

func (*TaskMutation) OldCreateTime

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

OldCreateTime returns the old create_time value of the Task. 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 database query fails.

func (*TaskMutation) OldDeleteTime

func (m *TaskMutation) OldDeleteTime(ctx context.Context) (v time.Time, err error)

OldDeleteTime returns the old delete_time value of the Task. 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 database query fails.

func (*TaskMutation) OldDescription

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

OldDescription returns the old description value of the Task. 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 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 was failed.

func (*TaskMutation) OldMeta

func (m *TaskMutation) OldMeta(ctx context.Context) (v domain.TaskMeta, err error)

OldMeta returns the old meta value of the Task. 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 database query fails.

func (*TaskMutation) OldParams

func (m *TaskMutation) OldParams(ctx context.Context) (v domain.TaskParams, err error)

OldParams returns the old params value of the Task. 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 database query fails.

func (*TaskMutation) OldSlug

func (m *TaskMutation) OldSlug(ctx context.Context) (v string, err error)

OldSlug returns the old slug value of the Task. 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 database query fails.

func (*TaskMutation) OldTitle

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

OldTitle returns the old title value of the Task. 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 database query fails.

func (*TaskMutation) OldUpdateTime

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

OldUpdateTime returns the old update_time value of the Task. 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 database query fails.

func (*TaskMutation) Op

func (m *TaskMutation) Op() Op

Op returns the operation name.

func (*TaskMutation) Params

func (m *TaskMutation) Params() (r domain.TaskParams, exists bool)

Params returns the params value in the mutation.

func (*TaskMutation) ParamsCleared

func (m *TaskMutation) ParamsCleared() bool

ParamsCleared returns if the field params was cleared in this mutation.

func (*TaskMutation) RemoveItemIDs

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

RemoveItemIDs removes the items edge to Item 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 given edge name.

func (*TaskMutation) RemovedItemsIDs

func (m *TaskMutation) RemovedItemsIDs() (ids []int)

RemovedItems returns the removed ids of items.

func (*TaskMutation) ResetActive

func (m *TaskMutation) ResetActive()

ResetActive reset all changes of the "active" field.

func (*TaskMutation) ResetCode

func (m *TaskMutation) ResetCode()

ResetCode reset all changes of the "code" field.

func (*TaskMutation) ResetCreateTime

func (m *TaskMutation) ResetCreateTime()

ResetCreateTime reset all changes of the "create_time" field.

func (*TaskMutation) ResetDeleteTime

func (m *TaskMutation) ResetDeleteTime()

ResetDeleteTime reset all changes of the "delete_time" field.

func (*TaskMutation) ResetDescription

func (m *TaskMutation) ResetDescription()

ResetDescription reset all changes of the "description" field.

func (*TaskMutation) ResetEdge

func (m *TaskMutation) ResetEdge(name string) error

ResetEdge resets all changes in the mutation regarding the given edge name. 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 regarding the given field name. It returns an error if the field is not defined in the schema.

func (*TaskMutation) ResetItems

func (m *TaskMutation) ResetItems()

ResetItems reset all changes of the "items" edge.

func (*TaskMutation) ResetMeta

func (m *TaskMutation) ResetMeta()

ResetMeta reset all changes of the "meta" field.

func (*TaskMutation) ResetParams

func (m *TaskMutation) ResetParams()

ResetParams reset all changes of the "params" field.

func (*TaskMutation) ResetSlug

func (m *TaskMutation) ResetSlug()

ResetSlug reset all changes of the "slug" field.

func (*TaskMutation) ResetTitle

func (m *TaskMutation) ResetTitle()

ResetTitle reset all changes of the "title" field.

func (*TaskMutation) ResetType

func (m *TaskMutation) ResetType()

ResetType reset all changes of the "type" edge.

func (*TaskMutation) ResetUpdateTime

func (m *TaskMutation) ResetUpdateTime()

ResetUpdateTime reset all changes of the "update_time" field.

func (*TaskMutation) ResetUser

func (m *TaskMutation) ResetUser()

ResetUser reset all changes of the "user" edge.

func (*TaskMutation) SetActive

func (m *TaskMutation) SetActive(b bool)

SetActive sets the active field.

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

func (m *TaskMutation) SetDeleteTime(t time.Time)

SetDeleteTime sets the delete_time field.

func (*TaskMutation) SetDescription

func (m *TaskMutation) SetDescription(s string)

SetDescription sets the description field.

func (*TaskMutation) SetField

func (m *TaskMutation) SetField(name string, value ent.Value) error

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*TaskMutation) SetMeta

func (m *TaskMutation) SetMeta(dm domain.TaskMeta)

SetMeta sets the meta field.

func (*TaskMutation) SetParams

func (m *TaskMutation) SetParams(dp domain.TaskParams)

SetParams sets the params field.

func (*TaskMutation) SetSlug

func (m *TaskMutation) SetSlug(s string)

SetSlug sets the slug field.

func (*TaskMutation) SetTitle

func (m *TaskMutation) SetTitle(s string)

SetTitle sets the title field.

func (*TaskMutation) SetTypeID

func (m *TaskMutation) SetTypeID(id int)

SetTypeID sets the type edge to TaskType by id.

func (*TaskMutation) SetUpdateTime

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

SetUpdateTime sets the update_time field.

func (*TaskMutation) SetUserID

func (m *TaskMutation) SetUserID(id int)

SetUserID sets the user edge to User by id.

func (*TaskMutation) Slug

func (m *TaskMutation) Slug() (r string, exists bool)

Slug returns the slug value in the mutation.

func (*TaskMutation) Title

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

Title returns the title value 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) TypeCleared

func (m *TaskMutation) TypeCleared() bool

TypeCleared returns if the edge type was cleared.

func (*TaskMutation) TypeID

func (m *TaskMutation) TypeID() (id int, exists bool)

TypeID returns the type id in the mutation.

func (*TaskMutation) TypeIDs

func (m *TaskMutation) TypeIDs() (ids []int)

TypeIDs returns the type ids in the mutation. Note that ids always returns len(ids) <= 1 for unique edges, and you should use TypeID instead. It exists only for internal usage by the builders.

func (*TaskMutation) UpdateTime

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

UpdateTime returns the update_time value in the mutation.

func (*TaskMutation) UserCleared

func (m *TaskMutation) UserCleared() bool

UserCleared returns if the edge user was cleared.

func (*TaskMutation) UserID

func (m *TaskMutation) UserID() (id int, exists bool)

UserID returns the user id in the mutation.

func (*TaskMutation) UserIDs

func (m *TaskMutation) UserIDs() (ids []int)

UserIDs returns the user ids in the mutation. Note that ids always returns len(ids) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

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 query 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 in the query. Returns *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 in the query. Returns *NotFoundError when no id was found.

func (*TaskQuery) FirstX

func (tq *TaskQuery) FirstX(ctx context.Context) *Task

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

func (*TaskQuery) FirstXID

func (tq *TaskQuery) FirstXID(ctx context.Context) int

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

func (*TaskQuery) GroupBy

func (tq *TaskQuery) GroupBy(field string, fields ...string) *TaskGroupBy

GroupBy 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 the only Task entity in the query, returns an error if not exactly one entity was returned.

func (*TaskQuery) OnlyID

func (tq *TaskQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only Task id in the query, returns an error if not exactly one id was returned.

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

func (tq *TaskQuery) QueryItems() *ItemQuery

QueryItems chains the current query on the items edge.

func (*TaskQuery) QueryType

func (tq *TaskQuery) QueryType() *TaskTypeQuery

QueryType chains the current query on the type edge.

func (*TaskQuery) QueryUser

func (tq *TaskQuery) QueryUser() *UserQuery

QueryUser chains the current query on the user edge.

func (*TaskQuery) Select

func (tq *TaskQuery) Select(field string, fields ...string) *TaskSelect

Select one or more fields from the given query.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Task.Query().
	Select(task.FieldCreateTime).
	Scan(ctx, &v)

func (*TaskQuery) Where

func (tq *TaskQuery) Where(ps ...predicate.Task) *TaskQuery

Where adds a new predicate for the builder.

func (*TaskQuery) WithItems

func (tq *TaskQuery) WithItems(opts ...func(*ItemQuery)) *TaskQuery
WithItems tells the query-builder to eager-loads the nodes that are connected to

the "items" edge. The optional arguments used to configure the query builder of the edge.

func (*TaskQuery) WithType

func (tq *TaskQuery) WithType(opts ...func(*TaskTypeQuery)) *TaskQuery
WithType tells the query-builder to eager-loads the nodes that are connected to

the "type" edge. The optional arguments used to configure the query builder of the edge.

func (*TaskQuery) WithUser

func (tq *TaskQuery) WithUser(opts ...func(*UserQuery)) *TaskQuery
WithUser tells the query-builder to eager-loads the nodes that are connected to

the "user" edge. The optional arguments used to configure the query builder of the edge.

type TaskSelect

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

TaskSelect is the builder for select fields of Task entities.

func (*TaskSelect) Bool

func (ts *TaskSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from 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 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 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 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 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 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 scan 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 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 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 TaskType

type TaskType struct {

	// ID of the ent.
	ID int `json:"id,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"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TaskTypeQuery when eager-loading is set.
	Edges TaskTypeEdges `json:"edges"`
	// contains filtered or unexported fields
}

TaskType is the model entity for the TaskType schema.

func (*TaskType) QueryTasks

func (tt *TaskType) QueryTasks() *TaskQuery

QueryTasks queries the tasks edge of the TaskType.

func (*TaskType) String

func (tt *TaskType) String() string

String implements the fmt.Stringer.

func (*TaskType) Unwrap

func (tt *TaskType) Unwrap() *TaskType

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

func (*TaskType) Update

func (tt *TaskType) Update() *TaskTypeUpdateOne

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

type TaskTypeClient

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

TaskTypeClient is a client for the TaskType schema.

func NewTaskTypeClient

func NewTaskTypeClient(c config) *TaskTypeClient

NewTaskTypeClient returns a client for the TaskType from the given config.

func (*TaskTypeClient) Create

func (c *TaskTypeClient) Create() *TaskTypeCreate

Create returns a create builder for TaskType.

func (*TaskTypeClient) CreateBulk

func (c *TaskTypeClient) CreateBulk(builders ...*TaskTypeCreate) *TaskTypeCreateBulk

BulkCreate returns a builder for creating a bulk of TaskType entities.

func (*TaskTypeClient) Delete

func (c *TaskTypeClient) Delete() *TaskTypeDelete

Delete returns a delete builder for TaskType.

func (*TaskTypeClient) DeleteOne

func (c *TaskTypeClient) DeleteOne(tt *TaskType) *TaskTypeDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*TaskTypeClient) DeleteOneID

func (c *TaskTypeClient) DeleteOneID(id int) *TaskTypeDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*TaskTypeClient) Get

func (c *TaskTypeClient) Get(ctx context.Context, id int) (*TaskType, error)

Get returns a TaskType entity by its id.

func (*TaskTypeClient) GetX

func (c *TaskTypeClient) GetX(ctx context.Context, id int) *TaskType

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

func (*TaskTypeClient) Hooks

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

Hooks returns the client hooks.

func (*TaskTypeClient) Query

func (c *TaskTypeClient) Query() *TaskTypeQuery

Query returns a query builder for TaskType.

func (*TaskTypeClient) QueryTasks

func (c *TaskTypeClient) QueryTasks(tt *TaskType) *TaskQuery

QueryTasks queries the tasks edge of a TaskType.

func (*TaskTypeClient) Update

func (c *TaskTypeClient) Update() *TaskTypeUpdate

Update returns an update builder for TaskType.

func (*TaskTypeClient) UpdateOne

func (c *TaskTypeClient) UpdateOne(tt *TaskType) *TaskTypeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TaskTypeClient) UpdateOneID

func (c *TaskTypeClient) UpdateOneID(id int) *TaskTypeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TaskTypeClient) Use

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

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

type TaskTypeCreate

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

TaskTypeCreate is the builder for creating a TaskType entity.

func (*TaskTypeCreate) AddTaskIDs

func (ttc *TaskTypeCreate) AddTaskIDs(ids ...int) *TaskTypeCreate

AddTaskIDs adds the tasks edge to Task by ids.

func (*TaskTypeCreate) AddTasks

func (ttc *TaskTypeCreate) AddTasks(t ...*Task) *TaskTypeCreate

AddTasks adds the tasks edges to Task.

func (*TaskTypeCreate) Mutation

func (ttc *TaskTypeCreate) Mutation() *TaskTypeMutation

Mutation returns the TaskTypeMutation object of the builder.

func (*TaskTypeCreate) Save

func (ttc *TaskTypeCreate) Save(ctx context.Context) (*TaskType, error)

Save creates the TaskType in the database.

func (*TaskTypeCreate) SaveX

func (ttc *TaskTypeCreate) SaveX(ctx context.Context) *TaskType

SaveX calls Save and panics if Save returns an error.

func (*TaskTypeCreate) SetCode

func (ttc *TaskTypeCreate) SetCode(s string) *TaskTypeCreate

SetCode sets the code field.

func (*TaskTypeCreate) SetTitle

func (ttc *TaskTypeCreate) SetTitle(s string) *TaskTypeCreate

SetTitle sets the title field.

type TaskTypeCreateBulk

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

TaskTypeCreateBulk is the builder for creating a bulk of TaskType entities.

func (*TaskTypeCreateBulk) Save

func (ttcb *TaskTypeCreateBulk) Save(ctx context.Context) ([]*TaskType, error)

Save creates the TaskType entities in the database.

func (*TaskTypeCreateBulk) SaveX

func (ttcb *TaskTypeCreateBulk) SaveX(ctx context.Context) []*TaskType

SaveX calls Save and panics if Save returns an error.

type TaskTypeDelete

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

TaskTypeDelete is the builder for deleting a TaskType entity.

func (*TaskTypeDelete) Exec

func (ttd *TaskTypeDelete) Exec(ctx context.Context) (int, error)

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

func (*TaskTypeDelete) ExecX

func (ttd *TaskTypeDelete) ExecX(ctx context.Context) int

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

func (*TaskTypeDelete) Where

func (ttd *TaskTypeDelete) Where(ps ...predicate.TaskType) *TaskTypeDelete

Where adds a new predicate to the delete builder.

type TaskTypeDeleteOne

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

TaskTypeDeleteOne is the builder for deleting a single TaskType entity.

func (*TaskTypeDeleteOne) Exec

func (ttdo *TaskTypeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TaskTypeDeleteOne) ExecX

func (ttdo *TaskTypeDeleteOne) ExecX(ctx context.Context)

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

type TaskTypeEdges

type TaskTypeEdges struct {
	// Tasks holds the value of the tasks edge.
	Tasks []*Task
	// contains filtered or unexported fields
}

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

func (TaskTypeEdges) TasksOrErr

func (e TaskTypeEdges) TasksOrErr() ([]*Task, error)

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

type TaskTypeGroupBy

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

TaskTypeGroupBy is the builder for group-by TaskType entities.

func (*TaskTypeGroupBy) Aggregate

func (ttgb *TaskTypeGroupBy) Aggregate(fns ...AggregateFunc) *TaskTypeGroupBy

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

func (*TaskTypeGroupBy) Bool

func (ttgb *TaskTypeGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*TaskTypeGroupBy) BoolX

func (ttgb *TaskTypeGroupBy) BoolX(ctx context.Context) bool

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

func (*TaskTypeGroupBy) Bools

func (ttgb *TaskTypeGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*TaskTypeGroupBy) BoolsX

func (ttgb *TaskTypeGroupBy) BoolsX(ctx context.Context) []bool

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

func (*TaskTypeGroupBy) Float64

func (ttgb *TaskTypeGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*TaskTypeGroupBy) Float64X

func (ttgb *TaskTypeGroupBy) Float64X(ctx context.Context) float64

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

func (*TaskTypeGroupBy) Float64s

func (ttgb *TaskTypeGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*TaskTypeGroupBy) Float64sX

func (ttgb *TaskTypeGroupBy) Float64sX(ctx context.Context) []float64

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

func (*TaskTypeGroupBy) Int

func (ttgb *TaskTypeGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*TaskTypeGroupBy) IntX

func (ttgb *TaskTypeGroupBy) IntX(ctx context.Context) int

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

func (*TaskTypeGroupBy) Ints

func (ttgb *TaskTypeGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*TaskTypeGroupBy) IntsX

func (ttgb *TaskTypeGroupBy) IntsX(ctx context.Context) []int

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

func (*TaskTypeGroupBy) Scan

func (ttgb *TaskTypeGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*TaskTypeGroupBy) ScanX

func (ttgb *TaskTypeGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*TaskTypeGroupBy) String

func (ttgb *TaskTypeGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*TaskTypeGroupBy) StringX

func (ttgb *TaskTypeGroupBy) StringX(ctx context.Context) string

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

func (*TaskTypeGroupBy) Strings

func (ttgb *TaskTypeGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*TaskTypeGroupBy) StringsX

func (ttgb *TaskTypeGroupBy) StringsX(ctx context.Context) []string

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

type TaskTypeMutation

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

TaskTypeMutation represents an operation that mutate the TaskTypes nodes in the graph.

func (*TaskTypeMutation) AddField

func (m *TaskTypeMutation) AddField(name string, value ent.Value) error

AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*TaskTypeMutation) AddTaskIDs

func (m *TaskTypeMutation) AddTaskIDs(ids ...int)

AddTaskIDs adds the tasks edge to Task by ids.

func (*TaskTypeMutation) AddedEdges

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

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

func (*TaskTypeMutation) AddedField

func (m *TaskTypeMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*TaskTypeMutation) AddedFields

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

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

func (*TaskTypeMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*TaskTypeMutation) ClearEdge

func (m *TaskTypeMutation) ClearEdge(name string) error

ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.

func (*TaskTypeMutation) ClearField

func (m *TaskTypeMutation) ClearField(name string) error

ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.

func (*TaskTypeMutation) ClearedEdges

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

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

func (*TaskTypeMutation) ClearedFields

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

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

func (TaskTypeMutation) Client

func (m TaskTypeMutation) 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 (*TaskTypeMutation) Code

func (m *TaskTypeMutation) Code() (r string, exists bool)

Code returns the code value in the mutation.

func (*TaskTypeMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*TaskTypeMutation) Field

func (m *TaskTypeMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean value indicates that this field was not set, or was not define in the schema.

func (*TaskTypeMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*TaskTypeMutation) Fields

func (m *TaskTypeMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that, in order to get all numeric fields that were in/decremented, call AddedFields().

func (*TaskTypeMutation) ID

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

ID returns the id value in the mutation. Note that, the id is available only if it was provided to the builder.

func (*TaskTypeMutation) OldCode

func (m *TaskTypeMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old code value of the TaskType. If the TaskType 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 database query fails.

func (*TaskTypeMutation) OldField

func (m *TaskTypeMutation) 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 was failed.

func (*TaskTypeMutation) OldTitle

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

OldTitle returns the old title value of the TaskType. If the TaskType 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 database query fails.

func (*TaskTypeMutation) Op

func (m *TaskTypeMutation) Op() Op

Op returns the operation name.

func (*TaskTypeMutation) RemoveTaskIDs

func (m *TaskTypeMutation) RemoveTaskIDs(ids ...int)

RemoveTaskIDs removes the tasks edge to Task by ids.

func (*TaskTypeMutation) RemovedEdges

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

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

func (*TaskTypeMutation) RemovedIDs

func (m *TaskTypeMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*TaskTypeMutation) RemovedTasksIDs

func (m *TaskTypeMutation) RemovedTasksIDs() (ids []int)

RemovedTasks returns the removed ids of tasks.

func (*TaskTypeMutation) ResetCode

func (m *TaskTypeMutation) ResetCode()

ResetCode reset all changes of the "code" field.

func (*TaskTypeMutation) ResetEdge

func (m *TaskTypeMutation) ResetEdge(name string) error

ResetEdge resets all changes in the mutation regarding the given edge name. It returns an error if the edge is not defined in the schema.

func (*TaskTypeMutation) ResetField

func (m *TaskTypeMutation) ResetField(name string) error

ResetField resets all changes in the mutation regarding the given field name. It returns an error if the field is not defined in the schema.

func (*TaskTypeMutation) ResetTasks

func (m *TaskTypeMutation) ResetTasks()

ResetTasks reset all changes of the "tasks" edge.

func (*TaskTypeMutation) ResetTitle

func (m *TaskTypeMutation) ResetTitle()

ResetTitle reset all changes of the "title" field.

func (*TaskTypeMutation) SetCode

func (m *TaskTypeMutation) SetCode(s string)

SetCode sets the code field.

func (*TaskTypeMutation) SetField

func (m *TaskTypeMutation) SetField(name string, value ent.Value) error

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*TaskTypeMutation) SetTitle

func (m *TaskTypeMutation) SetTitle(s string)

SetTitle sets the title field.

func (*TaskTypeMutation) TasksIDs

func (m *TaskTypeMutation) TasksIDs() (ids []int)

TasksIDs returns the tasks ids in the mutation.

func (*TaskTypeMutation) Title

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

Title returns the title value in the mutation.

func (TaskTypeMutation) Tx

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

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

func (*TaskTypeMutation) Type

func (m *TaskTypeMutation) Type() string

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

type TaskTypeQuery

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

TaskTypeQuery is the builder for querying TaskType entities.

func (*TaskTypeQuery) All

func (ttq *TaskTypeQuery) All(ctx context.Context) ([]*TaskType, error)

All executes the query and returns a list of TaskTypes.

func (*TaskTypeQuery) AllX

func (ttq *TaskTypeQuery) AllX(ctx context.Context) []*TaskType

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

func (*TaskTypeQuery) Clone

func (ttq *TaskTypeQuery) Clone() *TaskTypeQuery

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

func (*TaskTypeQuery) Count

func (ttq *TaskTypeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TaskTypeQuery) CountX

func (ttq *TaskTypeQuery) CountX(ctx context.Context) int

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

func (*TaskTypeQuery) Exist

func (ttq *TaskTypeQuery) Exist(ctx context.Context) (bool, error)

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

func (*TaskTypeQuery) ExistX

func (ttq *TaskTypeQuery) ExistX(ctx context.Context) bool

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

func (*TaskTypeQuery) First

func (ttq *TaskTypeQuery) First(ctx context.Context) (*TaskType, error)

First returns the first TaskType entity in the query. Returns *NotFoundError when no tasktype was found.

func (*TaskTypeQuery) FirstID

func (ttq *TaskTypeQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first TaskType id in the query. Returns *NotFoundError when no id was found.

func (*TaskTypeQuery) FirstX

func (ttq *TaskTypeQuery) FirstX(ctx context.Context) *TaskType

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

func (*TaskTypeQuery) FirstXID

func (ttq *TaskTypeQuery) FirstXID(ctx context.Context) int

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

func (*TaskTypeQuery) GroupBy

func (ttq *TaskTypeQuery) GroupBy(field string, fields ...string) *TaskTypeGroupBy

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

client.TaskType.Query().
	GroupBy(tasktype.FieldCode).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TaskTypeQuery) IDs

func (ttq *TaskTypeQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of TaskType ids.

func (*TaskTypeQuery) IDsX

func (ttq *TaskTypeQuery) IDsX(ctx context.Context) []int

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

func (*TaskTypeQuery) Limit

func (ttq *TaskTypeQuery) Limit(limit int) *TaskTypeQuery

Limit adds a limit step to the query.

func (*TaskTypeQuery) Offset

func (ttq *TaskTypeQuery) Offset(offset int) *TaskTypeQuery

Offset adds an offset step to the query.

func (*TaskTypeQuery) Only

func (ttq *TaskTypeQuery) Only(ctx context.Context) (*TaskType, error)

Only returns the only TaskType entity in the query, returns an error if not exactly one entity was returned.

func (*TaskTypeQuery) OnlyID

func (ttq *TaskTypeQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only TaskType id in the query, returns an error if not exactly one id was returned.

func (*TaskTypeQuery) OnlyIDX

func (ttq *TaskTypeQuery) OnlyIDX(ctx context.Context) int

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

func (*TaskTypeQuery) OnlyX

func (ttq *TaskTypeQuery) OnlyX(ctx context.Context) *TaskType

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

func (*TaskTypeQuery) Order

func (ttq *TaskTypeQuery) Order(o ...OrderFunc) *TaskTypeQuery

Order adds an order step to the query.

func (*TaskTypeQuery) QueryTasks

func (ttq *TaskTypeQuery) QueryTasks() *TaskQuery

QueryTasks chains the current query on the tasks edge.

func (*TaskTypeQuery) Select

func (ttq *TaskTypeQuery) Select(field string, fields ...string) *TaskTypeSelect

Select one or more fields from the given query.

Example:

var v []struct {
	Code string `json:"code,omitempty"`
}

client.TaskType.Query().
	Select(tasktype.FieldCode).
	Scan(ctx, &v)

func (*TaskTypeQuery) Where

func (ttq *TaskTypeQuery) Where(ps ...predicate.TaskType) *TaskTypeQuery

Where adds a new predicate for the builder.

func (*TaskTypeQuery) WithTasks

func (ttq *TaskTypeQuery) WithTasks(opts ...func(*TaskQuery)) *TaskTypeQuery
WithTasks tells the query-builder to eager-loads the nodes that are connected to

the "tasks" edge. The optional arguments used to configure the query builder of the edge.

type TaskTypeSelect

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

TaskTypeSelect is the builder for select fields of TaskType entities.

func (*TaskTypeSelect) Bool

func (tts *TaskTypeSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*TaskTypeSelect) BoolX

func (tts *TaskTypeSelect) BoolX(ctx context.Context) bool

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

func (*TaskTypeSelect) Bools

func (tts *TaskTypeSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*TaskTypeSelect) BoolsX

func (tts *TaskTypeSelect) BoolsX(ctx context.Context) []bool

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

func (*TaskTypeSelect) Float64

func (tts *TaskTypeSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*TaskTypeSelect) Float64X

func (tts *TaskTypeSelect) Float64X(ctx context.Context) float64

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

func (*TaskTypeSelect) Float64s

func (tts *TaskTypeSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*TaskTypeSelect) Float64sX

func (tts *TaskTypeSelect) Float64sX(ctx context.Context) []float64

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

func (*TaskTypeSelect) Int

func (tts *TaskTypeSelect) Int(ctx context.Context) (_ int, err error)

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

func (*TaskTypeSelect) IntX

func (tts *TaskTypeSelect) IntX(ctx context.Context) int

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

func (*TaskTypeSelect) Ints

func (tts *TaskTypeSelect) Ints(ctx context.Context) ([]int, error)

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

func (*TaskTypeSelect) IntsX

func (tts *TaskTypeSelect) IntsX(ctx context.Context) []int

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

func (*TaskTypeSelect) Scan

func (tts *TaskTypeSelect) Scan(ctx context.Context, v interface{}) error

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

func (*TaskTypeSelect) ScanX

func (tts *TaskTypeSelect) ScanX(ctx context.Context, v interface{})

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

func (*TaskTypeSelect) String

func (tts *TaskTypeSelect) String(ctx context.Context) (_ string, err error)

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

func (*TaskTypeSelect) StringX

func (tts *TaskTypeSelect) StringX(ctx context.Context) string

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

func (*TaskTypeSelect) Strings

func (tts *TaskTypeSelect) Strings(ctx context.Context) ([]string, error)

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

func (*TaskTypeSelect) StringsX

func (tts *TaskTypeSelect) StringsX(ctx context.Context) []string

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

type TaskTypeUpdate

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

TaskTypeUpdate is the builder for updating TaskType entities.

func (*TaskTypeUpdate) AddTaskIDs

func (ttu *TaskTypeUpdate) AddTaskIDs(ids ...int) *TaskTypeUpdate

AddTaskIDs adds the tasks edge to Task by ids.

func (*TaskTypeUpdate) AddTasks

func (ttu *TaskTypeUpdate) AddTasks(t ...*Task) *TaskTypeUpdate

AddTasks adds the tasks edges to Task.

func (*TaskTypeUpdate) Exec

func (ttu *TaskTypeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskTypeUpdate) ExecX

func (ttu *TaskTypeUpdate) ExecX(ctx context.Context)

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

func (*TaskTypeUpdate) Mutation

func (ttu *TaskTypeUpdate) Mutation() *TaskTypeMutation

Mutation returns the TaskTypeMutation object of the builder.

func (*TaskTypeUpdate) RemoveTaskIDs

func (ttu *TaskTypeUpdate) RemoveTaskIDs(ids ...int) *TaskTypeUpdate

RemoveTaskIDs removes the tasks edge to Task by ids.

func (*TaskTypeUpdate) RemoveTasks

func (ttu *TaskTypeUpdate) RemoveTasks(t ...*Task) *TaskTypeUpdate

RemoveTasks removes tasks edges to Task.

func (*TaskTypeUpdate) Save

func (ttu *TaskTypeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*TaskTypeUpdate) SaveX

func (ttu *TaskTypeUpdate) SaveX(ctx context.Context) int

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

func (*TaskTypeUpdate) SetCode

func (ttu *TaskTypeUpdate) SetCode(s string) *TaskTypeUpdate

SetCode sets the code field.

func (*TaskTypeUpdate) SetTitle

func (ttu *TaskTypeUpdate) SetTitle(s string) *TaskTypeUpdate

SetTitle sets the title field.

func (*TaskTypeUpdate) Where

func (ttu *TaskTypeUpdate) Where(ps ...predicate.TaskType) *TaskTypeUpdate

Where adds a new predicate for the builder.

type TaskTypeUpdateOne

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

TaskTypeUpdateOne is the builder for updating a single TaskType entity.

func (*TaskTypeUpdateOne) AddTaskIDs

func (ttuo *TaskTypeUpdateOne) AddTaskIDs(ids ...int) *TaskTypeUpdateOne

AddTaskIDs adds the tasks edge to Task by ids.

func (*TaskTypeUpdateOne) AddTasks

func (ttuo *TaskTypeUpdateOne) AddTasks(t ...*Task) *TaskTypeUpdateOne

AddTasks adds the tasks edges to Task.

func (*TaskTypeUpdateOne) Exec

func (ttuo *TaskTypeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TaskTypeUpdateOne) ExecX

func (ttuo *TaskTypeUpdateOne) ExecX(ctx context.Context)

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

func (*TaskTypeUpdateOne) Mutation

func (ttuo *TaskTypeUpdateOne) Mutation() *TaskTypeMutation

Mutation returns the TaskTypeMutation object of the builder.

func (*TaskTypeUpdateOne) RemoveTaskIDs

func (ttuo *TaskTypeUpdateOne) RemoveTaskIDs(ids ...int) *TaskTypeUpdateOne

RemoveTaskIDs removes the tasks edge to Task by ids.

func (*TaskTypeUpdateOne) RemoveTasks

func (ttuo *TaskTypeUpdateOne) RemoveTasks(t ...*Task) *TaskTypeUpdateOne

RemoveTasks removes tasks edges to Task.

func (*TaskTypeUpdateOne) Save

func (ttuo *TaskTypeUpdateOne) Save(ctx context.Context) (*TaskType, error)

Save executes the query and returns the updated entity.

func (*TaskTypeUpdateOne) SaveX

func (ttuo *TaskTypeUpdateOne) SaveX(ctx context.Context) *TaskType

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

func (*TaskTypeUpdateOne) SetCode

func (ttuo *TaskTypeUpdateOne) SetCode(s string) *TaskTypeUpdateOne

SetCode sets the code field.

func (*TaskTypeUpdateOne) SetTitle

func (ttuo *TaskTypeUpdateOne) SetTitle(s string) *TaskTypeUpdateOne

SetTitle sets the title field.

type TaskTypes

type TaskTypes []*TaskType

TaskTypes is a parsable slice of TaskType.

type TaskUpdate

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

TaskUpdate is the builder for updating Task entities.

func (*TaskUpdate) AddItemIDs

func (tu *TaskUpdate) AddItemIDs(ids ...int) *TaskUpdate

AddItemIDs adds the items edge to Item by ids.

func (*TaskUpdate) AddItems

func (tu *TaskUpdate) AddItems(i ...*Item) *TaskUpdate

AddItems adds the items edges to Item.

func (*TaskUpdate) ClearDeleteTime

func (tu *TaskUpdate) ClearDeleteTime() *TaskUpdate

ClearDeleteTime clears the value of delete_time.

func (*TaskUpdate) ClearDescription

func (tu *TaskUpdate) ClearDescription() *TaskUpdate

ClearDescription clears the value of description.

func (*TaskUpdate) ClearMeta

func (tu *TaskUpdate) ClearMeta() *TaskUpdate

ClearMeta clears the value of meta.

func (*TaskUpdate) ClearType

func (tu *TaskUpdate) ClearType() *TaskUpdate

ClearType clears the type edge to TaskType.

func (*TaskUpdate) ClearUser

func (tu *TaskUpdate) ClearUser() *TaskUpdate

ClearUser clears the user edge to User.

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

func (tu *TaskUpdate) RemoveItemIDs(ids ...int) *TaskUpdate

RemoveItemIDs removes the items edge to Item by ids.

func (*TaskUpdate) RemoveItems

func (tu *TaskUpdate) RemoveItems(i ...*Item) *TaskUpdate

RemoveItems removes items edges to Item.

func (*TaskUpdate) Save

func (tu *TaskUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this 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) SetDeleteTime

func (tu *TaskUpdate) SetDeleteTime(t time.Time) *TaskUpdate

SetDeleteTime sets the delete_time field.

func (*TaskUpdate) SetDescription

func (tu *TaskUpdate) SetDescription(s string) *TaskUpdate

SetDescription sets the description field.

func (*TaskUpdate) SetMeta

func (tu *TaskUpdate) SetMeta(dm domain.TaskMeta) *TaskUpdate

SetMeta sets the meta 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) SetNillableDeleteTime

func (tu *TaskUpdate) SetNillableDeleteTime(t *time.Time) *TaskUpdate

SetNillableDeleteTime sets the delete_time 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) SetNillableMeta

func (tu *TaskUpdate) SetNillableMeta(dm *domain.TaskMeta) *TaskUpdate

SetNillableMeta sets the meta field if the given value is not nil.

func (*TaskUpdate) SetSlug

func (tu *TaskUpdate) SetSlug(s string) *TaskUpdate

SetSlug sets the slug field.

func (*TaskUpdate) SetTitle

func (tu *TaskUpdate) SetTitle(s string) *TaskUpdate

SetTitle sets the title field.

func (*TaskUpdate) SetType

func (tu *TaskUpdate) SetType(t *TaskType) *TaskUpdate

SetType sets the type edge to TaskType.

func (*TaskUpdate) SetTypeID

func (tu *TaskUpdate) SetTypeID(id int) *TaskUpdate

SetTypeID sets the type edge to TaskType by id.

func (*TaskUpdate) SetUser

func (tu *TaskUpdate) SetUser(u *User) *TaskUpdate

SetUser sets the user edge to User.

func (*TaskUpdate) SetUserID

func (tu *TaskUpdate) SetUserID(id int) *TaskUpdate

SetUserID sets the user edge to User by id.

func (*TaskUpdate) Where

func (tu *TaskUpdate) Where(ps ...predicate.Task) *TaskUpdate

Where adds a new predicate for the builder.

type TaskUpdateOne

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

TaskUpdateOne is the builder for updating a single Task entity.

func (*TaskUpdateOne) AddItemIDs

func (tuo *TaskUpdateOne) AddItemIDs(ids ...int) *TaskUpdateOne

AddItemIDs adds the items edge to Item by ids.

func (*TaskUpdateOne) AddItems

func (tuo *TaskUpdateOne) AddItems(i ...*Item) *TaskUpdateOne

AddItems adds the items edges to Item.

func (*TaskUpdateOne) ClearDeleteTime

func (tuo *TaskUpdateOne) ClearDeleteTime() *TaskUpdateOne

ClearDeleteTime clears the value of delete_time.

func (*TaskUpdateOne) ClearDescription

func (tuo *TaskUpdateOne) ClearDescription() *TaskUpdateOne

ClearDescription clears the value of description.

func (*TaskUpdateOne) ClearMeta

func (tuo *TaskUpdateOne) ClearMeta() *TaskUpdateOne

ClearMeta clears the value of meta.

func (*TaskUpdateOne) ClearType

func (tuo *TaskUpdateOne) ClearType() *TaskUpdateOne

ClearType clears the type edge to TaskType.

func (*TaskUpdateOne) ClearUser

func (tuo *TaskUpdateOne) ClearUser() *TaskUpdateOne

ClearUser clears the user edge to User.

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

func (tuo *TaskUpdateOne) RemoveItemIDs(ids ...int) *TaskUpdateOne

RemoveItemIDs removes the items edge to Item by ids.

func (*TaskUpdateOne) RemoveItems

func (tuo *TaskUpdateOne) RemoveItems(i ...*Item) *TaskUpdateOne

RemoveItems removes items edges to Item.

func (*TaskUpdateOne) Save

func (tuo *TaskUpdateOne) Save(ctx context.Context) (*Task, error)

Save executes the query and returns the updated entity.

func (*TaskUpdateOne) SaveX

func (tuo *TaskUpdateOne) SaveX(ctx context.Context) *Task

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

func (*TaskUpdateOne) SetActive

func (tuo *TaskUpdateOne) SetActive(b bool) *TaskUpdateOne

SetActive sets the active field.

func (*TaskUpdateOne) SetDeleteTime

func (tuo *TaskUpdateOne) SetDeleteTime(t time.Time) *TaskUpdateOne

SetDeleteTime sets the delete_time field.

func (*TaskUpdateOne) SetDescription

func (tuo *TaskUpdateOne) SetDescription(s string) *TaskUpdateOne

SetDescription sets the description field.

func (*TaskUpdateOne) SetMeta

func (tuo *TaskUpdateOne) SetMeta(dm domain.TaskMeta) *TaskUpdateOne

SetMeta sets the meta 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) SetNillableDeleteTime

func (tuo *TaskUpdateOne) SetNillableDeleteTime(t *time.Time) *TaskUpdateOne

SetNillableDeleteTime sets the delete_time 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) SetNillableMeta

func (tuo *TaskUpdateOne) SetNillableMeta(dm *domain.TaskMeta) *TaskUpdateOne

SetNillableMeta sets the meta field if the given value is not nil.

func (*TaskUpdateOne) SetSlug

func (tuo *TaskUpdateOne) SetSlug(s string) *TaskUpdateOne

SetSlug sets the slug field.

func (*TaskUpdateOne) SetTitle

func (tuo *TaskUpdateOne) SetTitle(s string) *TaskUpdateOne

SetTitle sets the title field.

func (*TaskUpdateOne) SetType

func (tuo *TaskUpdateOne) SetType(t *TaskType) *TaskUpdateOne

SetType sets the type edge to TaskType.

func (*TaskUpdateOne) SetTypeID

func (tuo *TaskUpdateOne) SetTypeID(id int) *TaskUpdateOne

SetTypeID sets the type edge to TaskType by id.

func (*TaskUpdateOne) SetUser

func (tuo *TaskUpdateOne) SetUser(u *User) *TaskUpdateOne

SetUser sets the user edge to User.

func (*TaskUpdateOne) SetUserID

func (tuo *TaskUpdateOne) SetUserID(id int) *TaskUpdateOne

SetUserID sets the user edge to User by id.

type Tasks

type Tasks []*Task

Tasks is a parsable slice of Task.

type Tx

type Tx struct {

	// Item is the client for interacting with the Item builders.
	Item *ItemClient
	// SystemSummary is the client for interacting with the SystemSummary builders.
	SystemSummary *SystemSummaryClient
	// Task is the client for interacting with the Task builders.
	Task *TaskClient
	// TaskType is the client for interacting with the TaskType builders.
	TaskType *TaskTypeClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns the Tx stored in a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// 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"`
	// Username holds the value of the "username" field.
	Username string `json:"username,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// PasswordHash holds the value of the "password_hash" field.
	PasswordHash string `json:"password_hash,omitempty"`
	// Service holds the value of the "service" field.
	Service bool `json:"service,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) QueryTasks

func (u *User) QueryTasks() *TaskQuery

QueryTasks queries the tasks edge of the User.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

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

func (*User) Update

func (u *User) Update() *UserUpdateOne

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

type UserClient

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

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a create builder for User.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

BulkCreate returns a builder for creating a bulk of User entities.

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id int) *UserDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int) *User

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

func (*UserClient) Hooks

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

Hooks returns the client hooks.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryTasks

func (c *UserClient) QueryTasks(u *User) *TaskQuery

QueryTasks queries the tasks edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id int) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

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

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

type UserCreate

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

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddTaskIDs

func (uc *UserCreate) AddTaskIDs(ids ...int) *UserCreate

AddTaskIDs adds the tasks edge to Task by ids.

func (*UserCreate) AddTasks

func (uc *UserCreate) AddTasks(t ...*Task) *UserCreate

AddTasks adds the tasks edges to Task.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetCreateTime

func (uc *UserCreate) SetCreateTime(t time.Time) *UserCreate

SetCreateTime sets the create_time field.

func (*UserCreate) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the email field.

func (*UserCreate) SetNillableCreateTime

func (uc *UserCreate) SetNillableCreateTime(t *time.Time) *UserCreate

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

func (*UserCreate) SetNillableService

func (uc *UserCreate) SetNillableService(b *bool) *UserCreate

SetNillableService sets the service field if the given value is not nil.

func (*UserCreate) SetNillableUpdateTime

func (uc *UserCreate) SetNillableUpdateTime(t *time.Time) *UserCreate

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

func (*UserCreate) SetPasswordHash

func (uc *UserCreate) SetPasswordHash(s string) *UserCreate

SetPasswordHash sets the password_hash field.

func (*UserCreate) SetService

func (uc *UserCreate) SetService(b bool) *UserCreate

SetService sets the service field.

func (*UserCreate) SetUpdateTime

func (uc *UserCreate) SetUpdateTime(t time.Time) *UserCreate

SetUpdateTime sets the update_time field.

func (*UserCreate) SetUsername

func (uc *UserCreate) SetUsername(s string) *UserCreate

SetUsername sets the username field.

type UserCreateBulk

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

UserCreateBulk is the builder for creating a bulk of User entities.

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX calls Save and panics if Save returns an error.

type UserDelete

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

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

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

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

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

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where adds a new predicate to the delete builder.

type UserDeleteOne

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

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

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

type UserEdges

type UserEdges struct {
	// Tasks holds the value of the tasks edge.
	Tasks []*Task
	// contains filtered or unexported fields
}

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

func (UserEdges) TasksOrErr

func (e UserEdges) TasksOrErr() ([]*Task, error)

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

type UserGroupBy

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

UserGroupBy is the builder for group-by User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

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

func (*UserGroupBy) Bool

func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*UserGroupBy) BoolX

func (ugb *UserGroupBy) BoolX(ctx context.Context) bool

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

func (*UserGroupBy) Bools

func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*UserGroupBy) BoolsX

func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool

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

func (*UserGroupBy) Float64

func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*UserGroupBy) Float64X

func (ugb *UserGroupBy) Float64X(ctx context.Context) float64

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

func (*UserGroupBy) Float64s

func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*UserGroupBy) Float64sX

func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64

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

func (*UserGroupBy) Int

func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*UserGroupBy) IntX

func (ugb *UserGroupBy) IntX(ctx context.Context) int

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

func (*UserGroupBy) Ints

func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*UserGroupBy) IntsX

func (ugb *UserGroupBy) IntsX(ctx context.Context) []int

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

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*UserGroupBy) ScanX

func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*UserGroupBy) String

func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*UserGroupBy) StringX

func (ugb *UserGroupBy) StringX(ctx context.Context) string

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

func (*UserGroupBy) Strings

func (ugb *UserGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*UserGroupBy) StringsX

func (ugb *UserGroupBy) StringsX(ctx context.Context) []string

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

type UserMutation

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

UserMutation represents an operation that mutate the Users nodes in the graph.

func (*UserMutation) AddField

func (m *UserMutation) AddField(name string, value ent.Value) error

AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*UserMutation) AddTaskIDs

func (m *UserMutation) AddTaskIDs(ids ...int)

AddTaskIDs adds the tasks edge to Task by ids.

func (*UserMutation) AddedEdges

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

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

func (*UserMutation) AddedField

func (m *UserMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*UserMutation) AddedFields

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

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

func (*UserMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*UserMutation) ClearEdge

func (m *UserMutation) ClearEdge(name string) error

ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.

func (*UserMutation) ClearField

func (m *UserMutation) ClearField(name string) error

ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ClearedEdges

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

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

func (*UserMutation) ClearedFields

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

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

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) CreateTime

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

CreateTime returns the create_time value in the mutation.

func (*UserMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*UserMutation) Email

func (m *UserMutation) Email() (r string, exists bool)

Email returns the email value in the mutation.

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean value indicates that this field was not set, or was not define in the schema.

func (*UserMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that, in order to get all numeric fields that were in/decremented, call AddedFields().

func (*UserMutation) ID

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

ID returns the id value in the mutation. Note that, the id is available only if it was provided to the builder.

func (*UserMutation) OldCreateTime

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

OldCreateTime returns the old create_time value of the User. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or database query fails.

func (*UserMutation) OldEmail

func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old email value of the User. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or database query fails.

func (*UserMutation) OldField

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database was failed.

func (*UserMutation) OldPasswordHash

func (m *UserMutation) OldPasswordHash(ctx context.Context) (v string, err error)

OldPasswordHash returns the old password_hash value of the User. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or database query fails.

func (*UserMutation) OldService

func (m *UserMutation) OldService(ctx context.Context) (v bool, err error)

OldService returns the old service value of the User. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or database query fails.

func (*UserMutation) OldUpdateTime

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

OldUpdateTime returns the old update_time value of the User. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or database query fails.

func (*UserMutation) OldUsername

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

OldUsername returns the old username value of the User. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) PasswordHash

func (m *UserMutation) PasswordHash() (r string, exists bool)

PasswordHash returns the password_hash value in the mutation.

func (*UserMutation) RemoveTaskIDs

func (m *UserMutation) RemoveTaskIDs(ids ...int)

RemoveTaskIDs removes the tasks edge to Task by ids.

func (*UserMutation) RemovedEdges

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

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

func (*UserMutation) RemovedIDs

func (m *UserMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*UserMutation) RemovedTasksIDs

func (m *UserMutation) RemovedTasksIDs() (ids []int)

RemovedTasks returns the removed ids of tasks.

func (*UserMutation) ResetCreateTime

func (m *UserMutation) ResetCreateTime()

ResetCreateTime reset all changes of the "create_time" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes in the mutation regarding the given edge name. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail reset all changes of the "email" field.

func (*UserMutation) ResetField

func (m *UserMutation) ResetField(name string) error

ResetField resets all changes in the mutation regarding the given field name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ResetPasswordHash

func (m *UserMutation) ResetPasswordHash()

ResetPasswordHash reset all changes of the "password_hash" field.

func (*UserMutation) ResetService

func (m *UserMutation) ResetService()

ResetService reset all changes of the "service" field.

func (*UserMutation) ResetTasks

func (m *UserMutation) ResetTasks()

ResetTasks reset all changes of the "tasks" edge.

func (*UserMutation) ResetUpdateTime

func (m *UserMutation) ResetUpdateTime()

ResetUpdateTime reset all changes of the "update_time" field.

func (*UserMutation) ResetUsername

func (m *UserMutation) ResetUsername()

ResetUsername reset all changes of the "username" field.

func (*UserMutation) Service

func (m *UserMutation) Service() (r bool, exists bool)

Service returns the service value in the mutation.

func (*UserMutation) SetCreateTime

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

SetCreateTime sets the create_time field.

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the email field.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*UserMutation) SetPasswordHash

func (m *UserMutation) SetPasswordHash(s string)

SetPasswordHash sets the password_hash field.

func (*UserMutation) SetService

func (m *UserMutation) SetService(b bool)

SetService sets the service field.

func (*UserMutation) SetUpdateTime

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

SetUpdateTime sets the update_time field.

func (*UserMutation) SetUsername

func (m *UserMutation) SetUsername(s string)

SetUsername sets the username field.

func (*UserMutation) TasksIDs

func (m *UserMutation) TasksIDs() (ids []int)

TasksIDs returns the tasks ids in the mutation.

func (UserMutation) Tx

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

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

func (*UserMutation) Type

func (m *UserMutation) Type() string

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

func (*UserMutation) UpdateTime

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

UpdateTime returns the update_time value in the mutation.

func (*UserMutation) Username

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

Username returns the username value in the mutation.

type UserQuery

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

UserQuery is the builder for querying User entities.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

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

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

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

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

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

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

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

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity in the query. Returns *NotFoundError when no user was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first User id in the query. Returns *NotFoundError when no id was found.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

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

func (*UserQuery) FirstXID

func (uq *UserQuery) FirstXID(ctx context.Context) int

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

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy 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.User.Query().
	GroupBy(user.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of User ids.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []int

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

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit adds a limit step to the query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset adds an offset step to the query.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns the only User entity in the query, returns an error if not exactly one entity was returned.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only User id in the query, returns an error if not exactly one id was returned.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) int

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

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

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

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery

Order adds an order step to the query.

func (*UserQuery) QueryTasks

func (uq *UserQuery) QueryTasks() *TaskQuery

QueryTasks chains the current query on the tasks edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(field string, fields ...string) *UserSelect

Select one or more fields from the given query.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.User.Query().
	Select(user.FieldCreateTime).
	Scan(ctx, &v)

func (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the builder.

func (*UserQuery) WithTasks

func (uq *UserQuery) WithTasks(opts ...func(*TaskQuery)) *UserQuery
WithTasks tells the query-builder to eager-loads the nodes that are connected to

the "tasks" edge. The optional arguments used to configure the query builder of the edge.

type UserSelect

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

UserSelect is the builder for select fields of User entities.

func (*UserSelect) Bool

func (us *UserSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*UserSelect) BoolX

func (us *UserSelect) BoolX(ctx context.Context) bool

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

func (*UserSelect) Bools

func (us *UserSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*UserSelect) BoolsX

func (us *UserSelect) BoolsX(ctx context.Context) []bool

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

func (*UserSelect) Float64

func (us *UserSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*UserSelect) Float64X

func (us *UserSelect) Float64X(ctx context.Context) float64

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

func (*UserSelect) Float64s

func (us *UserSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*UserSelect) Float64sX

func (us *UserSelect) Float64sX(ctx context.Context) []float64

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

func (*UserSelect) Int

func (us *UserSelect) Int(ctx context.Context) (_ int, err error)

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

func (*UserSelect) IntX

func (us *UserSelect) IntX(ctx context.Context) int

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

func (*UserSelect) Ints

func (us *UserSelect) Ints(ctx context.Context) ([]int, error)

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

func (*UserSelect) IntsX

func (us *UserSelect) IntsX(ctx context.Context) []int

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

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v interface{}) error

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

func (*UserSelect) ScanX

func (us *UserSelect) ScanX(ctx context.Context, v interface{})

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

func (*UserSelect) String

func (us *UserSelect) String(ctx context.Context) (_ string, err error)

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

func (*UserSelect) StringX

func (us *UserSelect) StringX(ctx context.Context) string

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

func (*UserSelect) Strings

func (us *UserSelect) Strings(ctx context.Context) ([]string, error)

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

func (*UserSelect) StringsX

func (us *UserSelect) StringsX(ctx context.Context) []string

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

type UserUpdate

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

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddTaskIDs

func (uu *UserUpdate) AddTaskIDs(ids ...int) *UserUpdate

AddTaskIDs adds the tasks edge to Task by ids.

func (*UserUpdate) AddTasks

func (uu *UserUpdate) AddTasks(t ...*Task) *UserUpdate

AddTasks adds the tasks edges to Task.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

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

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveTaskIDs

func (uu *UserUpdate) RemoveTaskIDs(ids ...int) *UserUpdate

RemoveTaskIDs removes the tasks edge to Task by ids.

func (*UserUpdate) RemoveTasks

func (uu *UserUpdate) RemoveTasks(t ...*Task) *UserUpdate

RemoveTasks removes tasks edges to Task.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

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

func (*UserUpdate) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the email field.

func (*UserUpdate) SetNillableService

func (uu *UserUpdate) SetNillableService(b *bool) *UserUpdate

SetNillableService sets the service field if the given value is not nil.

func (*UserUpdate) SetPasswordHash

func (uu *UserUpdate) SetPasswordHash(s string) *UserUpdate

SetPasswordHash sets the password_hash field.

func (*UserUpdate) SetService

func (uu *UserUpdate) SetService(b bool) *UserUpdate

SetService sets the service field.

func (*UserUpdate) SetUsername

func (uu *UserUpdate) SetUsername(s string) *UserUpdate

SetUsername sets the username field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where adds a new predicate for the builder.

type UserUpdateOne

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

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddTaskIDs

func (uuo *UserUpdateOne) AddTaskIDs(ids ...int) *UserUpdateOne

AddTaskIDs adds the tasks edge to Task by ids.

func (*UserUpdateOne) AddTasks

func (uuo *UserUpdateOne) AddTasks(t ...*Task) *UserUpdateOne

AddTasks adds the tasks edges to Task.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

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

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveTaskIDs

func (uuo *UserUpdateOne) RemoveTaskIDs(ids ...int) *UserUpdateOne

RemoveTaskIDs removes the tasks edge to Task by ids.

func (*UserUpdateOne) RemoveTasks

func (uuo *UserUpdateOne) RemoveTasks(t ...*Task) *UserUpdateOne

RemoveTasks removes tasks edges to Task.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

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

func (*UserUpdateOne) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the email field.

func (*UserUpdateOne) SetNillableService

func (uuo *UserUpdateOne) SetNillableService(b *bool) *UserUpdateOne

SetNillableService sets the service field if the given value is not nil.

func (*UserUpdateOne) SetPasswordHash

func (uuo *UserUpdateOne) SetPasswordHash(s string) *UserUpdateOne

SetPasswordHash sets the password_hash field.

func (*UserUpdateOne) SetService

func (uuo *UserUpdateOne) SetService(b bool) *UserUpdateOne

SetService sets the service field.

func (*UserUpdateOne) SetUsername

func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne

SetUsername sets the username field.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field 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 conflict 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