ent

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: GPL-3.0 Imports: 22 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.
	TypeDaemon    = "Daemon"
	TypeNode      = "Node"
	TypeProvider  = "Provider"
	TypeSubscribe = "Subscribe"
	TypeUser      = "User"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Daemon is the client for interacting with the Daemon builders.
	Daemon *DaemonClient
	// Node is the client for interacting with the Node builders.
	Node *NodeClient
	// Provider is the client for interacting with the Provider builders.
	Provider *ProviderClient
	// Subscribe is the client for interacting with the Subscribe builders.
	Subscribe *SubscribeClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	Daemon.
	Query().
	Count(ctx)

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Daemon

type Daemon struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Path holds the value of the "path" field.
	Path string `json:"path,omitempty"`
	// Enable holds the value of the "enable" field.
	Enable bool `json:"enable,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DaemonQuery when eager-loading is set.
	Edges DaemonEdges `json:"edges"`
	// contains filtered or unexported fields
}

Daemon is the model entity for the Daemon schema.

func (*Daemon) QueryUser

func (d *Daemon) QueryUser() *UserQuery

QueryUser queries the "user" edge of the Daemon entity.

func (*Daemon) String

func (d *Daemon) String() string

String implements the fmt.Stringer.

func (*Daemon) Unwrap

func (d *Daemon) Unwrap() *Daemon

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

func (*Daemon) Update

func (d *Daemon) Update() *DaemonUpdateOne

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

func (*Daemon) Value

func (d *Daemon) Value(name string) (ent.Value, error)

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

type DaemonClient

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

DaemonClient is a client for the Daemon schema.

func NewDaemonClient

func NewDaemonClient(c config) *DaemonClient

NewDaemonClient returns a client for the Daemon from the given config.

func (*DaemonClient) Create

func (c *DaemonClient) Create() *DaemonCreate

Create returns a builder for creating a Daemon entity.

func (*DaemonClient) CreateBulk

func (c *DaemonClient) CreateBulk(builders ...*DaemonCreate) *DaemonCreateBulk

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

func (*DaemonClient) Delete

func (c *DaemonClient) Delete() *DaemonDelete

Delete returns a delete builder for Daemon.

func (*DaemonClient) DeleteOne

func (c *DaemonClient) DeleteOne(d *Daemon) *DaemonDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DaemonClient) DeleteOneID

func (c *DaemonClient) DeleteOneID(id int) *DaemonDeleteOne

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

func (*DaemonClient) Get

func (c *DaemonClient) Get(ctx context.Context, id int) (*Daemon, error)

Get returns a Daemon entity by its id.

func (*DaemonClient) GetX

func (c *DaemonClient) GetX(ctx context.Context, id int) *Daemon

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

func (*DaemonClient) Hooks

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

Hooks returns the client hooks.

func (*DaemonClient) Intercept

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

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

func (*DaemonClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DaemonClient) MapCreateBulk

func (c *DaemonClient) MapCreateBulk(slice any, setFunc func(*DaemonCreate, int)) *DaemonCreateBulk

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

func (*DaemonClient) Query

func (c *DaemonClient) Query() *DaemonQuery

Query returns a query builder for Daemon.

func (*DaemonClient) QueryUser

func (c *DaemonClient) QueryUser(d *Daemon) *UserQuery

QueryUser queries the user edge of a Daemon.

func (*DaemonClient) Update

func (c *DaemonClient) Update() *DaemonUpdate

Update returns an update builder for Daemon.

func (*DaemonClient) UpdateOne

func (c *DaemonClient) UpdateOne(d *Daemon) *DaemonUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DaemonClient) UpdateOneID

func (c *DaemonClient) UpdateOneID(id int) *DaemonUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DaemonClient) Use

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

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

type DaemonCreate

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

DaemonCreate is the builder for creating a Daemon entity.

func (*DaemonCreate) Exec

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

Exec executes the query.

func (*DaemonCreate) ExecX

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

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

func (*DaemonCreate) Mutation

func (dc *DaemonCreate) Mutation() *DaemonMutation

Mutation returns the DaemonMutation object of the builder.

func (*DaemonCreate) Save

func (dc *DaemonCreate) Save(ctx context.Context) (*Daemon, error)

Save creates the Daemon in the database.

func (*DaemonCreate) SaveX

func (dc *DaemonCreate) SaveX(ctx context.Context) *Daemon

SaveX calls Save and panics if Save returns an error.

func (*DaemonCreate) SetEnable

func (dc *DaemonCreate) SetEnable(b bool) *DaemonCreate

SetEnable sets the "enable" field.

func (*DaemonCreate) SetNillableEnable

func (dc *DaemonCreate) SetNillableEnable(b *bool) *DaemonCreate

SetNillableEnable sets the "enable" field if the given value is not nil.

func (*DaemonCreate) SetNillableUserID

func (dc *DaemonCreate) SetNillableUserID(id *int) *DaemonCreate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*DaemonCreate) SetPath

func (dc *DaemonCreate) SetPath(s string) *DaemonCreate

SetPath sets the "path" field.

func (*DaemonCreate) SetUser

func (dc *DaemonCreate) SetUser(u *User) *DaemonCreate

SetUser sets the "user" edge to the User entity.

func (*DaemonCreate) SetUserID

func (dc *DaemonCreate) SetUserID(id int) *DaemonCreate

SetUserID sets the "user" edge to the User entity by ID.

type DaemonCreateBulk

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

DaemonCreateBulk is the builder for creating many Daemon entities in bulk.

func (*DaemonCreateBulk) Exec

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

Exec executes the query.

func (*DaemonCreateBulk) ExecX

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

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

func (*DaemonCreateBulk) Save

func (dcb *DaemonCreateBulk) Save(ctx context.Context) ([]*Daemon, error)

Save creates the Daemon entities in the database.

func (*DaemonCreateBulk) SaveX

func (dcb *DaemonCreateBulk) SaveX(ctx context.Context) []*Daemon

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

type DaemonDelete

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

DaemonDelete is the builder for deleting a Daemon entity.

func (*DaemonDelete) Exec

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

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

func (*DaemonDelete) ExecX

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

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

func (*DaemonDelete) Where

func (dd *DaemonDelete) Where(ps ...predicate.Daemon) *DaemonDelete

Where appends a list predicates to the DaemonDelete builder.

type DaemonDeleteOne

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

DaemonDeleteOne is the builder for deleting a single Daemon entity.

func (*DaemonDeleteOne) Exec

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

Exec executes the deletion query.

func (*DaemonDeleteOne) ExecX

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

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

func (*DaemonDeleteOne) Where

func (ddo *DaemonDeleteOne) Where(ps ...predicate.Daemon) *DaemonDeleteOne

Where appends a list predicates to the DaemonDelete builder.

type DaemonEdges

type DaemonEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

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

func (DaemonEdges) UserOrErr

func (e DaemonEdges) 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 DaemonGroupBy

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

DaemonGroupBy is the group-by builder for Daemon entities.

func (*DaemonGroupBy) Aggregate

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

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

func (*DaemonGroupBy) Bool

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

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

func (*DaemonGroupBy) BoolX

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

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

func (*DaemonGroupBy) Bools

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

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

func (*DaemonGroupBy) BoolsX

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

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

func (*DaemonGroupBy) Float64

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

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

func (*DaemonGroupBy) Float64X

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

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

func (*DaemonGroupBy) Float64s

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

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

func (*DaemonGroupBy) Float64sX

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

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

func (*DaemonGroupBy) Int

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

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

func (*DaemonGroupBy) IntX

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

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

func (*DaemonGroupBy) Ints

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

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

func (*DaemonGroupBy) IntsX

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

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

func (*DaemonGroupBy) Scan

func (dgb *DaemonGroupBy) Scan(ctx context.Context, v any) error

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

func (*DaemonGroupBy) ScanX

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

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

func (*DaemonGroupBy) String

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

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

func (*DaemonGroupBy) StringX

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

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

func (*DaemonGroupBy) Strings

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

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

func (*DaemonGroupBy) StringsX

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

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

type DaemonMutation

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

DaemonMutation represents an operation that mutates the Daemon nodes in the graph.

func (*DaemonMutation) AddField

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

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

func (*DaemonMutation) AddedEdges

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

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

func (*DaemonMutation) AddedField

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

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*DaemonMutation) AddedFields

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

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

func (*DaemonMutation) AddedIDs

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

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

func (*DaemonMutation) ClearEdge

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

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

func (*DaemonMutation) ClearField

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

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

func (*DaemonMutation) ClearUser

func (m *DaemonMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*DaemonMutation) ClearedEdges

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

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

func (*DaemonMutation) ClearedFields

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

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

func (DaemonMutation) Client

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

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

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

func (*DaemonMutation) Enable

func (m *DaemonMutation) Enable() (r bool, exists bool)

Enable returns the value of the "enable" field in the mutation.

func (*DaemonMutation) Field

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

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

func (*DaemonMutation) FieldCleared

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

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

func (*DaemonMutation) Fields

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

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

func (*DaemonMutation) ID

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

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

func (*DaemonMutation) IDs

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

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

func (*DaemonMutation) OldEnable

func (m *DaemonMutation) OldEnable(ctx context.Context) (v bool, err error)

OldEnable returns the old "enable" field's value of the Daemon entity. If the Daemon object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DaemonMutation) OldField

func (m *DaemonMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*DaemonMutation) OldPath

func (m *DaemonMutation) OldPath(ctx context.Context) (v string, err error)

OldPath returns the old "path" field's value of the Daemon entity. If the Daemon object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DaemonMutation) Op

func (m *DaemonMutation) Op() Op

Op returns the operation name.

func (*DaemonMutation) Path

func (m *DaemonMutation) Path() (r string, exists bool)

Path returns the value of the "path" field in the mutation.

func (*DaemonMutation) RemovedEdges

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

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

func (*DaemonMutation) RemovedIDs

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

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*DaemonMutation) ResetEdge

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

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

func (*DaemonMutation) ResetEnable

func (m *DaemonMutation) ResetEnable()

ResetEnable resets all changes to the "enable" field.

func (*DaemonMutation) ResetField

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

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

func (*DaemonMutation) ResetPath

func (m *DaemonMutation) ResetPath()

ResetPath resets all changes to the "path" field.

func (*DaemonMutation) ResetUser

func (m *DaemonMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*DaemonMutation) SetEnable

func (m *DaemonMutation) SetEnable(b bool)

SetEnable sets the "enable" field.

func (*DaemonMutation) SetField

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

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*DaemonMutation) SetOp

func (m *DaemonMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DaemonMutation) SetPath

func (m *DaemonMutation) SetPath(s string)

SetPath sets the "path" field.

func (*DaemonMutation) SetUserID

func (m *DaemonMutation) SetUserID(id int)

SetUserID sets the "user" edge to the User entity by id.

func (DaemonMutation) Tx

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

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

func (*DaemonMutation) Type

func (m *DaemonMutation) Type() string

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

func (*DaemonMutation) UserCleared

func (m *DaemonMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*DaemonMutation) UserID

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

UserID returns the "user" edge ID in the mutation.

func (*DaemonMutation) UserIDs

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

UserIDs returns the "user" edge 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.

func (*DaemonMutation) Where

func (m *DaemonMutation) Where(ps ...predicate.Daemon)

Where appends a list predicates to the DaemonMutation builder.

func (*DaemonMutation) WhereP

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

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

type DaemonQuery

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

DaemonQuery is the builder for querying Daemon entities.

func (*DaemonQuery) Aggregate

func (dq *DaemonQuery) Aggregate(fns ...AggregateFunc) *DaemonSelect

Aggregate returns a DaemonSelect configured with the given aggregations.

func (*DaemonQuery) All

func (dq *DaemonQuery) All(ctx context.Context) ([]*Daemon, error)

All executes the query and returns a list of Daemons.

func (*DaemonQuery) AllX

func (dq *DaemonQuery) AllX(ctx context.Context) []*Daemon

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

func (*DaemonQuery) Clone

func (dq *DaemonQuery) Clone() *DaemonQuery

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

func (*DaemonQuery) Count

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

Count returns the count of the given query.

func (*DaemonQuery) CountX

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

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

func (*DaemonQuery) Exist

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

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

func (*DaemonQuery) ExistX

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

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

func (*DaemonQuery) First

func (dq *DaemonQuery) First(ctx context.Context) (*Daemon, error)

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

func (*DaemonQuery) FirstID

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

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

func (*DaemonQuery) FirstIDX

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

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

func (*DaemonQuery) FirstX

func (dq *DaemonQuery) FirstX(ctx context.Context) *Daemon

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

func (*DaemonQuery) GroupBy

func (dq *DaemonQuery) GroupBy(field string, fields ...string) *DaemonGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Path string `json:"path,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Daemon.Query().
	GroupBy(daemon.FieldPath).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DaemonQuery) IDs

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

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

func (*DaemonQuery) IDsX

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

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

func (*DaemonQuery) Limit

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

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

func (*DaemonQuery) Offset

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

Offset to start from.

func (*DaemonQuery) Only

func (dq *DaemonQuery) Only(ctx context.Context) (*Daemon, error)

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

func (*DaemonQuery) OnlyID

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

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

func (*DaemonQuery) OnlyIDX

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

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

func (*DaemonQuery) OnlyX

func (dq *DaemonQuery) OnlyX(ctx context.Context) *Daemon

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

func (*DaemonQuery) Order

func (dq *DaemonQuery) Order(o ...daemon.OrderOption) *DaemonQuery

Order specifies how the records should be ordered.

func (*DaemonQuery) QueryUser

func (dq *DaemonQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*DaemonQuery) Select

func (dq *DaemonQuery) Select(fields ...string) *DaemonSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Path string `json:"path,omitempty"`
}

client.Daemon.Query().
	Select(daemon.FieldPath).
	Scan(ctx, &v)

func (*DaemonQuery) Unique

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

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*DaemonQuery) Where

func (dq *DaemonQuery) Where(ps ...predicate.Daemon) *DaemonQuery

Where adds a new predicate for the DaemonQuery builder.

func (*DaemonQuery) WithUser

func (dq *DaemonQuery) WithUser(opts ...func(*UserQuery)) *DaemonQuery

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

type DaemonSelect

type DaemonSelect struct {
	*DaemonQuery
	// contains filtered or unexported fields
}

DaemonSelect is the builder for selecting fields of Daemon entities.

func (*DaemonSelect) Aggregate

func (ds *DaemonSelect) Aggregate(fns ...AggregateFunc) *DaemonSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DaemonSelect) Bool

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

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

func (*DaemonSelect) BoolX

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

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

func (*DaemonSelect) Bools

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

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

func (*DaemonSelect) BoolsX

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

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

func (*DaemonSelect) Float64

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

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

func (*DaemonSelect) Float64X

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

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

func (*DaemonSelect) Float64s

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

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

func (*DaemonSelect) Float64sX

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

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

func (*DaemonSelect) Int

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

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

func (*DaemonSelect) IntX

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

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

func (*DaemonSelect) Ints

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

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

func (*DaemonSelect) IntsX

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

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

func (*DaemonSelect) Scan

func (ds *DaemonSelect) Scan(ctx context.Context, v any) error

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

func (*DaemonSelect) ScanX

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

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

func (*DaemonSelect) String

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

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

func (*DaemonSelect) StringX

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

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

func (*DaemonSelect) Strings

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

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

func (*DaemonSelect) StringsX

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

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

type DaemonUpdate

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

DaemonUpdate is the builder for updating Daemon entities.

func (*DaemonUpdate) ClearUser

func (du *DaemonUpdate) ClearUser() *DaemonUpdate

ClearUser clears the "user" edge to the User entity.

func (*DaemonUpdate) Exec

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

Exec executes the query.

func (*DaemonUpdate) ExecX

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

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

func (*DaemonUpdate) Mutation

func (du *DaemonUpdate) Mutation() *DaemonMutation

Mutation returns the DaemonMutation object of the builder.

func (*DaemonUpdate) Save

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

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

func (*DaemonUpdate) SaveX

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

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

func (*DaemonUpdate) SetEnable

func (du *DaemonUpdate) SetEnable(b bool) *DaemonUpdate

SetEnable sets the "enable" field.

func (*DaemonUpdate) SetNillableEnable

func (du *DaemonUpdate) SetNillableEnable(b *bool) *DaemonUpdate

SetNillableEnable sets the "enable" field if the given value is not nil.

func (*DaemonUpdate) SetNillablePath

func (du *DaemonUpdate) SetNillablePath(s *string) *DaemonUpdate

SetNillablePath sets the "path" field if the given value is not nil.

func (*DaemonUpdate) SetNillableUserID

func (du *DaemonUpdate) SetNillableUserID(id *int) *DaemonUpdate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*DaemonUpdate) SetPath

func (du *DaemonUpdate) SetPath(s string) *DaemonUpdate

SetPath sets the "path" field.

func (*DaemonUpdate) SetUser

func (du *DaemonUpdate) SetUser(u *User) *DaemonUpdate

SetUser sets the "user" edge to the User entity.

func (*DaemonUpdate) SetUserID

func (du *DaemonUpdate) SetUserID(id int) *DaemonUpdate

SetUserID sets the "user" edge to the User entity by ID.

func (*DaemonUpdate) Where

func (du *DaemonUpdate) Where(ps ...predicate.Daemon) *DaemonUpdate

Where appends a list predicates to the DaemonUpdate builder.

type DaemonUpdateOne

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

DaemonUpdateOne is the builder for updating a single Daemon entity.

func (*DaemonUpdateOne) ClearUser

func (duo *DaemonUpdateOne) ClearUser() *DaemonUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*DaemonUpdateOne) Exec

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

Exec executes the query on the entity.

func (*DaemonUpdateOne) ExecX

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

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

func (*DaemonUpdateOne) Mutation

func (duo *DaemonUpdateOne) Mutation() *DaemonMutation

Mutation returns the DaemonMutation object of the builder.

func (*DaemonUpdateOne) Save

func (duo *DaemonUpdateOne) Save(ctx context.Context) (*Daemon, error)

Save executes the query and returns the updated Daemon entity.

func (*DaemonUpdateOne) SaveX

func (duo *DaemonUpdateOne) SaveX(ctx context.Context) *Daemon

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

func (*DaemonUpdateOne) Select

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

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

func (*DaemonUpdateOne) SetEnable

func (duo *DaemonUpdateOne) SetEnable(b bool) *DaemonUpdateOne

SetEnable sets the "enable" field.

func (*DaemonUpdateOne) SetNillableEnable

func (duo *DaemonUpdateOne) SetNillableEnable(b *bool) *DaemonUpdateOne

SetNillableEnable sets the "enable" field if the given value is not nil.

func (*DaemonUpdateOne) SetNillablePath

func (duo *DaemonUpdateOne) SetNillablePath(s *string) *DaemonUpdateOne

SetNillablePath sets the "path" field if the given value is not nil.

func (*DaemonUpdateOne) SetNillableUserID

func (duo *DaemonUpdateOne) SetNillableUserID(id *int) *DaemonUpdateOne

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*DaemonUpdateOne) SetPath

func (duo *DaemonUpdateOne) SetPath(s string) *DaemonUpdateOne

SetPath sets the "path" field.

func (*DaemonUpdateOne) SetUser

func (duo *DaemonUpdateOne) SetUser(u *User) *DaemonUpdateOne

SetUser sets the "user" edge to the User entity.

func (*DaemonUpdateOne) SetUserID

func (duo *DaemonUpdateOne) SetUserID(id int) *DaemonUpdateOne

SetUserID sets the "user" edge to the User entity by ID.

func (*DaemonUpdateOne) Where

func (duo *DaemonUpdateOne) Where(ps ...predicate.Daemon) *DaemonUpdateOne

Where appends a list predicates to the DaemonUpdate builder.

type Daemons

type Daemons []*Daemon

Daemons is a parsable slice of Daemon.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type Node

type Node struct {

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

Node is the model entity for the Node schema.

func (*Node) QuerySubscribe

func (n *Node) QuerySubscribe() *SubscribeQuery

QuerySubscribe queries the "subscribe" edge of the Node entity.

func (*Node) String

func (n *Node) String() string

String implements the fmt.Stringer.

func (*Node) Unwrap

func (n *Node) Unwrap() *Node

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

func (*Node) Update

func (n *Node) Update() *NodeUpdateOne

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

func (*Node) Value

func (n *Node) Value(name string) (ent.Value, error)

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

type NodeClient

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

NodeClient is a client for the Node schema.

func NewNodeClient

func NewNodeClient(c config) *NodeClient

NewNodeClient returns a client for the Node from the given config.

func (*NodeClient) Create

func (c *NodeClient) Create() *NodeCreate

Create returns a builder for creating a Node entity.

func (*NodeClient) CreateBulk

func (c *NodeClient) CreateBulk(builders ...*NodeCreate) *NodeCreateBulk

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

func (*NodeClient) Delete

func (c *NodeClient) Delete() *NodeDelete

Delete returns a delete builder for Node.

func (*NodeClient) DeleteOne

func (c *NodeClient) DeleteOne(n *Node) *NodeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NodeClient) DeleteOneID

func (c *NodeClient) DeleteOneID(id int) *NodeDeleteOne

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

func (*NodeClient) Get

func (c *NodeClient) Get(ctx context.Context, id int) (*Node, error)

Get returns a Node entity by its id.

func (*NodeClient) GetX

func (c *NodeClient) GetX(ctx context.Context, id int) *Node

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

func (*NodeClient) Hooks

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

Hooks returns the client hooks.

func (*NodeClient) Intercept

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

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

func (*NodeClient) Interceptors

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

Interceptors returns the client interceptors.

func (*NodeClient) MapCreateBulk

func (c *NodeClient) MapCreateBulk(slice any, setFunc func(*NodeCreate, int)) *NodeCreateBulk

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

func (*NodeClient) Query

func (c *NodeClient) Query() *NodeQuery

Query returns a query builder for Node.

func (*NodeClient) QuerySubscribe

func (c *NodeClient) QuerySubscribe(n *Node) *SubscribeQuery

QuerySubscribe queries the subscribe edge of a Node.

func (*NodeClient) Update

func (c *NodeClient) Update() *NodeUpdate

Update returns an update builder for Node.

func (*NodeClient) UpdateOne

func (c *NodeClient) UpdateOne(n *Node) *NodeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*NodeClient) UpdateOneID

func (c *NodeClient) UpdateOneID(id int) *NodeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NodeClient) Use

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

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

type NodeCreate

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

NodeCreate is the builder for creating a Node entity.

func (*NodeCreate) Exec

func (nc *NodeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeCreate) ExecX

func (nc *NodeCreate) ExecX(ctx context.Context)

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

func (*NodeCreate) Mutation

func (nc *NodeCreate) Mutation() *NodeMutation

Mutation returns the NodeMutation object of the builder.

func (*NodeCreate) Save

func (nc *NodeCreate) Save(ctx context.Context) (*Node, error)

Save creates the Node in the database.

func (*NodeCreate) SaveX

func (nc *NodeCreate) SaveX(ctx context.Context) *Node

SaveX calls Save and panics if Save returns an error.

func (*NodeCreate) SetGroup

func (nc *NodeCreate) SetGroup(s string) *NodeCreate

SetGroup sets the "group" field.

func (*NodeCreate) SetName

func (nc *NodeCreate) SetName(s string) *NodeCreate

SetName sets the "name" field.

func (*NodeCreate) SetNillableSubscribeID

func (nc *NodeCreate) SetNillableSubscribeID(id *int) *NodeCreate

SetNillableSubscribeID sets the "subscribe" edge to the Subscribe entity by ID if the given value is not nil.

func (*NodeCreate) SetSubscribe

func (nc *NodeCreate) SetSubscribe(s *Subscribe) *NodeCreate

SetSubscribe sets the "subscribe" edge to the Subscribe entity.

func (*NodeCreate) SetSubscribeID

func (nc *NodeCreate) SetSubscribeID(id int) *NodeCreate

SetSubscribeID sets the "subscribe" edge to the Subscribe entity by ID.

type NodeCreateBulk

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

NodeCreateBulk is the builder for creating many Node entities in bulk.

func (*NodeCreateBulk) Exec

func (ncb *NodeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeCreateBulk) ExecX

func (ncb *NodeCreateBulk) ExecX(ctx context.Context)

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

func (*NodeCreateBulk) Save

func (ncb *NodeCreateBulk) Save(ctx context.Context) ([]*Node, error)

Save creates the Node entities in the database.

func (*NodeCreateBulk) SaveX

func (ncb *NodeCreateBulk) SaveX(ctx context.Context) []*Node

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

type NodeDelete

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

NodeDelete is the builder for deleting a Node entity.

func (*NodeDelete) Exec

func (nd *NodeDelete) Exec(ctx context.Context) (int, error)

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

func (*NodeDelete) ExecX

func (nd *NodeDelete) ExecX(ctx context.Context) int

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

func (*NodeDelete) Where

func (nd *NodeDelete) Where(ps ...predicate.Node) *NodeDelete

Where appends a list predicates to the NodeDelete builder.

type NodeDeleteOne

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

NodeDeleteOne is the builder for deleting a single Node entity.

func (*NodeDeleteOne) Exec

func (ndo *NodeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*NodeDeleteOne) ExecX

func (ndo *NodeDeleteOne) ExecX(ctx context.Context)

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

func (*NodeDeleteOne) Where

func (ndo *NodeDeleteOne) Where(ps ...predicate.Node) *NodeDeleteOne

Where appends a list predicates to the NodeDelete builder.

type NodeEdges

type NodeEdges struct {
	// Subscribe holds the value of the subscribe edge.
	Subscribe *Subscribe `json:"subscribe,omitempty"`
	// contains filtered or unexported fields
}

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

func (NodeEdges) SubscribeOrErr

func (e NodeEdges) SubscribeOrErr() (*Subscribe, error)

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

type NodeGroupBy

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

NodeGroupBy is the group-by builder for Node entities.

func (*NodeGroupBy) Aggregate

func (ngb *NodeGroupBy) Aggregate(fns ...AggregateFunc) *NodeGroupBy

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

func (*NodeGroupBy) Bool

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

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

func (*NodeGroupBy) BoolX

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

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

func (*NodeGroupBy) Bools

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

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

func (*NodeGroupBy) BoolsX

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

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

func (*NodeGroupBy) Float64

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

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

func (*NodeGroupBy) Float64X

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

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

func (*NodeGroupBy) Float64s

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

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

func (*NodeGroupBy) Float64sX

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

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

func (*NodeGroupBy) Int

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

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

func (*NodeGroupBy) IntX

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

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

func (*NodeGroupBy) Ints

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

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

func (*NodeGroupBy) IntsX

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

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

func (*NodeGroupBy) Scan

func (ngb *NodeGroupBy) Scan(ctx context.Context, v any) error

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

func (*NodeGroupBy) ScanX

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

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

func (*NodeGroupBy) String

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

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

func (*NodeGroupBy) StringX

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

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

func (*NodeGroupBy) Strings

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

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

func (*NodeGroupBy) StringsX

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

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

type NodeMutation

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

NodeMutation represents an operation that mutates the Node nodes in the graph.

func (*NodeMutation) AddField

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

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

func (*NodeMutation) AddedEdges

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

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

func (*NodeMutation) AddedField

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

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*NodeMutation) AddedFields

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

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

func (*NodeMutation) AddedIDs

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

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

func (*NodeMutation) ClearEdge

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

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

func (*NodeMutation) ClearField

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

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

func (*NodeMutation) ClearSubscribe

func (m *NodeMutation) ClearSubscribe()

ClearSubscribe clears the "subscribe" edge to the Subscribe entity.

func (*NodeMutation) ClearedEdges

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

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

func (*NodeMutation) ClearedFields

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

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

func (NodeMutation) Client

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

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

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

func (*NodeMutation) Field

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

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

func (*NodeMutation) FieldCleared

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

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

func (*NodeMutation) Fields

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

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

func (*NodeMutation) Group

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

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

func (*NodeMutation) ID

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

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

func (*NodeMutation) IDs

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

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

func (*NodeMutation) Name

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

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

func (*NodeMutation) OldField

func (m *NodeMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*NodeMutation) OldGroup

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

OldGroup returns the old "group" field's value of the Node entity. If the Node object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*NodeMutation) OldName

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

OldName returns the old "name" field's value of the Node entity. If the Node object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*NodeMutation) Op

func (m *NodeMutation) Op() Op

Op returns the operation name.

func (*NodeMutation) RemovedEdges

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

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

func (*NodeMutation) RemovedIDs

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

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*NodeMutation) ResetEdge

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

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

func (*NodeMutation) ResetField

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

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

func (*NodeMutation) ResetGroup

func (m *NodeMutation) ResetGroup()

ResetGroup resets all changes to the "group" field.

func (*NodeMutation) ResetName

func (m *NodeMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*NodeMutation) ResetSubscribe

func (m *NodeMutation) ResetSubscribe()

ResetSubscribe resets all changes to the "subscribe" edge.

func (*NodeMutation) SetField

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

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*NodeMutation) SetGroup

func (m *NodeMutation) SetGroup(s string)

SetGroup sets the "group" field.

func (*NodeMutation) SetName

func (m *NodeMutation) SetName(s string)

SetName sets the "name" field.

func (*NodeMutation) SetOp

func (m *NodeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*NodeMutation) SetSubscribeID

func (m *NodeMutation) SetSubscribeID(id int)

SetSubscribeID sets the "subscribe" edge to the Subscribe entity by id.

func (*NodeMutation) SubscribeCleared

func (m *NodeMutation) SubscribeCleared() bool

SubscribeCleared reports if the "subscribe" edge to the Subscribe entity was cleared.

func (*NodeMutation) SubscribeID

func (m *NodeMutation) SubscribeID() (id int, exists bool)

SubscribeID returns the "subscribe" edge ID in the mutation.

func (*NodeMutation) SubscribeIDs

func (m *NodeMutation) SubscribeIDs() (ids []int)

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

func (NodeMutation) Tx

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

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

func (*NodeMutation) Type

func (m *NodeMutation) Type() string

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

func (*NodeMutation) Where

func (m *NodeMutation) Where(ps ...predicate.Node)

Where appends a list predicates to the NodeMutation builder.

func (*NodeMutation) WhereP

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

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

type NodeQuery

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

NodeQuery is the builder for querying Node entities.

func (*NodeQuery) Aggregate

func (nq *NodeQuery) Aggregate(fns ...AggregateFunc) *NodeSelect

Aggregate returns a NodeSelect configured with the given aggregations.

func (*NodeQuery) All

func (nq *NodeQuery) All(ctx context.Context) ([]*Node, error)

All executes the query and returns a list of Nodes.

func (*NodeQuery) AllX

func (nq *NodeQuery) AllX(ctx context.Context) []*Node

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

func (*NodeQuery) Clone

func (nq *NodeQuery) Clone() *NodeQuery

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

func (*NodeQuery) Count

func (nq *NodeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NodeQuery) CountX

func (nq *NodeQuery) CountX(ctx context.Context) int

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

func (*NodeQuery) Exist

func (nq *NodeQuery) Exist(ctx context.Context) (bool, error)

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

func (*NodeQuery) ExistX

func (nq *NodeQuery) ExistX(ctx context.Context) bool

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

func (*NodeQuery) First

func (nq *NodeQuery) First(ctx context.Context) (*Node, error)

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

func (*NodeQuery) FirstID

func (nq *NodeQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*NodeQuery) FirstIDX

func (nq *NodeQuery) FirstIDX(ctx context.Context) int

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

func (*NodeQuery) FirstX

func (nq *NodeQuery) FirstX(ctx context.Context) *Node

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

func (*NodeQuery) GroupBy

func (nq *NodeQuery) GroupBy(field string, fields ...string) *NodeGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Group string `json:"group,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Node.Query().
	GroupBy(node.FieldGroup).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NodeQuery) IDs

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

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

func (*NodeQuery) IDsX

func (nq *NodeQuery) IDsX(ctx context.Context) []int

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

func (*NodeQuery) Limit

func (nq *NodeQuery) Limit(limit int) *NodeQuery

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

func (*NodeQuery) Offset

func (nq *NodeQuery) Offset(offset int) *NodeQuery

Offset to start from.

func (*NodeQuery) Only

func (nq *NodeQuery) Only(ctx context.Context) (*Node, error)

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

func (*NodeQuery) OnlyID

func (nq *NodeQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*NodeQuery) OnlyIDX

func (nq *NodeQuery) OnlyIDX(ctx context.Context) int

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

func (*NodeQuery) OnlyX

func (nq *NodeQuery) OnlyX(ctx context.Context) *Node

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

func (*NodeQuery) Order

func (nq *NodeQuery) Order(o ...node.OrderOption) *NodeQuery

Order specifies how the records should be ordered.

func (*NodeQuery) QuerySubscribe

func (nq *NodeQuery) QuerySubscribe() *SubscribeQuery

QuerySubscribe chains the current query on the "subscribe" edge.

func (*NodeQuery) Select

func (nq *NodeQuery) Select(fields ...string) *NodeSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Group string `json:"group,omitempty"`
}

client.Node.Query().
	Select(node.FieldGroup).
	Scan(ctx, &v)

func (*NodeQuery) Unique

func (nq *NodeQuery) Unique(unique bool) *NodeQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*NodeQuery) Where

func (nq *NodeQuery) Where(ps ...predicate.Node) *NodeQuery

Where adds a new predicate for the NodeQuery builder.

func (*NodeQuery) WithSubscribe

func (nq *NodeQuery) WithSubscribe(opts ...func(*SubscribeQuery)) *NodeQuery

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

type NodeSelect

type NodeSelect struct {
	*NodeQuery
	// contains filtered or unexported fields
}

NodeSelect is the builder for selecting fields of Node entities.

func (*NodeSelect) Aggregate

func (ns *NodeSelect) Aggregate(fns ...AggregateFunc) *NodeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*NodeSelect) Bool

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

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

func (*NodeSelect) BoolX

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

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

func (*NodeSelect) Bools

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

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

func (*NodeSelect) BoolsX

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

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

func (*NodeSelect) Float64

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

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

func (*NodeSelect) Float64X

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

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

func (*NodeSelect) Float64s

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

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

func (*NodeSelect) Float64sX

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

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

func (*NodeSelect) Int

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

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

func (*NodeSelect) IntX

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

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

func (*NodeSelect) Ints

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

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

func (*NodeSelect) IntsX

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

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

func (*NodeSelect) Scan

func (ns *NodeSelect) Scan(ctx context.Context, v any) error

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

func (*NodeSelect) ScanX

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

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

func (*NodeSelect) String

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

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

func (*NodeSelect) StringX

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

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

func (*NodeSelect) Strings

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

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

func (*NodeSelect) StringsX

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

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

type NodeUpdate

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

NodeUpdate is the builder for updating Node entities.

func (*NodeUpdate) ClearSubscribe

func (nu *NodeUpdate) ClearSubscribe() *NodeUpdate

ClearSubscribe clears the "subscribe" edge to the Subscribe entity.

func (*NodeUpdate) Exec

func (nu *NodeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeUpdate) ExecX

func (nu *NodeUpdate) ExecX(ctx context.Context)

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

func (*NodeUpdate) Mutation

func (nu *NodeUpdate) Mutation() *NodeMutation

Mutation returns the NodeMutation object of the builder.

func (*NodeUpdate) Save

func (nu *NodeUpdate) Save(ctx context.Context) (int, error)

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

func (*NodeUpdate) SaveX

func (nu *NodeUpdate) SaveX(ctx context.Context) int

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

func (*NodeUpdate) SetGroup

func (nu *NodeUpdate) SetGroup(s string) *NodeUpdate

SetGroup sets the "group" field.

func (*NodeUpdate) SetName

func (nu *NodeUpdate) SetName(s string) *NodeUpdate

SetName sets the "name" field.

func (*NodeUpdate) SetNillableGroup

func (nu *NodeUpdate) SetNillableGroup(s *string) *NodeUpdate

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

func (*NodeUpdate) SetNillableName

func (nu *NodeUpdate) SetNillableName(s *string) *NodeUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*NodeUpdate) SetNillableSubscribeID

func (nu *NodeUpdate) SetNillableSubscribeID(id *int) *NodeUpdate

SetNillableSubscribeID sets the "subscribe" edge to the Subscribe entity by ID if the given value is not nil.

func (*NodeUpdate) SetSubscribe

func (nu *NodeUpdate) SetSubscribe(s *Subscribe) *NodeUpdate

SetSubscribe sets the "subscribe" edge to the Subscribe entity.

func (*NodeUpdate) SetSubscribeID

func (nu *NodeUpdate) SetSubscribeID(id int) *NodeUpdate

SetSubscribeID sets the "subscribe" edge to the Subscribe entity by ID.

func (*NodeUpdate) Where

func (nu *NodeUpdate) Where(ps ...predicate.Node) *NodeUpdate

Where appends a list predicates to the NodeUpdate builder.

type NodeUpdateOne

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

NodeUpdateOne is the builder for updating a single Node entity.

func (*NodeUpdateOne) ClearSubscribe

func (nuo *NodeUpdateOne) ClearSubscribe() *NodeUpdateOne

ClearSubscribe clears the "subscribe" edge to the Subscribe entity.

func (*NodeUpdateOne) Exec

func (nuo *NodeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*NodeUpdateOne) ExecX

func (nuo *NodeUpdateOne) ExecX(ctx context.Context)

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

func (*NodeUpdateOne) Mutation

func (nuo *NodeUpdateOne) Mutation() *NodeMutation

Mutation returns the NodeMutation object of the builder.

func (*NodeUpdateOne) Save

func (nuo *NodeUpdateOne) Save(ctx context.Context) (*Node, error)

Save executes the query and returns the updated Node entity.

func (*NodeUpdateOne) SaveX

func (nuo *NodeUpdateOne) SaveX(ctx context.Context) *Node

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

func (*NodeUpdateOne) Select

func (nuo *NodeUpdateOne) Select(field string, fields ...string) *NodeUpdateOne

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

func (*NodeUpdateOne) SetGroup

func (nuo *NodeUpdateOne) SetGroup(s string) *NodeUpdateOne

SetGroup sets the "group" field.

func (*NodeUpdateOne) SetName

func (nuo *NodeUpdateOne) SetName(s string) *NodeUpdateOne

SetName sets the "name" field.

func (*NodeUpdateOne) SetNillableGroup

func (nuo *NodeUpdateOne) SetNillableGroup(s *string) *NodeUpdateOne

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

func (*NodeUpdateOne) SetNillableName

func (nuo *NodeUpdateOne) SetNillableName(s *string) *NodeUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*NodeUpdateOne) SetNillableSubscribeID

func (nuo *NodeUpdateOne) SetNillableSubscribeID(id *int) *NodeUpdateOne

SetNillableSubscribeID sets the "subscribe" edge to the Subscribe entity by ID if the given value is not nil.

func (*NodeUpdateOne) SetSubscribe

func (nuo *NodeUpdateOne) SetSubscribe(s *Subscribe) *NodeUpdateOne

SetSubscribe sets the "subscribe" edge to the Subscribe entity.

func (*NodeUpdateOne) SetSubscribeID

func (nuo *NodeUpdateOne) SetSubscribeID(id int) *NodeUpdateOne

SetSubscribeID sets the "subscribe" edge to the Subscribe entity by ID.

func (*NodeUpdateOne) Where

func (nuo *NodeUpdateOne) Where(ps ...predicate.Node) *NodeUpdateOne

Where appends a list predicates to the NodeUpdate builder.

type Nodes

type Nodes []*Node

Nodes is a parsable slice of Node.

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

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

type Policy

type Policy = ent.Policy

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

type Provider

type Provider struct {

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

Provider is the model entity for the Provider schema.

func (*Provider) QuerySubscribes

func (pr *Provider) QuerySubscribes() *SubscribeQuery

QuerySubscribes queries the "subscribes" edge of the Provider entity.

func (*Provider) QueryUser

func (pr *Provider) QueryUser() *UserQuery

QueryUser queries the "user" edge of the Provider entity.

func (*Provider) String

func (pr *Provider) String() string

String implements the fmt.Stringer.

func (*Provider) Unwrap

func (pr *Provider) Unwrap() *Provider

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

func (*Provider) Update

func (pr *Provider) Update() *ProviderUpdateOne

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

func (*Provider) Value

func (pr *Provider) Value(name string) (ent.Value, error)

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

type ProviderClient

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

ProviderClient is a client for the Provider schema.

func NewProviderClient

func NewProviderClient(c config) *ProviderClient

NewProviderClient returns a client for the Provider from the given config.

func (*ProviderClient) Create

func (c *ProviderClient) Create() *ProviderCreate

Create returns a builder for creating a Provider entity.

func (*ProviderClient) CreateBulk

func (c *ProviderClient) CreateBulk(builders ...*ProviderCreate) *ProviderCreateBulk

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

func (*ProviderClient) Delete

func (c *ProviderClient) Delete() *ProviderDelete

Delete returns a delete builder for Provider.

func (*ProviderClient) DeleteOne

func (c *ProviderClient) DeleteOne(pr *Provider) *ProviderDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProviderClient) DeleteOneID

func (c *ProviderClient) DeleteOneID(id int) *ProviderDeleteOne

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

func (*ProviderClient) Get

func (c *ProviderClient) Get(ctx context.Context, id int) (*Provider, error)

Get returns a Provider entity by its id.

func (*ProviderClient) GetX

func (c *ProviderClient) GetX(ctx context.Context, id int) *Provider

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

func (*ProviderClient) Hooks

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

Hooks returns the client hooks.

func (*ProviderClient) Intercept

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

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

func (*ProviderClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ProviderClient) MapCreateBulk

func (c *ProviderClient) MapCreateBulk(slice any, setFunc func(*ProviderCreate, int)) *ProviderCreateBulk

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

func (*ProviderClient) Query

func (c *ProviderClient) Query() *ProviderQuery

Query returns a query builder for Provider.

func (*ProviderClient) QuerySubscribes

func (c *ProviderClient) QuerySubscribes(pr *Provider) *SubscribeQuery

QuerySubscribes queries the subscribes edge of a Provider.

func (*ProviderClient) QueryUser

func (c *ProviderClient) QueryUser(pr *Provider) *UserQuery

QueryUser queries the user edge of a Provider.

func (*ProviderClient) Update

func (c *ProviderClient) Update() *ProviderUpdate

Update returns an update builder for Provider.

func (*ProviderClient) UpdateOne

func (c *ProviderClient) UpdateOne(pr *Provider) *ProviderUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProviderClient) UpdateOneID

func (c *ProviderClient) UpdateOneID(id int) *ProviderUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProviderClient) Use

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

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

type ProviderCreate

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

ProviderCreate is the builder for creating a Provider entity.

func (*ProviderCreate) AddSubscribeIDs

func (pc *ProviderCreate) AddSubscribeIDs(ids ...int) *ProviderCreate

AddSubscribeIDs adds the "subscribes" edge to the Subscribe entity by IDs.

func (*ProviderCreate) AddSubscribes

func (pc *ProviderCreate) AddSubscribes(s ...*Subscribe) *ProviderCreate

AddSubscribes adds the "subscribes" edges to the Subscribe entity.

func (*ProviderCreate) Exec

func (pc *ProviderCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProviderCreate) ExecX

func (pc *ProviderCreate) ExecX(ctx context.Context)

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

func (*ProviderCreate) Mutation

func (pc *ProviderCreate) Mutation() *ProviderMutation

Mutation returns the ProviderMutation object of the builder.

func (*ProviderCreate) Save

func (pc *ProviderCreate) Save(ctx context.Context) (*Provider, error)

Save creates the Provider in the database.

func (*ProviderCreate) SaveX

func (pc *ProviderCreate) SaveX(ctx context.Context) *Provider

SaveX calls Save and panics if Save returns an error.

func (*ProviderCreate) SetName

func (pc *ProviderCreate) SetName(s string) *ProviderCreate

SetName sets the "name" field.

func (*ProviderCreate) SetNillableUserID

func (pc *ProviderCreate) SetNillableUserID(id *int) *ProviderCreate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*ProviderCreate) SetPath

func (pc *ProviderCreate) SetPath(s string) *ProviderCreate

SetPath sets the "path" field.

func (*ProviderCreate) SetUser

func (pc *ProviderCreate) SetUser(u *User) *ProviderCreate

SetUser sets the "user" edge to the User entity.

func (*ProviderCreate) SetUserID

func (pc *ProviderCreate) SetUserID(id int) *ProviderCreate

SetUserID sets the "user" edge to the User entity by ID.

func (*ProviderCreate) SetVersion

func (pc *ProviderCreate) SetVersion(s string) *ProviderCreate

SetVersion sets the "version" field.

type ProviderCreateBulk

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

ProviderCreateBulk is the builder for creating many Provider entities in bulk.

func (*ProviderCreateBulk) Exec

func (pcb *ProviderCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProviderCreateBulk) ExecX

func (pcb *ProviderCreateBulk) ExecX(ctx context.Context)

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

func (*ProviderCreateBulk) Save

func (pcb *ProviderCreateBulk) Save(ctx context.Context) ([]*Provider, error)

Save creates the Provider entities in the database.

func (*ProviderCreateBulk) SaveX

func (pcb *ProviderCreateBulk) SaveX(ctx context.Context) []*Provider

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

type ProviderDelete

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

ProviderDelete is the builder for deleting a Provider entity.

func (*ProviderDelete) Exec

func (pd *ProviderDelete) Exec(ctx context.Context) (int, error)

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

func (*ProviderDelete) ExecX

func (pd *ProviderDelete) ExecX(ctx context.Context) int

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

func (*ProviderDelete) Where

func (pd *ProviderDelete) Where(ps ...predicate.Provider) *ProviderDelete

Where appends a list predicates to the ProviderDelete builder.

type ProviderDeleteOne

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

ProviderDeleteOne is the builder for deleting a single Provider entity.

func (*ProviderDeleteOne) Exec

func (pdo *ProviderDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProviderDeleteOne) ExecX

func (pdo *ProviderDeleteOne) ExecX(ctx context.Context)

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

func (*ProviderDeleteOne) Where

Where appends a list predicates to the ProviderDelete builder.

type ProviderEdges

type ProviderEdges struct {
	// Subscribes holds the value of the subscribes edge.
	Subscribes []*Subscribe `json:"subscribes,omitempty"`
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

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

func (ProviderEdges) SubscribesOrErr

func (e ProviderEdges) SubscribesOrErr() ([]*Subscribe, error)

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

func (ProviderEdges) UserOrErr

func (e ProviderEdges) 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 ProviderGroupBy

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

ProviderGroupBy is the group-by builder for Provider entities.

func (*ProviderGroupBy) Aggregate

func (pgb *ProviderGroupBy) Aggregate(fns ...AggregateFunc) *ProviderGroupBy

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

func (*ProviderGroupBy) Bool

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

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

func (*ProviderGroupBy) BoolX

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

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

func (*ProviderGroupBy) Bools

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

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

func (*ProviderGroupBy) BoolsX

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

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

func (*ProviderGroupBy) Float64

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

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

func (*ProviderGroupBy) Float64X

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

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

func (*ProviderGroupBy) Float64s

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

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

func (*ProviderGroupBy) Float64sX

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

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

func (*ProviderGroupBy) Int

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

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

func (*ProviderGroupBy) IntX

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

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

func (*ProviderGroupBy) Ints

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

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

func (*ProviderGroupBy) IntsX

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

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

func (*ProviderGroupBy) Scan

func (pgb *ProviderGroupBy) Scan(ctx context.Context, v any) error

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

func (*ProviderGroupBy) ScanX

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

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

func (*ProviderGroupBy) String

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

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

func (*ProviderGroupBy) StringX

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

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

func (*ProviderGroupBy) Strings

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

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

func (*ProviderGroupBy) StringsX

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

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

type ProviderMutation

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

ProviderMutation represents an operation that mutates the Provider nodes in the graph.

func (*ProviderMutation) AddField

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

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

func (*ProviderMutation) AddSubscribeIDs

func (m *ProviderMutation) AddSubscribeIDs(ids ...int)

AddSubscribeIDs adds the "subscribes" edge to the Subscribe entity by ids.

func (*ProviderMutation) AddedEdges

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

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

func (*ProviderMutation) AddedField

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

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ProviderMutation) AddedFields

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

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

func (*ProviderMutation) AddedIDs

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

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

func (*ProviderMutation) ClearEdge

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

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

func (*ProviderMutation) ClearField

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

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

func (*ProviderMutation) ClearSubscribes

func (m *ProviderMutation) ClearSubscribes()

ClearSubscribes clears the "subscribes" edge to the Subscribe entity.

func (*ProviderMutation) ClearUser

func (m *ProviderMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*ProviderMutation) ClearedEdges

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

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

func (*ProviderMutation) ClearedFields

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

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

func (ProviderMutation) Client

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

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

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

func (*ProviderMutation) Field

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

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

func (*ProviderMutation) FieldCleared

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

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

func (*ProviderMutation) Fields

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

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

func (*ProviderMutation) ID

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

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

func (*ProviderMutation) IDs

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

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

func (*ProviderMutation) Name

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

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

func (*ProviderMutation) OldField

func (m *ProviderMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*ProviderMutation) OldName

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

OldName returns the old "name" field's value of the Provider entity. If the Provider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProviderMutation) OldPath

func (m *ProviderMutation) OldPath(ctx context.Context) (v string, err error)

OldPath returns the old "path" field's value of the Provider entity. If the Provider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProviderMutation) OldVersion

func (m *ProviderMutation) OldVersion(ctx context.Context) (v string, err error)

OldVersion returns the old "version" field's value of the Provider entity. If the Provider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProviderMutation) Op

func (m *ProviderMutation) Op() Op

Op returns the operation name.

func (*ProviderMutation) Path

func (m *ProviderMutation) Path() (r string, exists bool)

Path returns the value of the "path" field in the mutation.

func (*ProviderMutation) RemoveSubscribeIDs

func (m *ProviderMutation) RemoveSubscribeIDs(ids ...int)

RemoveSubscribeIDs removes the "subscribes" edge to the Subscribe entity by IDs.

func (*ProviderMutation) RemovedEdges

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

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

func (*ProviderMutation) RemovedIDs

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

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*ProviderMutation) RemovedSubscribesIDs

func (m *ProviderMutation) RemovedSubscribesIDs() (ids []int)

RemovedSubscribes returns the removed IDs of the "subscribes" edge to the Subscribe entity.

func (*ProviderMutation) ResetEdge

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

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

func (*ProviderMutation) ResetField

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

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

func (*ProviderMutation) ResetName

func (m *ProviderMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ProviderMutation) ResetPath

func (m *ProviderMutation) ResetPath()

ResetPath resets all changes to the "path" field.

func (*ProviderMutation) ResetSubscribes

func (m *ProviderMutation) ResetSubscribes()

ResetSubscribes resets all changes to the "subscribes" edge.

func (*ProviderMutation) ResetUser

func (m *ProviderMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*ProviderMutation) ResetVersion

func (m *ProviderMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*ProviderMutation) SetField

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

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ProviderMutation) SetName

func (m *ProviderMutation) SetName(s string)

SetName sets the "name" field.

func (*ProviderMutation) SetOp

func (m *ProviderMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProviderMutation) SetPath

func (m *ProviderMutation) SetPath(s string)

SetPath sets the "path" field.

func (*ProviderMutation) SetUserID

func (m *ProviderMutation) SetUserID(id int)

SetUserID sets the "user" edge to the User entity by id.

func (*ProviderMutation) SetVersion

func (m *ProviderMutation) SetVersion(s string)

SetVersion sets the "version" field.

func (*ProviderMutation) SubscribesCleared

func (m *ProviderMutation) SubscribesCleared() bool

SubscribesCleared reports if the "subscribes" edge to the Subscribe entity was cleared.

func (*ProviderMutation) SubscribesIDs

func (m *ProviderMutation) SubscribesIDs() (ids []int)

SubscribesIDs returns the "subscribes" edge IDs in the mutation.

func (ProviderMutation) Tx

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

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

func (*ProviderMutation) Type

func (m *ProviderMutation) Type() string

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

func (*ProviderMutation) UserCleared

func (m *ProviderMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*ProviderMutation) UserID

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

UserID returns the "user" edge ID in the mutation.

func (*ProviderMutation) UserIDs

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

UserIDs returns the "user" edge 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.

func (*ProviderMutation) Version

func (m *ProviderMutation) Version() (r string, exists bool)

Version returns the value of the "version" field in the mutation.

func (*ProviderMutation) Where

func (m *ProviderMutation) Where(ps ...predicate.Provider)

Where appends a list predicates to the ProviderMutation builder.

func (*ProviderMutation) WhereP

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

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

type ProviderQuery

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

ProviderQuery is the builder for querying Provider entities.

func (*ProviderQuery) Aggregate

func (pq *ProviderQuery) Aggregate(fns ...AggregateFunc) *ProviderSelect

Aggregate returns a ProviderSelect configured with the given aggregations.

func (*ProviderQuery) All

func (pq *ProviderQuery) All(ctx context.Context) ([]*Provider, error)

All executes the query and returns a list of Providers.

func (*ProviderQuery) AllX

func (pq *ProviderQuery) AllX(ctx context.Context) []*Provider

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

func (*ProviderQuery) Clone

func (pq *ProviderQuery) Clone() *ProviderQuery

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

func (*ProviderQuery) Count

func (pq *ProviderQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProviderQuery) CountX

func (pq *ProviderQuery) CountX(ctx context.Context) int

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

func (*ProviderQuery) Exist

func (pq *ProviderQuery) Exist(ctx context.Context) (bool, error)

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

func (*ProviderQuery) ExistX

func (pq *ProviderQuery) ExistX(ctx context.Context) bool

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

func (*ProviderQuery) First

func (pq *ProviderQuery) First(ctx context.Context) (*Provider, error)

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

func (*ProviderQuery) FirstID

func (pq *ProviderQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ProviderQuery) FirstIDX

func (pq *ProviderQuery) FirstIDX(ctx context.Context) int

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

func (*ProviderQuery) FirstX

func (pq *ProviderQuery) FirstX(ctx context.Context) *Provider

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

func (*ProviderQuery) GroupBy

func (pq *ProviderQuery) GroupBy(field string, fields ...string) *ProviderGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Provider.Query().
	GroupBy(provider.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProviderQuery) IDs

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

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

func (*ProviderQuery) IDsX

func (pq *ProviderQuery) IDsX(ctx context.Context) []int

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

func (*ProviderQuery) Limit

func (pq *ProviderQuery) Limit(limit int) *ProviderQuery

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

func (*ProviderQuery) Offset

func (pq *ProviderQuery) Offset(offset int) *ProviderQuery

Offset to start from.

func (*ProviderQuery) Only

func (pq *ProviderQuery) Only(ctx context.Context) (*Provider, error)

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

func (*ProviderQuery) OnlyID

func (pq *ProviderQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ProviderQuery) OnlyIDX

func (pq *ProviderQuery) OnlyIDX(ctx context.Context) int

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

func (*ProviderQuery) OnlyX

func (pq *ProviderQuery) OnlyX(ctx context.Context) *Provider

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

func (*ProviderQuery) Order

Order specifies how the records should be ordered.

func (*ProviderQuery) QuerySubscribes

func (pq *ProviderQuery) QuerySubscribes() *SubscribeQuery

QuerySubscribes chains the current query on the "subscribes" edge.

func (*ProviderQuery) QueryUser

func (pq *ProviderQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*ProviderQuery) Select

func (pq *ProviderQuery) Select(fields ...string) *ProviderSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Provider.Query().
	Select(provider.FieldName).
	Scan(ctx, &v)

func (*ProviderQuery) Unique

func (pq *ProviderQuery) Unique(unique bool) *ProviderQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*ProviderQuery) Where

func (pq *ProviderQuery) Where(ps ...predicate.Provider) *ProviderQuery

Where adds a new predicate for the ProviderQuery builder.

func (*ProviderQuery) WithSubscribes

func (pq *ProviderQuery) WithSubscribes(opts ...func(*SubscribeQuery)) *ProviderQuery

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

func (*ProviderQuery) WithUser

func (pq *ProviderQuery) WithUser(opts ...func(*UserQuery)) *ProviderQuery

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

type ProviderSelect

type ProviderSelect struct {
	*ProviderQuery
	// contains filtered or unexported fields
}

ProviderSelect is the builder for selecting fields of Provider entities.

func (*ProviderSelect) Aggregate

func (ps *ProviderSelect) Aggregate(fns ...AggregateFunc) *ProviderSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProviderSelect) Bool

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

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

func (*ProviderSelect) BoolX

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

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

func (*ProviderSelect) Bools

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

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

func (*ProviderSelect) BoolsX

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

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

func (*ProviderSelect) Float64

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

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

func (*ProviderSelect) Float64X

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

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

func (*ProviderSelect) Float64s

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

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

func (*ProviderSelect) Float64sX

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

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

func (*ProviderSelect) Int

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

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

func (*ProviderSelect) IntX

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

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

func (*ProviderSelect) Ints

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

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

func (*ProviderSelect) IntsX

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

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

func (*ProviderSelect) Scan

func (ps *ProviderSelect) Scan(ctx context.Context, v any) error

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

func (*ProviderSelect) ScanX

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

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

func (*ProviderSelect) String

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

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

func (*ProviderSelect) StringX

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

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

func (*ProviderSelect) Strings

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

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

func (*ProviderSelect) StringsX

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

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

type ProviderUpdate

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

ProviderUpdate is the builder for updating Provider entities.

func (*ProviderUpdate) AddSubscribeIDs

func (pu *ProviderUpdate) AddSubscribeIDs(ids ...int) *ProviderUpdate

AddSubscribeIDs adds the "subscribes" edge to the Subscribe entity by IDs.

func (*ProviderUpdate) AddSubscribes

func (pu *ProviderUpdate) AddSubscribes(s ...*Subscribe) *ProviderUpdate

AddSubscribes adds the "subscribes" edges to the Subscribe entity.

func (*ProviderUpdate) ClearSubscribes

func (pu *ProviderUpdate) ClearSubscribes() *ProviderUpdate

ClearSubscribes clears all "subscribes" edges to the Subscribe entity.

func (*ProviderUpdate) ClearUser

func (pu *ProviderUpdate) ClearUser() *ProviderUpdate

ClearUser clears the "user" edge to the User entity.

func (*ProviderUpdate) Exec

func (pu *ProviderUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProviderUpdate) ExecX

func (pu *ProviderUpdate) ExecX(ctx context.Context)

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

func (*ProviderUpdate) Mutation

func (pu *ProviderUpdate) Mutation() *ProviderMutation

Mutation returns the ProviderMutation object of the builder.

func (*ProviderUpdate) RemoveSubscribeIDs

func (pu *ProviderUpdate) RemoveSubscribeIDs(ids ...int) *ProviderUpdate

RemoveSubscribeIDs removes the "subscribes" edge to Subscribe entities by IDs.

func (*ProviderUpdate) RemoveSubscribes

func (pu *ProviderUpdate) RemoveSubscribes(s ...*Subscribe) *ProviderUpdate

RemoveSubscribes removes "subscribes" edges to Subscribe entities.

func (*ProviderUpdate) Save

func (pu *ProviderUpdate) Save(ctx context.Context) (int, error)

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

func (*ProviderUpdate) SaveX

func (pu *ProviderUpdate) SaveX(ctx context.Context) int

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

func (*ProviderUpdate) SetName

func (pu *ProviderUpdate) SetName(s string) *ProviderUpdate

SetName sets the "name" field.

func (*ProviderUpdate) SetNillableName

func (pu *ProviderUpdate) SetNillableName(s *string) *ProviderUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ProviderUpdate) SetNillablePath

func (pu *ProviderUpdate) SetNillablePath(s *string) *ProviderUpdate

SetNillablePath sets the "path" field if the given value is not nil.

func (*ProviderUpdate) SetNillableUserID

func (pu *ProviderUpdate) SetNillableUserID(id *int) *ProviderUpdate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*ProviderUpdate) SetNillableVersion

func (pu *ProviderUpdate) SetNillableVersion(s *string) *ProviderUpdate

SetNillableVersion sets the "version" field if the given value is not nil.

func (*ProviderUpdate) SetPath

func (pu *ProviderUpdate) SetPath(s string) *ProviderUpdate

SetPath sets the "path" field.

func (*ProviderUpdate) SetUser

func (pu *ProviderUpdate) SetUser(u *User) *ProviderUpdate

SetUser sets the "user" edge to the User entity.

func (*ProviderUpdate) SetUserID

func (pu *ProviderUpdate) SetUserID(id int) *ProviderUpdate

SetUserID sets the "user" edge to the User entity by ID.

func (*ProviderUpdate) SetVersion

func (pu *ProviderUpdate) SetVersion(s string) *ProviderUpdate

SetVersion sets the "version" field.

func (*ProviderUpdate) Where

func (pu *ProviderUpdate) Where(ps ...predicate.Provider) *ProviderUpdate

Where appends a list predicates to the ProviderUpdate builder.

type ProviderUpdateOne

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

ProviderUpdateOne is the builder for updating a single Provider entity.

func (*ProviderUpdateOne) AddSubscribeIDs

func (puo *ProviderUpdateOne) AddSubscribeIDs(ids ...int) *ProviderUpdateOne

AddSubscribeIDs adds the "subscribes" edge to the Subscribe entity by IDs.

func (*ProviderUpdateOne) AddSubscribes

func (puo *ProviderUpdateOne) AddSubscribes(s ...*Subscribe) *ProviderUpdateOne

AddSubscribes adds the "subscribes" edges to the Subscribe entity.

func (*ProviderUpdateOne) ClearSubscribes

func (puo *ProviderUpdateOne) ClearSubscribes() *ProviderUpdateOne

ClearSubscribes clears all "subscribes" edges to the Subscribe entity.

func (*ProviderUpdateOne) ClearUser

func (puo *ProviderUpdateOne) ClearUser() *ProviderUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*ProviderUpdateOne) Exec

func (puo *ProviderUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProviderUpdateOne) ExecX

func (puo *ProviderUpdateOne) ExecX(ctx context.Context)

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

func (*ProviderUpdateOne) Mutation

func (puo *ProviderUpdateOne) Mutation() *ProviderMutation

Mutation returns the ProviderMutation object of the builder.

func (*ProviderUpdateOne) RemoveSubscribeIDs

func (puo *ProviderUpdateOne) RemoveSubscribeIDs(ids ...int) *ProviderUpdateOne

RemoveSubscribeIDs removes the "subscribes" edge to Subscribe entities by IDs.

func (*ProviderUpdateOne) RemoveSubscribes

func (puo *ProviderUpdateOne) RemoveSubscribes(s ...*Subscribe) *ProviderUpdateOne

RemoveSubscribes removes "subscribes" edges to Subscribe entities.

func (*ProviderUpdateOne) Save

func (puo *ProviderUpdateOne) Save(ctx context.Context) (*Provider, error)

Save executes the query and returns the updated Provider entity.

func (*ProviderUpdateOne) SaveX

func (puo *ProviderUpdateOne) SaveX(ctx context.Context) *Provider

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

func (*ProviderUpdateOne) Select

func (puo *ProviderUpdateOne) Select(field string, fields ...string) *ProviderUpdateOne

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

func (*ProviderUpdateOne) SetName

func (puo *ProviderUpdateOne) SetName(s string) *ProviderUpdateOne

SetName sets the "name" field.

func (*ProviderUpdateOne) SetNillableName

func (puo *ProviderUpdateOne) SetNillableName(s *string) *ProviderUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ProviderUpdateOne) SetNillablePath

func (puo *ProviderUpdateOne) SetNillablePath(s *string) *ProviderUpdateOne

SetNillablePath sets the "path" field if the given value is not nil.

func (*ProviderUpdateOne) SetNillableUserID

func (puo *ProviderUpdateOne) SetNillableUserID(id *int) *ProviderUpdateOne

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*ProviderUpdateOne) SetNillableVersion

func (puo *ProviderUpdateOne) SetNillableVersion(s *string) *ProviderUpdateOne

SetNillableVersion sets the "version" field if the given value is not nil.

func (*ProviderUpdateOne) SetPath

func (puo *ProviderUpdateOne) SetPath(s string) *ProviderUpdateOne

SetPath sets the "path" field.

func (*ProviderUpdateOne) SetUser

func (puo *ProviderUpdateOne) SetUser(u *User) *ProviderUpdateOne

SetUser sets the "user" edge to the User entity.

func (*ProviderUpdateOne) SetUserID

func (puo *ProviderUpdateOne) SetUserID(id int) *ProviderUpdateOne

SetUserID sets the "user" edge to the User entity by ID.

func (*ProviderUpdateOne) SetVersion

func (puo *ProviderUpdateOne) SetVersion(s string) *ProviderUpdateOne

SetVersion sets the "version" field.

func (*ProviderUpdateOne) Where

Where appends a list predicates to the ProviderUpdate builder.

type Providers

type Providers []*Provider

Providers is a parsable slice of Provider.

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

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

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Subscribe

type Subscribe struct {

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

Subscribe is the model entity for the Subscribe schema.

func (*Subscribe) QueryNodes

func (s *Subscribe) QueryNodes() *NodeQuery

QueryNodes queries the "nodes" edge of the Subscribe entity.

func (*Subscribe) QueryProvider

func (s *Subscribe) QueryProvider() *ProviderQuery

QueryProvider queries the "provider" edge of the Subscribe entity.

func (*Subscribe) QueryUser

func (s *Subscribe) QueryUser() *UserQuery

QueryUser queries the "user" edge of the Subscribe entity.

func (*Subscribe) String

func (s *Subscribe) String() string

String implements the fmt.Stringer.

func (*Subscribe) Unwrap

func (s *Subscribe) Unwrap() *Subscribe

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

func (*Subscribe) Update

func (s *Subscribe) Update() *SubscribeUpdateOne

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

func (*Subscribe) Value

func (s *Subscribe) Value(name string) (ent.Value, error)

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

type SubscribeClient

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

SubscribeClient is a client for the Subscribe schema.

func NewSubscribeClient

func NewSubscribeClient(c config) *SubscribeClient

NewSubscribeClient returns a client for the Subscribe from the given config.

func (*SubscribeClient) Create

func (c *SubscribeClient) Create() *SubscribeCreate

Create returns a builder for creating a Subscribe entity.

func (*SubscribeClient) CreateBulk

func (c *SubscribeClient) CreateBulk(builders ...*SubscribeCreate) *SubscribeCreateBulk

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

func (*SubscribeClient) Delete

func (c *SubscribeClient) Delete() *SubscribeDelete

Delete returns a delete builder for Subscribe.

func (*SubscribeClient) DeleteOne

func (c *SubscribeClient) DeleteOne(s *Subscribe) *SubscribeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SubscribeClient) DeleteOneID

func (c *SubscribeClient) DeleteOneID(id int) *SubscribeDeleteOne

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

func (*SubscribeClient) Get

func (c *SubscribeClient) Get(ctx context.Context, id int) (*Subscribe, error)

Get returns a Subscribe entity by its id.

func (*SubscribeClient) GetX

func (c *SubscribeClient) GetX(ctx context.Context, id int) *Subscribe

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

func (*SubscribeClient) Hooks

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

Hooks returns the client hooks.

func (*SubscribeClient) Intercept

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

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

func (*SubscribeClient) Interceptors

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

Interceptors returns the client interceptors.

func (*SubscribeClient) MapCreateBulk

func (c *SubscribeClient) MapCreateBulk(slice any, setFunc func(*SubscribeCreate, int)) *SubscribeCreateBulk

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

func (*SubscribeClient) Query

func (c *SubscribeClient) Query() *SubscribeQuery

Query returns a query builder for Subscribe.

func (*SubscribeClient) QueryNodes

func (c *SubscribeClient) QueryNodes(s *Subscribe) *NodeQuery

QueryNodes queries the nodes edge of a Subscribe.

func (*SubscribeClient) QueryProvider

func (c *SubscribeClient) QueryProvider(s *Subscribe) *ProviderQuery

QueryProvider queries the provider edge of a Subscribe.

func (*SubscribeClient) QueryUser

func (c *SubscribeClient) QueryUser(s *Subscribe) *UserQuery

QueryUser queries the user edge of a Subscribe.

func (*SubscribeClient) Update

func (c *SubscribeClient) Update() *SubscribeUpdate

Update returns an update builder for Subscribe.

func (*SubscribeClient) UpdateOne

func (c *SubscribeClient) UpdateOne(s *Subscribe) *SubscribeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SubscribeClient) UpdateOneID

func (c *SubscribeClient) UpdateOneID(id int) *SubscribeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SubscribeClient) Use

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

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

type SubscribeCreate

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

SubscribeCreate is the builder for creating a Subscribe entity.

func (*SubscribeCreate) AddNodeIDs

func (sc *SubscribeCreate) AddNodeIDs(ids ...int) *SubscribeCreate

AddNodeIDs adds the "nodes" edge to the Node entity by IDs.

func (*SubscribeCreate) AddNodes

func (sc *SubscribeCreate) AddNodes(n ...*Node) *SubscribeCreate

AddNodes adds the "nodes" edges to the Node entity.

func (*SubscribeCreate) Exec

func (sc *SubscribeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SubscribeCreate) ExecX

func (sc *SubscribeCreate) ExecX(ctx context.Context)

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

func (*SubscribeCreate) Mutation

func (sc *SubscribeCreate) Mutation() *SubscribeMutation

Mutation returns the SubscribeMutation object of the builder.

func (*SubscribeCreate) Save

func (sc *SubscribeCreate) Save(ctx context.Context) (*Subscribe, error)

Save creates the Subscribe in the database.

func (*SubscribeCreate) SaveX

func (sc *SubscribeCreate) SaveX(ctx context.Context) *Subscribe

SaveX calls Save and panics if Save returns an error.

func (*SubscribeCreate) SetConf

func (sc *SubscribeCreate) SetConf(s string) *SubscribeCreate

SetConf sets the "conf" field.

func (sc *SubscribeCreate) SetLink(s string) *SubscribeCreate

SetLink sets the "link" field.

func (*SubscribeCreate) SetName

func (sc *SubscribeCreate) SetName(s string) *SubscribeCreate

SetName sets the "name" field.

func (sc *SubscribeCreate) SetNillableLink(s *string) *SubscribeCreate

SetNillableLink sets the "link" field if the given value is not nil.

func (*SubscribeCreate) SetNillableProviderID

func (sc *SubscribeCreate) SetNillableProviderID(id *int) *SubscribeCreate

SetNillableProviderID sets the "provider" edge to the Provider entity by ID if the given value is not nil.

func (*SubscribeCreate) SetNillableUserID

func (sc *SubscribeCreate) SetNillableUserID(id *int) *SubscribeCreate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*SubscribeCreate) SetProvider

func (sc *SubscribeCreate) SetProvider(p *Provider) *SubscribeCreate

SetProvider sets the "provider" edge to the Provider entity.

func (*SubscribeCreate) SetProviderID

func (sc *SubscribeCreate) SetProviderID(id int) *SubscribeCreate

SetProviderID sets the "provider" edge to the Provider entity by ID.

func (*SubscribeCreate) SetUser

func (sc *SubscribeCreate) SetUser(u *User) *SubscribeCreate

SetUser sets the "user" edge to the User entity.

func (*SubscribeCreate) SetUserID

func (sc *SubscribeCreate) SetUserID(id int) *SubscribeCreate

SetUserID sets the "user" edge to the User entity by ID.

type SubscribeCreateBulk

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

SubscribeCreateBulk is the builder for creating many Subscribe entities in bulk.

func (*SubscribeCreateBulk) Exec

func (scb *SubscribeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SubscribeCreateBulk) ExecX

func (scb *SubscribeCreateBulk) ExecX(ctx context.Context)

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

func (*SubscribeCreateBulk) Save

func (scb *SubscribeCreateBulk) Save(ctx context.Context) ([]*Subscribe, error)

Save creates the Subscribe entities in the database.

func (*SubscribeCreateBulk) SaveX

func (scb *SubscribeCreateBulk) SaveX(ctx context.Context) []*Subscribe

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

type SubscribeDelete

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

SubscribeDelete is the builder for deleting a Subscribe entity.

func (*SubscribeDelete) Exec

func (sd *SubscribeDelete) Exec(ctx context.Context) (int, error)

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

func (*SubscribeDelete) ExecX

func (sd *SubscribeDelete) ExecX(ctx context.Context) int

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

func (*SubscribeDelete) Where

Where appends a list predicates to the SubscribeDelete builder.

type SubscribeDeleteOne

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

SubscribeDeleteOne is the builder for deleting a single Subscribe entity.

func (*SubscribeDeleteOne) Exec

func (sdo *SubscribeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SubscribeDeleteOne) ExecX

func (sdo *SubscribeDeleteOne) ExecX(ctx context.Context)

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

func (*SubscribeDeleteOne) Where

Where appends a list predicates to the SubscribeDelete builder.

type SubscribeEdges

type SubscribeEdges struct {
	// Provider holds the value of the provider edge.
	Provider *Provider `json:"provider,omitempty"`
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// Nodes holds the value of the nodes edge.
	Nodes []*Node `json:"nodes,omitempty"`
	// contains filtered or unexported fields
}

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

func (SubscribeEdges) NodesOrErr

func (e SubscribeEdges) NodesOrErr() ([]*Node, error)

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

func (SubscribeEdges) ProviderOrErr

func (e SubscribeEdges) ProviderOrErr() (*Provider, error)

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

func (SubscribeEdges) UserOrErr

func (e SubscribeEdges) 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 SubscribeGroupBy

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

SubscribeGroupBy is the group-by builder for Subscribe entities.

func (*SubscribeGroupBy) Aggregate

func (sgb *SubscribeGroupBy) Aggregate(fns ...AggregateFunc) *SubscribeGroupBy

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

func (*SubscribeGroupBy) Bool

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

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

func (*SubscribeGroupBy) BoolX

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

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

func (*SubscribeGroupBy) Bools

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

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

func (*SubscribeGroupBy) BoolsX

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

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

func (*SubscribeGroupBy) Float64

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

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

func (*SubscribeGroupBy) Float64X

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

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

func (*SubscribeGroupBy) Float64s

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

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

func (*SubscribeGroupBy) Float64sX

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

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

func (*SubscribeGroupBy) Int

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

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

func (*SubscribeGroupBy) IntX

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

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

func (*SubscribeGroupBy) Ints

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

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

func (*SubscribeGroupBy) IntsX

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

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

func (*SubscribeGroupBy) Scan

func (sgb *SubscribeGroupBy) Scan(ctx context.Context, v any) error

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

func (*SubscribeGroupBy) ScanX

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

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

func (*SubscribeGroupBy) String

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

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

func (*SubscribeGroupBy) StringX

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

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

func (*SubscribeGroupBy) Strings

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

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

func (*SubscribeGroupBy) StringsX

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

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

type SubscribeMutation

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

SubscribeMutation represents an operation that mutates the Subscribe nodes in the graph.

func (*SubscribeMutation) AddField

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

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

func (*SubscribeMutation) AddNodeIDs

func (m *SubscribeMutation) AddNodeIDs(ids ...int)

AddNodeIDs adds the "nodes" edge to the Node entity by ids.

func (*SubscribeMutation) AddedEdges

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

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

func (*SubscribeMutation) AddedField

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

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*SubscribeMutation) AddedFields

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

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

func (*SubscribeMutation) AddedIDs

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

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

func (*SubscribeMutation) ClearEdge

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

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

func (*SubscribeMutation) ClearField

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

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

func (m *SubscribeMutation) ClearLink()

ClearLink clears the value of the "link" field.

func (*SubscribeMutation) ClearNodes

func (m *SubscribeMutation) ClearNodes()

ClearNodes clears the "nodes" edge to the Node entity.

func (*SubscribeMutation) ClearProvider

func (m *SubscribeMutation) ClearProvider()

ClearProvider clears the "provider" edge to the Provider entity.

func (*SubscribeMutation) ClearUser

func (m *SubscribeMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*SubscribeMutation) ClearedEdges

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

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

func (*SubscribeMutation) ClearedFields

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

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

func (SubscribeMutation) Client

func (m SubscribeMutation) 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 (*SubscribeMutation) Conf

func (m *SubscribeMutation) Conf() (r string, exists bool)

Conf returns the value of the "conf" field in the mutation.

func (*SubscribeMutation) EdgeCleared

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

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

func (*SubscribeMutation) Field

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

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

func (*SubscribeMutation) FieldCleared

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

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

func (*SubscribeMutation) Fields

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

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

func (*SubscribeMutation) ID

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

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

func (*SubscribeMutation) IDs

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

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

func (m *SubscribeMutation) Link() (r string, exists bool)

Link returns the value of the "link" field in the mutation.

func (*SubscribeMutation) LinkCleared

func (m *SubscribeMutation) LinkCleared() bool

LinkCleared returns if the "link" field was cleared in this mutation.

func (*SubscribeMutation) Name

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

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

func (*SubscribeMutation) NodesCleared

func (m *SubscribeMutation) NodesCleared() bool

NodesCleared reports if the "nodes" edge to the Node entity was cleared.

func (*SubscribeMutation) NodesIDs

func (m *SubscribeMutation) NodesIDs() (ids []int)

NodesIDs returns the "nodes" edge IDs in the mutation.

func (*SubscribeMutation) OldConf

func (m *SubscribeMutation) OldConf(ctx context.Context) (v string, err error)

OldConf returns the old "conf" field's value of the Subscribe entity. If the Subscribe object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscribeMutation) OldField

func (m *SubscribeMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (m *SubscribeMutation) OldLink(ctx context.Context) (v string, err error)

OldLink returns the old "link" field's value of the Subscribe entity. If the Subscribe object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscribeMutation) OldName

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

OldName returns the old "name" field's value of the Subscribe entity. If the Subscribe object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscribeMutation) Op

func (m *SubscribeMutation) Op() Op

Op returns the operation name.

func (*SubscribeMutation) ProviderCleared

func (m *SubscribeMutation) ProviderCleared() bool

ProviderCleared reports if the "provider" edge to the Provider entity was cleared.

func (*SubscribeMutation) ProviderID

func (m *SubscribeMutation) ProviderID() (id int, exists bool)

ProviderID returns the "provider" edge ID in the mutation.

func (*SubscribeMutation) ProviderIDs

func (m *SubscribeMutation) ProviderIDs() (ids []int)

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

func (*SubscribeMutation) RemoveNodeIDs

func (m *SubscribeMutation) RemoveNodeIDs(ids ...int)

RemoveNodeIDs removes the "nodes" edge to the Node entity by IDs.

func (*SubscribeMutation) RemovedEdges

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

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

func (*SubscribeMutation) RemovedIDs

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

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*SubscribeMutation) RemovedNodesIDs

func (m *SubscribeMutation) RemovedNodesIDs() (ids []int)

RemovedNodes returns the removed IDs of the "nodes" edge to the Node entity.

func (*SubscribeMutation) ResetConf

func (m *SubscribeMutation) ResetConf()

ResetConf resets all changes to the "conf" field.

func (*SubscribeMutation) ResetEdge

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

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

func (*SubscribeMutation) ResetField

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

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

func (m *SubscribeMutation) ResetLink()

ResetLink resets all changes to the "link" field.

func (*SubscribeMutation) ResetName

func (m *SubscribeMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*SubscribeMutation) ResetNodes

func (m *SubscribeMutation) ResetNodes()

ResetNodes resets all changes to the "nodes" edge.

func (*SubscribeMutation) ResetProvider

func (m *SubscribeMutation) ResetProvider()

ResetProvider resets all changes to the "provider" edge.

func (*SubscribeMutation) ResetUser

func (m *SubscribeMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*SubscribeMutation) SetConf

func (m *SubscribeMutation) SetConf(s string)

SetConf sets the "conf" field.

func (*SubscribeMutation) SetField

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

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (m *SubscribeMutation) SetLink(s string)

SetLink sets the "link" field.

func (*SubscribeMutation) SetName

func (m *SubscribeMutation) SetName(s string)

SetName sets the "name" field.

func (*SubscribeMutation) SetOp

func (m *SubscribeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SubscribeMutation) SetProviderID

func (m *SubscribeMutation) SetProviderID(id int)

SetProviderID sets the "provider" edge to the Provider entity by id.

func (*SubscribeMutation) SetUserID

func (m *SubscribeMutation) SetUserID(id int)

SetUserID sets the "user" edge to the User entity by id.

func (SubscribeMutation) Tx

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

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

func (*SubscribeMutation) Type

func (m *SubscribeMutation) Type() string

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

func (*SubscribeMutation) UserCleared

func (m *SubscribeMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*SubscribeMutation) UserID

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

UserID returns the "user" edge ID in the mutation.

func (*SubscribeMutation) UserIDs

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

UserIDs returns the "user" edge 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.

func (*SubscribeMutation) Where

func (m *SubscribeMutation) Where(ps ...predicate.Subscribe)

Where appends a list predicates to the SubscribeMutation builder.

func (*SubscribeMutation) WhereP

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

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

type SubscribeQuery

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

SubscribeQuery is the builder for querying Subscribe entities.

func (*SubscribeQuery) Aggregate

func (sq *SubscribeQuery) Aggregate(fns ...AggregateFunc) *SubscribeSelect

Aggregate returns a SubscribeSelect configured with the given aggregations.

func (*SubscribeQuery) All

func (sq *SubscribeQuery) All(ctx context.Context) ([]*Subscribe, error)

All executes the query and returns a list of Subscribes.

func (*SubscribeQuery) AllX

func (sq *SubscribeQuery) AllX(ctx context.Context) []*Subscribe

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

func (*SubscribeQuery) Clone

func (sq *SubscribeQuery) Clone() *SubscribeQuery

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

func (*SubscribeQuery) Count

func (sq *SubscribeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SubscribeQuery) CountX

func (sq *SubscribeQuery) CountX(ctx context.Context) int

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

func (*SubscribeQuery) Exist

func (sq *SubscribeQuery) Exist(ctx context.Context) (bool, error)

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

func (*SubscribeQuery) ExistX

func (sq *SubscribeQuery) ExistX(ctx context.Context) bool

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

func (*SubscribeQuery) First

func (sq *SubscribeQuery) First(ctx context.Context) (*Subscribe, error)

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

func (*SubscribeQuery) FirstID

func (sq *SubscribeQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*SubscribeQuery) FirstIDX

func (sq *SubscribeQuery) FirstIDX(ctx context.Context) int

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

func (*SubscribeQuery) FirstX

func (sq *SubscribeQuery) FirstX(ctx context.Context) *Subscribe

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

func (*SubscribeQuery) GroupBy

func (sq *SubscribeQuery) GroupBy(field string, fields ...string) *SubscribeGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Subscribe.Query().
	GroupBy(subscribe.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SubscribeQuery) IDs

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

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

func (*SubscribeQuery) IDsX

func (sq *SubscribeQuery) IDsX(ctx context.Context) []int

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

func (*SubscribeQuery) Limit

func (sq *SubscribeQuery) Limit(limit int) *SubscribeQuery

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

func (*SubscribeQuery) Offset

func (sq *SubscribeQuery) Offset(offset int) *SubscribeQuery

Offset to start from.

func (*SubscribeQuery) Only

func (sq *SubscribeQuery) Only(ctx context.Context) (*Subscribe, error)

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

func (*SubscribeQuery) OnlyID

func (sq *SubscribeQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*SubscribeQuery) OnlyIDX

func (sq *SubscribeQuery) OnlyIDX(ctx context.Context) int

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

func (*SubscribeQuery) OnlyX

func (sq *SubscribeQuery) OnlyX(ctx context.Context) *Subscribe

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

func (*SubscribeQuery) Order

Order specifies how the records should be ordered.

func (*SubscribeQuery) QueryNodes

func (sq *SubscribeQuery) QueryNodes() *NodeQuery

QueryNodes chains the current query on the "nodes" edge.

func (*SubscribeQuery) QueryProvider

func (sq *SubscribeQuery) QueryProvider() *ProviderQuery

QueryProvider chains the current query on the "provider" edge.

func (*SubscribeQuery) QueryUser

func (sq *SubscribeQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*SubscribeQuery) Select

func (sq *SubscribeQuery) Select(fields ...string) *SubscribeSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Subscribe.Query().
	Select(subscribe.FieldName).
	Scan(ctx, &v)

func (*SubscribeQuery) Unique

func (sq *SubscribeQuery) Unique(unique bool) *SubscribeQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*SubscribeQuery) Where

Where adds a new predicate for the SubscribeQuery builder.

func (*SubscribeQuery) WithNodes

func (sq *SubscribeQuery) WithNodes(opts ...func(*NodeQuery)) *SubscribeQuery

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

func (*SubscribeQuery) WithProvider

func (sq *SubscribeQuery) WithProvider(opts ...func(*ProviderQuery)) *SubscribeQuery

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

func (*SubscribeQuery) WithUser

func (sq *SubscribeQuery) WithUser(opts ...func(*UserQuery)) *SubscribeQuery

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

type SubscribeSelect

type SubscribeSelect struct {
	*SubscribeQuery
	// contains filtered or unexported fields
}

SubscribeSelect is the builder for selecting fields of Subscribe entities.

func (*SubscribeSelect) Aggregate

func (ss *SubscribeSelect) Aggregate(fns ...AggregateFunc) *SubscribeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SubscribeSelect) Bool

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

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

func (*SubscribeSelect) BoolX

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

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

func (*SubscribeSelect) Bools

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

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

func (*SubscribeSelect) BoolsX

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

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

func (*SubscribeSelect) Float64

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

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

func (*SubscribeSelect) Float64X

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

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

func (*SubscribeSelect) Float64s

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

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

func (*SubscribeSelect) Float64sX

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

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

func (*SubscribeSelect) Int

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

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

func (*SubscribeSelect) IntX

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

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

func (*SubscribeSelect) Ints

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

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

func (*SubscribeSelect) IntsX

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

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

func (*SubscribeSelect) Scan

func (ss *SubscribeSelect) Scan(ctx context.Context, v any) error

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

func (*SubscribeSelect) ScanX

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

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

func (*SubscribeSelect) String

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

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

func (*SubscribeSelect) StringX

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

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

func (*SubscribeSelect) Strings

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

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

func (*SubscribeSelect) StringsX

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

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

type SubscribeUpdate

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

SubscribeUpdate is the builder for updating Subscribe entities.

func (*SubscribeUpdate) AddNodeIDs

func (su *SubscribeUpdate) AddNodeIDs(ids ...int) *SubscribeUpdate

AddNodeIDs adds the "nodes" edge to the Node entity by IDs.

func (*SubscribeUpdate) AddNodes

func (su *SubscribeUpdate) AddNodes(n ...*Node) *SubscribeUpdate

AddNodes adds the "nodes" edges to the Node entity.

func (su *SubscribeUpdate) ClearLink() *SubscribeUpdate

ClearLink clears the value of the "link" field.

func (*SubscribeUpdate) ClearNodes

func (su *SubscribeUpdate) ClearNodes() *SubscribeUpdate

ClearNodes clears all "nodes" edges to the Node entity.

func (*SubscribeUpdate) ClearProvider

func (su *SubscribeUpdate) ClearProvider() *SubscribeUpdate

ClearProvider clears the "provider" edge to the Provider entity.

func (*SubscribeUpdate) ClearUser

func (su *SubscribeUpdate) ClearUser() *SubscribeUpdate

ClearUser clears the "user" edge to the User entity.

func (*SubscribeUpdate) Exec

func (su *SubscribeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SubscribeUpdate) ExecX

func (su *SubscribeUpdate) ExecX(ctx context.Context)

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

func (*SubscribeUpdate) Mutation

func (su *SubscribeUpdate) Mutation() *SubscribeMutation

Mutation returns the SubscribeMutation object of the builder.

func (*SubscribeUpdate) RemoveNodeIDs

func (su *SubscribeUpdate) RemoveNodeIDs(ids ...int) *SubscribeUpdate

RemoveNodeIDs removes the "nodes" edge to Node entities by IDs.

func (*SubscribeUpdate) RemoveNodes

func (su *SubscribeUpdate) RemoveNodes(n ...*Node) *SubscribeUpdate

RemoveNodes removes "nodes" edges to Node entities.

func (*SubscribeUpdate) Save

func (su *SubscribeUpdate) Save(ctx context.Context) (int, error)

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

func (*SubscribeUpdate) SaveX

func (su *SubscribeUpdate) SaveX(ctx context.Context) int

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

func (*SubscribeUpdate) SetConf

func (su *SubscribeUpdate) SetConf(s string) *SubscribeUpdate

SetConf sets the "conf" field.

func (su *SubscribeUpdate) SetLink(s string) *SubscribeUpdate

SetLink sets the "link" field.

func (*SubscribeUpdate) SetName

func (su *SubscribeUpdate) SetName(s string) *SubscribeUpdate

SetName sets the "name" field.

func (*SubscribeUpdate) SetNillableConf

func (su *SubscribeUpdate) SetNillableConf(s *string) *SubscribeUpdate

SetNillableConf sets the "conf" field if the given value is not nil.

func (su *SubscribeUpdate) SetNillableLink(s *string) *SubscribeUpdate

SetNillableLink sets the "link" field if the given value is not nil.

func (*SubscribeUpdate) SetNillableName

func (su *SubscribeUpdate) SetNillableName(s *string) *SubscribeUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*SubscribeUpdate) SetNillableProviderID

func (su *SubscribeUpdate) SetNillableProviderID(id *int) *SubscribeUpdate

SetNillableProviderID sets the "provider" edge to the Provider entity by ID if the given value is not nil.

func (*SubscribeUpdate) SetNillableUserID

func (su *SubscribeUpdate) SetNillableUserID(id *int) *SubscribeUpdate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*SubscribeUpdate) SetProvider

func (su *SubscribeUpdate) SetProvider(p *Provider) *SubscribeUpdate

SetProvider sets the "provider" edge to the Provider entity.

func (*SubscribeUpdate) SetProviderID

func (su *SubscribeUpdate) SetProviderID(id int) *SubscribeUpdate

SetProviderID sets the "provider" edge to the Provider entity by ID.

func (*SubscribeUpdate) SetUser

func (su *SubscribeUpdate) SetUser(u *User) *SubscribeUpdate

SetUser sets the "user" edge to the User entity.

func (*SubscribeUpdate) SetUserID

func (su *SubscribeUpdate) SetUserID(id int) *SubscribeUpdate

SetUserID sets the "user" edge to the User entity by ID.

func (*SubscribeUpdate) Where

Where appends a list predicates to the SubscribeUpdate builder.

type SubscribeUpdateOne

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

SubscribeUpdateOne is the builder for updating a single Subscribe entity.

func (*SubscribeUpdateOne) AddNodeIDs

func (suo *SubscribeUpdateOne) AddNodeIDs(ids ...int) *SubscribeUpdateOne

AddNodeIDs adds the "nodes" edge to the Node entity by IDs.

func (*SubscribeUpdateOne) AddNodes

func (suo *SubscribeUpdateOne) AddNodes(n ...*Node) *SubscribeUpdateOne

AddNodes adds the "nodes" edges to the Node entity.

func (suo *SubscribeUpdateOne) ClearLink() *SubscribeUpdateOne

ClearLink clears the value of the "link" field.

func (*SubscribeUpdateOne) ClearNodes

func (suo *SubscribeUpdateOne) ClearNodes() *SubscribeUpdateOne

ClearNodes clears all "nodes" edges to the Node entity.

func (*SubscribeUpdateOne) ClearProvider

func (suo *SubscribeUpdateOne) ClearProvider() *SubscribeUpdateOne

ClearProvider clears the "provider" edge to the Provider entity.

func (*SubscribeUpdateOne) ClearUser

func (suo *SubscribeUpdateOne) ClearUser() *SubscribeUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*SubscribeUpdateOne) Exec

func (suo *SubscribeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SubscribeUpdateOne) ExecX

func (suo *SubscribeUpdateOne) ExecX(ctx context.Context)

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

func (*SubscribeUpdateOne) Mutation

func (suo *SubscribeUpdateOne) Mutation() *SubscribeMutation

Mutation returns the SubscribeMutation object of the builder.

func (*SubscribeUpdateOne) RemoveNodeIDs

func (suo *SubscribeUpdateOne) RemoveNodeIDs(ids ...int) *SubscribeUpdateOne

RemoveNodeIDs removes the "nodes" edge to Node entities by IDs.

func (*SubscribeUpdateOne) RemoveNodes

func (suo *SubscribeUpdateOne) RemoveNodes(n ...*Node) *SubscribeUpdateOne

RemoveNodes removes "nodes" edges to Node entities.

func (*SubscribeUpdateOne) Save

func (suo *SubscribeUpdateOne) Save(ctx context.Context) (*Subscribe, error)

Save executes the query and returns the updated Subscribe entity.

func (*SubscribeUpdateOne) SaveX

func (suo *SubscribeUpdateOne) SaveX(ctx context.Context) *Subscribe

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

func (*SubscribeUpdateOne) Select

func (suo *SubscribeUpdateOne) Select(field string, fields ...string) *SubscribeUpdateOne

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

func (*SubscribeUpdateOne) SetConf

func (suo *SubscribeUpdateOne) SetConf(s string) *SubscribeUpdateOne

SetConf sets the "conf" field.

func (suo *SubscribeUpdateOne) SetLink(s string) *SubscribeUpdateOne

SetLink sets the "link" field.

func (*SubscribeUpdateOne) SetName

func (suo *SubscribeUpdateOne) SetName(s string) *SubscribeUpdateOne

SetName sets the "name" field.

func (*SubscribeUpdateOne) SetNillableConf

func (suo *SubscribeUpdateOne) SetNillableConf(s *string) *SubscribeUpdateOne

SetNillableConf sets the "conf" field if the given value is not nil.

func (suo *SubscribeUpdateOne) SetNillableLink(s *string) *SubscribeUpdateOne

SetNillableLink sets the "link" field if the given value is not nil.

func (*SubscribeUpdateOne) SetNillableName

func (suo *SubscribeUpdateOne) SetNillableName(s *string) *SubscribeUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*SubscribeUpdateOne) SetNillableProviderID

func (suo *SubscribeUpdateOne) SetNillableProviderID(id *int) *SubscribeUpdateOne

SetNillableProviderID sets the "provider" edge to the Provider entity by ID if the given value is not nil.

func (*SubscribeUpdateOne) SetNillableUserID

func (suo *SubscribeUpdateOne) SetNillableUserID(id *int) *SubscribeUpdateOne

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*SubscribeUpdateOne) SetProvider

func (suo *SubscribeUpdateOne) SetProvider(p *Provider) *SubscribeUpdateOne

SetProvider sets the "provider" edge to the Provider entity.

func (*SubscribeUpdateOne) SetProviderID

func (suo *SubscribeUpdateOne) SetProviderID(id int) *SubscribeUpdateOne

SetProviderID sets the "provider" edge to the Provider entity by ID.

func (*SubscribeUpdateOne) SetUser

func (suo *SubscribeUpdateOne) SetUser(u *User) *SubscribeUpdateOne

SetUser sets the "user" edge to the User entity.

func (*SubscribeUpdateOne) SetUserID

func (suo *SubscribeUpdateOne) SetUserID(id int) *SubscribeUpdateOne

SetUserID sets the "user" edge to the User entity by ID.

func (*SubscribeUpdateOne) Where

Where appends a list predicates to the SubscribeUpdate builder.

type Subscribes

type Subscribes []*Subscribe

Subscribes is a parsable slice of Subscribe.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

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

type Traverser

type Traverser = ent.Traverser

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

type Tx

type Tx struct {

	// Daemon is the client for interacting with the Daemon builders.
	Daemon *DaemonClient
	// Node is the client for interacting with the Node builders.
	Node *NodeClient
	// Provider is the client for interacting with the Provider builders.
	Provider *ProviderClient
	// Subscribe is the client for interacting with the Subscribe builders.
	Subscribe *SubscribeClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

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

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Active holds the value of the "active" field.
	Active bool `json:"active,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) QueryDaemon

func (u *User) QueryDaemon() *DaemonQuery

QueryDaemon queries the "daemon" edge of the User entity.

func (*User) QueryProvider

func (u *User) QueryProvider() *ProviderQuery

QueryProvider queries the "provider" edge of the User entity.

func (*User) QuerySubscribe

func (u *User) QuerySubscribe() *SubscribeQuery

QuerySubscribe queries the "subscribe" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

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

func (*User) Update

func (u *User) Update() *UserUpdateOne

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

func (*User) Value

func (u *User) Value(name string) (ent.Value, error)

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

type UserClient

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

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

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

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id int) *UserDeleteOne

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

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int) *User

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

func (*UserClient) Hooks

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

Hooks returns the client hooks.

func (*UserClient) Intercept

func (c *UserClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.

func (*UserClient) Interceptors

func (c *UserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserClient) MapCreateBulk

func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryDaemon

func (c *UserClient) QueryDaemon(u *User) *DaemonQuery

QueryDaemon queries the daemon edge of a User.

func (*UserClient) QueryProvider

func (c *UserClient) QueryProvider(u *User) *ProviderQuery

QueryProvider queries the provider edge of a User.

func (*UserClient) QuerySubscribe

func (c *UserClient) QuerySubscribe(u *User) *SubscribeQuery

QuerySubscribe queries the subscribe 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) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetActive

func (uc *UserCreate) SetActive(b bool) *UserCreate

SetActive sets the "active" field.

func (*UserCreate) SetDaemon

func (uc *UserCreate) SetDaemon(d *Daemon) *UserCreate

SetDaemon sets the "daemon" edge to the Daemon entity.

func (*UserCreate) SetDaemonID

func (uc *UserCreate) SetDaemonID(id int) *UserCreate

SetDaemonID sets the "daemon" edge to the Daemon entity by ID.

func (*UserCreate) SetName

func (uc *UserCreate) SetName(s string) *UserCreate

SetName sets the "name" field.

func (*UserCreate) SetNillableActive

func (uc *UserCreate) SetNillableActive(b *bool) *UserCreate

SetNillableActive sets the "active" field if the given value is not nil.

func (*UserCreate) SetNillableDaemonID

func (uc *UserCreate) SetNillableDaemonID(id *int) *UserCreate

SetNillableDaemonID sets the "daemon" edge to the Daemon entity by ID if the given value is not nil.

func (*UserCreate) SetNillableProviderID

func (uc *UserCreate) SetNillableProviderID(id *int) *UserCreate

SetNillableProviderID sets the "provider" edge to the Provider entity by ID if the given value is not nil.

func (*UserCreate) SetNillableSubscribeID

func (uc *UserCreate) SetNillableSubscribeID(id *int) *UserCreate

SetNillableSubscribeID sets the "subscribe" edge to the Subscribe entity by ID if the given value is not nil.

func (*UserCreate) SetProvider

func (uc *UserCreate) SetProvider(p *Provider) *UserCreate

SetProvider sets the "provider" edge to the Provider entity.

func (*UserCreate) SetProviderID

func (uc *UserCreate) SetProviderID(id int) *UserCreate

SetProviderID sets the "provider" edge to the Provider entity by ID.

func (*UserCreate) SetSubscribe

func (uc *UserCreate) SetSubscribe(s *Subscribe) *UserCreate

SetSubscribe sets the "subscribe" edge to the Subscribe entity.

func (*UserCreate) SetSubscribeID

func (uc *UserCreate) SetSubscribeID(id int) *UserCreate

SetSubscribeID sets the "subscribe" edge to the Subscribe entity by ID.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserEdges

type UserEdges struct {
	// Provider holds the value of the provider edge.
	Provider *Provider `json:"provider,omitempty"`
	// Subscribe holds the value of the subscribe edge.
	Subscribe *Subscribe `json:"subscribe,omitempty"`
	// Daemon holds the value of the daemon edge.
	Daemon *Daemon `json:"daemon,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) DaemonOrErr

func (e UserEdges) DaemonOrErr() (*Daemon, error)

DaemonOrErr returns the Daemon value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserEdges) ProviderOrErr

func (e UserEdges) ProviderOrErr() (*Provider, error)

ProviderOrErr returns the Provider value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserEdges) SubscribeOrErr

func (e UserEdges) SubscribeOrErr() (*Subscribe, error)

SubscribeOrErr returns the Subscribe value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) Active

func (m *UserMutation) Active() (r bool, exists bool)

Active returns the value of the "active" field in the mutation.

func (*UserMutation) AddField

func (m *UserMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) ClearDaemon

func (m *UserMutation) ClearDaemon()

ClearDaemon clears the "daemon" edge to the Daemon entity.

func (*UserMutation) ClearEdge

func (m *UserMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*UserMutation) ClearField

func (m *UserMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ClearProvider

func (m *UserMutation) ClearProvider()

ClearProvider clears the "provider" edge to the Provider entity.

func (*UserMutation) ClearSubscribe

func (m *UserMutation) ClearSubscribe()

ClearSubscribe clears the "subscribe" edge to the Subscribe entity.

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) DaemonCleared

func (m *UserMutation) DaemonCleared() bool

DaemonCleared reports if the "daemon" edge to the Daemon entity was cleared.

func (*UserMutation) DaemonID

func (m *UserMutation) DaemonID() (id int, exists bool)

DaemonID returns the "daemon" edge ID in the mutation.

func (*UserMutation) DaemonIDs

func (m *UserMutation) DaemonIDs() (ids []int)

DaemonIDs returns the "daemon" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use DaemonID instead. It exists only for internal usage by the builders.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UserMutation) ID

func (m *UserMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*UserMutation) Name

func (m *UserMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*UserMutation) OldActive

func (m *UserMutation) OldActive(ctx context.Context) (v bool, err error)

OldActive returns the old "active" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldField

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*UserMutation) OldName

func (m *UserMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) ProviderCleared

func (m *UserMutation) ProviderCleared() bool

ProviderCleared reports if the "provider" edge to the Provider entity was cleared.

func (*UserMutation) ProviderID

func (m *UserMutation) ProviderID() (id int, exists bool)

ProviderID returns the "provider" edge ID in the mutation.

func (*UserMutation) ProviderIDs

func (m *UserMutation) ProviderIDs() (ids []int)

ProviderIDs returns the "provider" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProviderID instead. It exists only for internal usage by the builders.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedIDs

func (m *UserMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UserMutation) ResetActive

func (m *UserMutation) ResetActive()

ResetActive resets all changes to the "active" field.

func (*UserMutation) ResetDaemon

func (m *UserMutation) ResetDaemon()

ResetDaemon resets all changes to the "daemon" edge.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetField

func (m *UserMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ResetName

func (m *UserMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*UserMutation) ResetProvider

func (m *UserMutation) ResetProvider()

ResetProvider resets all changes to the "provider" edge.

func (*UserMutation) ResetSubscribe

func (m *UserMutation) ResetSubscribe()

ResetSubscribe resets all changes to the "subscribe" edge.

func (*UserMutation) SetActive

func (m *UserMutation) SetActive(b bool)

SetActive sets the "active" field.

func (*UserMutation) SetDaemonID

func (m *UserMutation) SetDaemonID(id int)

SetDaemonID sets the "daemon" edge to the Daemon entity by id.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) SetName

func (m *UserMutation) SetName(s string)

SetName sets the "name" field.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetProviderID

func (m *UserMutation) SetProviderID(id int)

SetProviderID sets the "provider" edge to the Provider entity by id.

func (*UserMutation) SetSubscribeID

func (m *UserMutation) SetSubscribeID(id int)

SetSubscribeID sets the "subscribe" edge to the Subscribe entity by id.

func (*UserMutation) SubscribeCleared

func (m *UserMutation) SubscribeCleared() bool

SubscribeCleared reports if the "subscribe" edge to the Subscribe entity was cleared.

func (*UserMutation) SubscribeID

func (m *UserMutation) SubscribeID() (id int, exists bool)

SubscribeID returns the "subscribe" edge ID in the mutation.

func (*UserMutation) SubscribeIDs

func (m *UserMutation) SubscribeIDs() (ids []int)

SubscribeIDs returns the "subscribe" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SubscribeID instead. It exists only for internal usage by the builders.

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) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) QueryDaemon

func (uq *UserQuery) QueryDaemon() *DaemonQuery

QueryDaemon chains the current query on the "daemon" edge.

func (*UserQuery) QueryProvider

func (uq *UserQuery) QueryProvider() *ProviderQuery

QueryProvider chains the current query on the "provider" edge.

func (*UserQuery) QuerySubscribe

func (uq *UserQuery) QuerySubscribe() *SubscribeQuery

QuerySubscribe chains the current query on the "subscribe" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.User.Query().
	Select(user.FieldName).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithDaemon

func (uq *UserQuery) WithDaemon(opts ...func(*DaemonQuery)) *UserQuery

WithDaemon tells the query-builder to eager-load the nodes that are connected to the "daemon" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithProvider

func (uq *UserQuery) WithProvider(opts ...func(*ProviderQuery)) *UserQuery

WithProvider tells the query-builder to eager-load the nodes that are connected to the "provider" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithSubscribe

func (uq *UserQuery) WithSubscribe(opts ...func(*SubscribeQuery)) *UserQuery

WithSubscribe tells the query-builder to eager-load the nodes that are connected to the "subscribe" edge. The optional arguments are used to configure the query builder of the edge.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) ClearDaemon

func (uu *UserUpdate) ClearDaemon() *UserUpdate

ClearDaemon clears the "daemon" edge to the Daemon entity.

func (*UserUpdate) ClearProvider

func (uu *UserUpdate) ClearProvider() *UserUpdate

ClearProvider clears the "provider" edge to the Provider entity.

func (*UserUpdate) ClearSubscribe

func (uu *UserUpdate) ClearSubscribe() *UserUpdate

ClearSubscribe clears the "subscribe" edge to the Subscribe entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetActive

func (uu *UserUpdate) SetActive(b bool) *UserUpdate

SetActive sets the "active" field.

func (*UserUpdate) SetDaemon

func (uu *UserUpdate) SetDaemon(d *Daemon) *UserUpdate

SetDaemon sets the "daemon" edge to the Daemon entity.

func (*UserUpdate) SetDaemonID

func (uu *UserUpdate) SetDaemonID(id int) *UserUpdate

SetDaemonID sets the "daemon" edge to the Daemon entity by ID.

func (*UserUpdate) SetName

func (uu *UserUpdate) SetName(s string) *UserUpdate

SetName sets the "name" field.

func (*UserUpdate) SetNillableActive

func (uu *UserUpdate) SetNillableActive(b *bool) *UserUpdate

SetNillableActive sets the "active" field if the given value is not nil.

func (*UserUpdate) SetNillableDaemonID

func (uu *UserUpdate) SetNillableDaemonID(id *int) *UserUpdate

SetNillableDaemonID sets the "daemon" edge to the Daemon entity by ID if the given value is not nil.

func (*UserUpdate) SetNillableName

func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*UserUpdate) SetNillableProviderID

func (uu *UserUpdate) SetNillableProviderID(id *int) *UserUpdate

SetNillableProviderID sets the "provider" edge to the Provider entity by ID if the given value is not nil.

func (*UserUpdate) SetNillableSubscribeID

func (uu *UserUpdate) SetNillableSubscribeID(id *int) *UserUpdate

SetNillableSubscribeID sets the "subscribe" edge to the Subscribe entity by ID if the given value is not nil.

func (*UserUpdate) SetProvider

func (uu *UserUpdate) SetProvider(p *Provider) *UserUpdate

SetProvider sets the "provider" edge to the Provider entity.

func (*UserUpdate) SetProviderID

func (uu *UserUpdate) SetProviderID(id int) *UserUpdate

SetProviderID sets the "provider" edge to the Provider entity by ID.

func (*UserUpdate) SetSubscribe

func (uu *UserUpdate) SetSubscribe(s *Subscribe) *UserUpdate

SetSubscribe sets the "subscribe" edge to the Subscribe entity.

func (*UserUpdate) SetSubscribeID

func (uu *UserUpdate) SetSubscribeID(id int) *UserUpdate

SetSubscribeID sets the "subscribe" edge to the Subscribe entity by ID.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) ClearDaemon

func (uuo *UserUpdateOne) ClearDaemon() *UserUpdateOne

ClearDaemon clears the "daemon" edge to the Daemon entity.

func (*UserUpdateOne) ClearProvider

func (uuo *UserUpdateOne) ClearProvider() *UserUpdateOne

ClearProvider clears the "provider" edge to the Provider entity.

func (*UserUpdateOne) ClearSubscribe

func (uuo *UserUpdateOne) ClearSubscribe() *UserUpdateOne

ClearSubscribe clears the "subscribe" edge to the Subscribe entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetActive

func (uuo *UserUpdateOne) SetActive(b bool) *UserUpdateOne

SetActive sets the "active" field.

func (*UserUpdateOne) SetDaemon

func (uuo *UserUpdateOne) SetDaemon(d *Daemon) *UserUpdateOne

SetDaemon sets the "daemon" edge to the Daemon entity.

func (*UserUpdateOne) SetDaemonID

func (uuo *UserUpdateOne) SetDaemonID(id int) *UserUpdateOne

SetDaemonID sets the "daemon" edge to the Daemon entity by ID.

func (*UserUpdateOne) SetName

func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne

SetName sets the "name" field.

func (*UserUpdateOne) SetNillableActive

func (uuo *UserUpdateOne) SetNillableActive(b *bool) *UserUpdateOne

SetNillableActive sets the "active" field if the given value is not nil.

func (*UserUpdateOne) SetNillableDaemonID

func (uuo *UserUpdateOne) SetNillableDaemonID(id *int) *UserUpdateOne

SetNillableDaemonID sets the "daemon" edge to the Daemon entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillableName

func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*UserUpdateOne) SetNillableProviderID

func (uuo *UserUpdateOne) SetNillableProviderID(id *int) *UserUpdateOne

SetNillableProviderID sets the "provider" edge to the Provider entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillableSubscribeID

func (uuo *UserUpdateOne) SetNillableSubscribeID(id *int) *UserUpdateOne

SetNillableSubscribeID sets the "subscribe" edge to the Subscribe entity by ID if the given value is not nil.

func (*UserUpdateOne) SetProvider

func (uuo *UserUpdateOne) SetProvider(p *Provider) *UserUpdateOne

SetProvider sets the "provider" edge to the Provider entity.

func (*UserUpdateOne) SetProviderID

func (uuo *UserUpdateOne) SetProviderID(id int) *UserUpdateOne

SetProviderID sets the "provider" edge to the Provider entity by ID.

func (*UserUpdateOne) SetSubscribe

func (uuo *UserUpdateOne) SetSubscribe(s *Subscribe) *UserUpdateOne

SetSubscribe sets the "subscribe" edge to the Subscribe entity.

func (*UserUpdateOne) SetSubscribeID

func (uuo *UserUpdateOne) SetSubscribeID(id int) *UserUpdateOne

SetSubscribeID sets the "subscribe" edge to the Subscribe entity by ID.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL