Documentation ¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type Account
- func (a *Account) QueryNodes() *NodeQuery
- func (a *Account) QueryRegistrationToken() *RegistrationTokenQuery
- func (a *Account) QueryServers() *ServerQuery
- func (a *Account) String() string
- func (a *Account) Unwrap() *Account
- func (a *Account) Update() *AccountUpdateOne
- func (a *Account) Value(name string) (ent.Value, error)
- type AccountClient
- func (c *AccountClient) Create() *AccountCreate
- func (c *AccountClient) CreateBulk(builders ...*AccountCreate) *AccountCreateBulk
- func (c *AccountClient) Delete() *AccountDelete
- func (c *AccountClient) DeleteOne(a *Account) *AccountDeleteOne
- func (c *AccountClient) DeleteOneID(id int) *AccountDeleteOne
- func (c *AccountClient) Get(ctx context.Context, id int) (*Account, error)
- func (c *AccountClient) GetX(ctx context.Context, id int) *Account
- func (c *AccountClient) Hooks() []Hook
- func (c *AccountClient) Intercept(interceptors ...Interceptor)
- func (c *AccountClient) Interceptors() []Interceptor
- func (c *AccountClient) MapCreateBulk(slice any, setFunc func(*AccountCreate, int)) *AccountCreateBulk
- func (c *AccountClient) Query() *AccountQuery
- func (c *AccountClient) QueryNodes(a *Account) *NodeQuery
- func (c *AccountClient) QueryRegistrationToken(a *Account) *RegistrationTokenQuery
- func (c *AccountClient) QueryServers(a *Account) *ServerQuery
- func (c *AccountClient) Update() *AccountUpdate
- func (c *AccountClient) UpdateOne(a *Account) *AccountUpdateOne
- func (c *AccountClient) UpdateOneID(id int) *AccountUpdateOne
- func (c *AccountClient) Use(hooks ...Hook)
- type AccountCreate
- func (ac *AccountCreate) AddNodeIDs(ids ...int) *AccountCreate
- func (ac *AccountCreate) AddNodes(n ...*Node) *AccountCreate
- func (ac *AccountCreate) AddServerIDs(ids ...int) *AccountCreate
- func (ac *AccountCreate) AddServers(s ...*Server) *AccountCreate
- func (ac *AccountCreate) Exec(ctx context.Context) error
- func (ac *AccountCreate) ExecX(ctx context.Context)
- func (ac *AccountCreate) Mutation() *AccountMutation
- func (ac *AccountCreate) Save(ctx context.Context) (*Account, error)
- func (ac *AccountCreate) SaveX(ctx context.Context) *Account
- func (ac *AccountCreate) SetAccessToken(b []byte) *AccountCreate
- func (ac *AccountCreate) SetCreateTime(t time.Time) *AccountCreate
- func (ac *AccountCreate) SetNillableCreateTime(t *time.Time) *AccountCreate
- func (ac *AccountCreate) SetNillableRegistrationTokenID(i *int) *AccountCreate
- func (ac *AccountCreate) SetNillableUpdateTime(t *time.Time) *AccountCreate
- func (ac *AccountCreate) SetRefreshToken(b []byte) *AccountCreate
- func (ac *AccountCreate) SetRegistrationToken(r *RegistrationToken) *AccountCreate
- func (ac *AccountCreate) SetRegistrationTokenID(i int) *AccountCreate
- func (ac *AccountCreate) SetUpdateTime(t time.Time) *AccountCreate
- func (ac *AccountCreate) SetUsername(s string) *AccountCreate
- type AccountCreateBulk
- type AccountDelete
- type AccountDeleteOne
- type AccountEdges
- type AccountGroupBy
- func (agb *AccountGroupBy) Aggregate(fns ...AggregateFunc) *AccountGroupBy
- func (s *AccountGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *AccountGroupBy) BoolX(ctx context.Context) bool
- func (s *AccountGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *AccountGroupBy) BoolsX(ctx context.Context) []bool
- func (s *AccountGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *AccountGroupBy) Float64X(ctx context.Context) float64
- func (s *AccountGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *AccountGroupBy) Float64sX(ctx context.Context) []float64
- func (s *AccountGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *AccountGroupBy) IntX(ctx context.Context) int
- func (s *AccountGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *AccountGroupBy) IntsX(ctx context.Context) []int
- func (agb *AccountGroupBy) Scan(ctx context.Context, v any) error
- func (s *AccountGroupBy) ScanX(ctx context.Context, v any)
- func (s *AccountGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *AccountGroupBy) StringX(ctx context.Context) string
- func (s *AccountGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *AccountGroupBy) StringsX(ctx context.Context) []string
- type AccountMutation
- func (m *AccountMutation) AccessToken() (r []byte, exists bool)
- func (m *AccountMutation) AddField(name string, value ent.Value) error
- func (m *AccountMutation) AddNodeIDs(ids ...int)
- func (m *AccountMutation) AddServerIDs(ids ...int)
- func (m *AccountMutation) AddedEdges() []string
- func (m *AccountMutation) AddedField(name string) (ent.Value, bool)
- func (m *AccountMutation) AddedFields() []string
- func (m *AccountMutation) AddedIDs(name string) []ent.Value
- func (m *AccountMutation) ClearEdge(name string) error
- func (m *AccountMutation) ClearField(name string) error
- func (m *AccountMutation) ClearNodes()
- func (m *AccountMutation) ClearRegistrationToken()
- func (m *AccountMutation) ClearRegistrationTokenID()
- func (m *AccountMutation) ClearServers()
- func (m *AccountMutation) ClearedEdges() []string
- func (m *AccountMutation) ClearedFields() []string
- func (m AccountMutation) Client() *Client
- func (m *AccountMutation) CreateTime() (r time.Time, exists bool)
- func (m *AccountMutation) EdgeCleared(name string) bool
- func (m *AccountMutation) Field(name string) (ent.Value, bool)
- func (m *AccountMutation) FieldCleared(name string) bool
- func (m *AccountMutation) Fields() []string
- func (m *AccountMutation) ID() (id int, exists bool)
- func (m *AccountMutation) IDs(ctx context.Context) ([]int, error)
- func (m *AccountMutation) NodesCleared() bool
- func (m *AccountMutation) NodesIDs() (ids []int)
- func (m *AccountMutation) OldAccessToken(ctx context.Context) (v []byte, err error)
- func (m *AccountMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *AccountMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *AccountMutation) OldRefreshToken(ctx context.Context) (v []byte, err error)
- func (m *AccountMutation) OldRegistrationTokenID(ctx context.Context) (v int, err error)
- func (m *AccountMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *AccountMutation) OldUsername(ctx context.Context) (v string, err error)
- func (m *AccountMutation) Op() Op
- func (m *AccountMutation) RefreshToken() (r []byte, exists bool)
- func (m *AccountMutation) RegistrationTokenCleared() bool
- func (m *AccountMutation) RegistrationTokenID() (r int, exists bool)
- func (m *AccountMutation) RegistrationTokenIDCleared() bool
- func (m *AccountMutation) RegistrationTokenIDs() (ids []int)
- func (m *AccountMutation) RemoveNodeIDs(ids ...int)
- func (m *AccountMutation) RemoveServerIDs(ids ...int)
- func (m *AccountMutation) RemovedEdges() []string
- func (m *AccountMutation) RemovedIDs(name string) []ent.Value
- func (m *AccountMutation) RemovedNodesIDs() (ids []int)
- func (m *AccountMutation) RemovedServersIDs() (ids []int)
- func (m *AccountMutation) ResetAccessToken()
- func (m *AccountMutation) ResetCreateTime()
- func (m *AccountMutation) ResetEdge(name string) error
- func (m *AccountMutation) ResetField(name string) error
- func (m *AccountMutation) ResetNodes()
- func (m *AccountMutation) ResetRefreshToken()
- func (m *AccountMutation) ResetRegistrationToken()
- func (m *AccountMutation) ResetRegistrationTokenID()
- func (m *AccountMutation) ResetServers()
- func (m *AccountMutation) ResetUpdateTime()
- func (m *AccountMutation) ResetUsername()
- func (m *AccountMutation) ServersCleared() bool
- func (m *AccountMutation) ServersIDs() (ids []int)
- func (m *AccountMutation) SetAccessToken(b []byte)
- func (m *AccountMutation) SetCreateTime(t time.Time)
- func (m *AccountMutation) SetField(name string, value ent.Value) error
- func (m *AccountMutation) SetOp(op Op)
- func (m *AccountMutation) SetRefreshToken(b []byte)
- func (m *AccountMutation) SetRegistrationTokenID(i int)
- func (m *AccountMutation) SetUpdateTime(t time.Time)
- func (m *AccountMutation) SetUsername(s string)
- func (m AccountMutation) Tx() (*Tx, error)
- func (m *AccountMutation) Type() string
- func (m *AccountMutation) UpdateTime() (r time.Time, exists bool)
- func (m *AccountMutation) Username() (r string, exists bool)
- func (m *AccountMutation) Where(ps ...predicate.Account)
- func (m *AccountMutation) WhereP(ps ...func(*sql.Selector))
- type AccountQuery
- func (aq *AccountQuery) Aggregate(fns ...AggregateFunc) *AccountSelect
- func (aq *AccountQuery) All(ctx context.Context) ([]*Account, error)
- func (aq *AccountQuery) AllX(ctx context.Context) []*Account
- func (aq *AccountQuery) Clone() *AccountQuery
- func (aq *AccountQuery) Count(ctx context.Context) (int, error)
- func (aq *AccountQuery) CountX(ctx context.Context) int
- func (aq *AccountQuery) Exist(ctx context.Context) (bool, error)
- func (aq *AccountQuery) ExistX(ctx context.Context) bool
- func (aq *AccountQuery) First(ctx context.Context) (*Account, error)
- func (aq *AccountQuery) FirstID(ctx context.Context) (id int, err error)
- func (aq *AccountQuery) FirstIDX(ctx context.Context) int
- func (aq *AccountQuery) FirstX(ctx context.Context) *Account
- func (aq *AccountQuery) GroupBy(field string, fields ...string) *AccountGroupBy
- func (aq *AccountQuery) IDs(ctx context.Context) (ids []int, err error)
- func (aq *AccountQuery) IDsX(ctx context.Context) []int
- func (aq *AccountQuery) Limit(limit int) *AccountQuery
- func (aq *AccountQuery) Offset(offset int) *AccountQuery
- func (aq *AccountQuery) Only(ctx context.Context) (*Account, error)
- func (aq *AccountQuery) OnlyID(ctx context.Context) (id int, err error)
- func (aq *AccountQuery) OnlyIDX(ctx context.Context) int
- func (aq *AccountQuery) OnlyX(ctx context.Context) *Account
- func (aq *AccountQuery) Order(o ...account.OrderOption) *AccountQuery
- func (aq *AccountQuery) QueryNodes() *NodeQuery
- func (aq *AccountQuery) QueryRegistrationToken() *RegistrationTokenQuery
- func (aq *AccountQuery) QueryServers() *ServerQuery
- func (aq *AccountQuery) Select(fields ...string) *AccountSelect
- func (aq *AccountQuery) Unique(unique bool) *AccountQuery
- func (aq *AccountQuery) Where(ps ...predicate.Account) *AccountQuery
- func (aq *AccountQuery) WithNodes(opts ...func(*NodeQuery)) *AccountQuery
- func (aq *AccountQuery) WithRegistrationToken(opts ...func(*RegistrationTokenQuery)) *AccountQuery
- func (aq *AccountQuery) WithServers(opts ...func(*ServerQuery)) *AccountQuery
- type AccountSelect
- func (as *AccountSelect) Aggregate(fns ...AggregateFunc) *AccountSelect
- func (s *AccountSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *AccountSelect) BoolX(ctx context.Context) bool
- func (s *AccountSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *AccountSelect) BoolsX(ctx context.Context) []bool
- func (s *AccountSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *AccountSelect) Float64X(ctx context.Context) float64
- func (s *AccountSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *AccountSelect) Float64sX(ctx context.Context) []float64
- func (s *AccountSelect) Int(ctx context.Context) (_ int, err error)
- func (s *AccountSelect) IntX(ctx context.Context) int
- func (s *AccountSelect) Ints(ctx context.Context) ([]int, error)
- func (s *AccountSelect) IntsX(ctx context.Context) []int
- func (as *AccountSelect) Scan(ctx context.Context, v any) error
- func (s *AccountSelect) ScanX(ctx context.Context, v any)
- func (s *AccountSelect) String(ctx context.Context) (_ string, err error)
- func (s *AccountSelect) StringX(ctx context.Context) string
- func (s *AccountSelect) Strings(ctx context.Context) ([]string, error)
- func (s *AccountSelect) StringsX(ctx context.Context) []string
- type AccountUpdate
- func (au *AccountUpdate) AddNodeIDs(ids ...int) *AccountUpdate
- func (au *AccountUpdate) AddNodes(n ...*Node) *AccountUpdate
- func (au *AccountUpdate) AddServerIDs(ids ...int) *AccountUpdate
- func (au *AccountUpdate) AddServers(s ...*Server) *AccountUpdate
- func (au *AccountUpdate) ClearNodes() *AccountUpdate
- func (au *AccountUpdate) ClearRegistrationToken() *AccountUpdate
- func (au *AccountUpdate) ClearRegistrationTokenID() *AccountUpdate
- func (au *AccountUpdate) ClearServers() *AccountUpdate
- func (au *AccountUpdate) Exec(ctx context.Context) error
- func (au *AccountUpdate) ExecX(ctx context.Context)
- func (au *AccountUpdate) Mutation() *AccountMutation
- func (au *AccountUpdate) RemoveNodeIDs(ids ...int) *AccountUpdate
- func (au *AccountUpdate) RemoveNodes(n ...*Node) *AccountUpdate
- func (au *AccountUpdate) RemoveServerIDs(ids ...int) *AccountUpdate
- func (au *AccountUpdate) RemoveServers(s ...*Server) *AccountUpdate
- func (au *AccountUpdate) Save(ctx context.Context) (int, error)
- func (au *AccountUpdate) SaveX(ctx context.Context) int
- func (au *AccountUpdate) SetAccessToken(b []byte) *AccountUpdate
- func (au *AccountUpdate) SetNillableRegistrationTokenID(i *int) *AccountUpdate
- func (au *AccountUpdate) SetNillableUsername(s *string) *AccountUpdate
- func (au *AccountUpdate) SetRefreshToken(b []byte) *AccountUpdate
- func (au *AccountUpdate) SetRegistrationToken(r *RegistrationToken) *AccountUpdate
- func (au *AccountUpdate) SetRegistrationTokenID(i int) *AccountUpdate
- func (au *AccountUpdate) SetUpdateTime(t time.Time) *AccountUpdate
- func (au *AccountUpdate) SetUsername(s string) *AccountUpdate
- func (au *AccountUpdate) Where(ps ...predicate.Account) *AccountUpdate
- type AccountUpdateOne
- func (auo *AccountUpdateOne) AddNodeIDs(ids ...int) *AccountUpdateOne
- func (auo *AccountUpdateOne) AddNodes(n ...*Node) *AccountUpdateOne
- func (auo *AccountUpdateOne) AddServerIDs(ids ...int) *AccountUpdateOne
- func (auo *AccountUpdateOne) AddServers(s ...*Server) *AccountUpdateOne
- func (auo *AccountUpdateOne) ClearNodes() *AccountUpdateOne
- func (auo *AccountUpdateOne) ClearRegistrationToken() *AccountUpdateOne
- func (auo *AccountUpdateOne) ClearRegistrationTokenID() *AccountUpdateOne
- func (auo *AccountUpdateOne) ClearServers() *AccountUpdateOne
- func (auo *AccountUpdateOne) Exec(ctx context.Context) error
- func (auo *AccountUpdateOne) ExecX(ctx context.Context)
- func (auo *AccountUpdateOne) Mutation() *AccountMutation
- func (auo *AccountUpdateOne) RemoveNodeIDs(ids ...int) *AccountUpdateOne
- func (auo *AccountUpdateOne) RemoveNodes(n ...*Node) *AccountUpdateOne
- func (auo *AccountUpdateOne) RemoveServerIDs(ids ...int) *AccountUpdateOne
- func (auo *AccountUpdateOne) RemoveServers(s ...*Server) *AccountUpdateOne
- func (auo *AccountUpdateOne) Save(ctx context.Context) (*Account, error)
- func (auo *AccountUpdateOne) SaveX(ctx context.Context) *Account
- func (auo *AccountUpdateOne) Select(field string, fields ...string) *AccountUpdateOne
- func (auo *AccountUpdateOne) SetAccessToken(b []byte) *AccountUpdateOne
- func (auo *AccountUpdateOne) SetNillableRegistrationTokenID(i *int) *AccountUpdateOne
- func (auo *AccountUpdateOne) SetNillableUsername(s *string) *AccountUpdateOne
- func (auo *AccountUpdateOne) SetRefreshToken(b []byte) *AccountUpdateOne
- func (auo *AccountUpdateOne) SetRegistrationToken(r *RegistrationToken) *AccountUpdateOne
- func (auo *AccountUpdateOne) SetRegistrationTokenID(i int) *AccountUpdateOne
- func (auo *AccountUpdateOne) SetUpdateTime(t time.Time) *AccountUpdateOne
- func (auo *AccountUpdateOne) SetUsername(s string) *AccountUpdateOne
- func (auo *AccountUpdateOne) Where(ps ...predicate.Account) *AccountUpdateOne
- type Accounts
- type AggregateFunc
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type Node
- type NodeClient
- func (c *NodeClient) Create() *NodeCreate
- func (c *NodeClient) CreateBulk(builders ...*NodeCreate) *NodeCreateBulk
- func (c *NodeClient) Delete() *NodeDelete
- func (c *NodeClient) DeleteOne(n *Node) *NodeDeleteOne
- func (c *NodeClient) DeleteOneID(id int) *NodeDeleteOne
- func (c *NodeClient) Get(ctx context.Context, id int) (*Node, error)
- func (c *NodeClient) GetX(ctx context.Context, id int) *Node
- func (c *NodeClient) Hooks() []Hook
- func (c *NodeClient) Intercept(interceptors ...Interceptor)
- func (c *NodeClient) Interceptors() []Interceptor
- func (c *NodeClient) MapCreateBulk(slice any, setFunc func(*NodeCreate, int)) *NodeCreateBulk
- func (c *NodeClient) Query() *NodeQuery
- func (c *NodeClient) QueryAccount(n *Node) *AccountQuery
- func (c *NodeClient) QueryServer(n *Node) *ServerQuery
- func (c *NodeClient) Update() *NodeUpdate
- func (c *NodeClient) UpdateOne(n *Node) *NodeUpdateOne
- func (c *NodeClient) UpdateOneID(id int) *NodeUpdateOne
- func (c *NodeClient) Use(hooks ...Hook)
- type NodeCreate
- func (nc *NodeCreate) Exec(ctx context.Context) error
- func (nc *NodeCreate) ExecX(ctx context.Context)
- func (nc *NodeCreate) Mutation() *NodeMutation
- func (nc *NodeCreate) Save(ctx context.Context) (*Node, error)
- func (nc *NodeCreate) SaveX(ctx context.Context) *Node
- func (nc *NodeCreate) SetAccount(a *Account) *NodeCreate
- func (nc *NodeCreate) SetAccountID(id int) *NodeCreate
- func (nc *NodeCreate) SetCreateTime(t time.Time) *NodeCreate
- func (nc *NodeCreate) SetName(s string) *NodeCreate
- func (nc *NodeCreate) SetNillableCreateTime(t *time.Time) *NodeCreate
- func (nc *NodeCreate) SetNillableUpdateTime(t *time.Time) *NodeCreate
- func (nc *NodeCreate) SetServer(s *Server) *NodeCreate
- func (nc *NodeCreate) SetServerID(id int) *NodeCreate
- func (nc *NodeCreate) SetUpdateTime(t time.Time) *NodeCreate
- type NodeCreateBulk
- type NodeDelete
- type NodeDeleteOne
- type NodeEdges
- type NodeGroupBy
- func (ngb *NodeGroupBy) Aggregate(fns ...AggregateFunc) *NodeGroupBy
- func (s *NodeGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *NodeGroupBy) BoolX(ctx context.Context) bool
- func (s *NodeGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *NodeGroupBy) BoolsX(ctx context.Context) []bool
- func (s *NodeGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *NodeGroupBy) Float64X(ctx context.Context) float64
- func (s *NodeGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *NodeGroupBy) Float64sX(ctx context.Context) []float64
- func (s *NodeGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *NodeGroupBy) IntX(ctx context.Context) int
- func (s *NodeGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *NodeGroupBy) IntsX(ctx context.Context) []int
- func (ngb *NodeGroupBy) Scan(ctx context.Context, v any) error
- func (s *NodeGroupBy) ScanX(ctx context.Context, v any)
- func (s *NodeGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *NodeGroupBy) StringX(ctx context.Context) string
- func (s *NodeGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *NodeGroupBy) StringsX(ctx context.Context) []string
- type NodeMutation
- func (m *NodeMutation) AccountCleared() bool
- func (m *NodeMutation) AccountID() (id int, exists bool)
- func (m *NodeMutation) AccountIDs() (ids []int)
- func (m *NodeMutation) AddField(name string, value ent.Value) error
- func (m *NodeMutation) AddedEdges() []string
- func (m *NodeMutation) AddedField(name string) (ent.Value, bool)
- func (m *NodeMutation) AddedFields() []string
- func (m *NodeMutation) AddedIDs(name string) []ent.Value
- func (m *NodeMutation) ClearAccount()
- func (m *NodeMutation) ClearEdge(name string) error
- func (m *NodeMutation) ClearField(name string) error
- func (m *NodeMutation) ClearServer()
- func (m *NodeMutation) ClearedEdges() []string
- func (m *NodeMutation) ClearedFields() []string
- func (m NodeMutation) Client() *Client
- func (m *NodeMutation) CreateTime() (r time.Time, exists bool)
- func (m *NodeMutation) EdgeCleared(name string) bool
- func (m *NodeMutation) Field(name string) (ent.Value, bool)
- func (m *NodeMutation) FieldCleared(name string) bool
- func (m *NodeMutation) Fields() []string
- func (m *NodeMutation) ID() (id int, exists bool)
- func (m *NodeMutation) IDs(ctx context.Context) ([]int, error)
- func (m *NodeMutation) Name() (r string, exists bool)
- func (m *NodeMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *NodeMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *NodeMutation) OldName(ctx context.Context) (v string, err error)
- func (m *NodeMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *NodeMutation) Op() Op
- func (m *NodeMutation) RemovedEdges() []string
- func (m *NodeMutation) RemovedIDs(name string) []ent.Value
- func (m *NodeMutation) ResetAccount()
- func (m *NodeMutation) ResetCreateTime()
- func (m *NodeMutation) ResetEdge(name string) error
- func (m *NodeMutation) ResetField(name string) error
- func (m *NodeMutation) ResetName()
- func (m *NodeMutation) ResetServer()
- func (m *NodeMutation) ResetUpdateTime()
- func (m *NodeMutation) ServerCleared() bool
- func (m *NodeMutation) ServerID() (id int, exists bool)
- func (m *NodeMutation) ServerIDs() (ids []int)
- func (m *NodeMutation) SetAccountID(id int)
- func (m *NodeMutation) SetCreateTime(t time.Time)
- func (m *NodeMutation) SetField(name string, value ent.Value) error
- func (m *NodeMutation) SetName(s string)
- func (m *NodeMutation) SetOp(op Op)
- func (m *NodeMutation) SetServerID(id int)
- func (m *NodeMutation) SetUpdateTime(t time.Time)
- func (m NodeMutation) Tx() (*Tx, error)
- func (m *NodeMutation) Type() string
- func (m *NodeMutation) UpdateTime() (r time.Time, exists bool)
- func (m *NodeMutation) Where(ps ...predicate.Node)
- func (m *NodeMutation) WhereP(ps ...func(*sql.Selector))
- type NodeQuery
- func (nq *NodeQuery) Aggregate(fns ...AggregateFunc) *NodeSelect
- func (nq *NodeQuery) All(ctx context.Context) ([]*Node, error)
- func (nq *NodeQuery) AllX(ctx context.Context) []*Node
- func (nq *NodeQuery) Clone() *NodeQuery
- func (nq *NodeQuery) Count(ctx context.Context) (int, error)
- func (nq *NodeQuery) CountX(ctx context.Context) int
- func (nq *NodeQuery) Exist(ctx context.Context) (bool, error)
- func (nq *NodeQuery) ExistX(ctx context.Context) bool
- func (nq *NodeQuery) First(ctx context.Context) (*Node, error)
- func (nq *NodeQuery) FirstID(ctx context.Context) (id int, err error)
- func (nq *NodeQuery) FirstIDX(ctx context.Context) int
- func (nq *NodeQuery) FirstX(ctx context.Context) *Node
- func (nq *NodeQuery) GroupBy(field string, fields ...string) *NodeGroupBy
- func (nq *NodeQuery) IDs(ctx context.Context) (ids []int, err error)
- func (nq *NodeQuery) IDsX(ctx context.Context) []int
- func (nq *NodeQuery) Limit(limit int) *NodeQuery
- func (nq *NodeQuery) Offset(offset int) *NodeQuery
- func (nq *NodeQuery) Only(ctx context.Context) (*Node, error)
- func (nq *NodeQuery) OnlyID(ctx context.Context) (id int, err error)
- func (nq *NodeQuery) OnlyIDX(ctx context.Context) int
- func (nq *NodeQuery) OnlyX(ctx context.Context) *Node
- func (nq *NodeQuery) Order(o ...node.OrderOption) *NodeQuery
- func (nq *NodeQuery) QueryAccount() *AccountQuery
- func (nq *NodeQuery) QueryServer() *ServerQuery
- func (nq *NodeQuery) Select(fields ...string) *NodeSelect
- func (nq *NodeQuery) Unique(unique bool) *NodeQuery
- func (nq *NodeQuery) Where(ps ...predicate.Node) *NodeQuery
- func (nq *NodeQuery) WithAccount(opts ...func(*AccountQuery)) *NodeQuery
- func (nq *NodeQuery) WithServer(opts ...func(*ServerQuery)) *NodeQuery
- type NodeSelect
- func (ns *NodeSelect) Aggregate(fns ...AggregateFunc) *NodeSelect
- func (s *NodeSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *NodeSelect) BoolX(ctx context.Context) bool
- func (s *NodeSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *NodeSelect) BoolsX(ctx context.Context) []bool
- func (s *NodeSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *NodeSelect) Float64X(ctx context.Context) float64
- func (s *NodeSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *NodeSelect) Float64sX(ctx context.Context) []float64
- func (s *NodeSelect) Int(ctx context.Context) (_ int, err error)
- func (s *NodeSelect) IntX(ctx context.Context) int
- func (s *NodeSelect) Ints(ctx context.Context) ([]int, error)
- func (s *NodeSelect) IntsX(ctx context.Context) []int
- func (ns *NodeSelect) Scan(ctx context.Context, v any) error
- func (s *NodeSelect) ScanX(ctx context.Context, v any)
- func (s *NodeSelect) String(ctx context.Context) (_ string, err error)
- func (s *NodeSelect) StringX(ctx context.Context) string
- func (s *NodeSelect) Strings(ctx context.Context) ([]string, error)
- func (s *NodeSelect) StringsX(ctx context.Context) []string
- type NodeUpdate
- func (nu *NodeUpdate) ClearAccount() *NodeUpdate
- func (nu *NodeUpdate) ClearServer() *NodeUpdate
- func (nu *NodeUpdate) Exec(ctx context.Context) error
- func (nu *NodeUpdate) ExecX(ctx context.Context)
- func (nu *NodeUpdate) Mutation() *NodeMutation
- func (nu *NodeUpdate) Save(ctx context.Context) (int, error)
- func (nu *NodeUpdate) SaveX(ctx context.Context) int
- func (nu *NodeUpdate) SetAccount(a *Account) *NodeUpdate
- func (nu *NodeUpdate) SetAccountID(id int) *NodeUpdate
- func (nu *NodeUpdate) SetName(s string) *NodeUpdate
- func (nu *NodeUpdate) SetNillableName(s *string) *NodeUpdate
- func (nu *NodeUpdate) SetServer(s *Server) *NodeUpdate
- func (nu *NodeUpdate) SetServerID(id int) *NodeUpdate
- func (nu *NodeUpdate) SetUpdateTime(t time.Time) *NodeUpdate
- func (nu *NodeUpdate) Where(ps ...predicate.Node) *NodeUpdate
- type NodeUpdateOne
- func (nuo *NodeUpdateOne) ClearAccount() *NodeUpdateOne
- func (nuo *NodeUpdateOne) ClearServer() *NodeUpdateOne
- func (nuo *NodeUpdateOne) Exec(ctx context.Context) error
- func (nuo *NodeUpdateOne) ExecX(ctx context.Context)
- func (nuo *NodeUpdateOne) Mutation() *NodeMutation
- func (nuo *NodeUpdateOne) Save(ctx context.Context) (*Node, error)
- func (nuo *NodeUpdateOne) SaveX(ctx context.Context) *Node
- func (nuo *NodeUpdateOne) Select(field string, fields ...string) *NodeUpdateOne
- func (nuo *NodeUpdateOne) SetAccount(a *Account) *NodeUpdateOne
- func (nuo *NodeUpdateOne) SetAccountID(id int) *NodeUpdateOne
- func (nuo *NodeUpdateOne) SetName(s string) *NodeUpdateOne
- func (nuo *NodeUpdateOne) SetNillableName(s *string) *NodeUpdateOne
- func (nuo *NodeUpdateOne) SetServer(s *Server) *NodeUpdateOne
- func (nuo *NodeUpdateOne) SetServerID(id int) *NodeUpdateOne
- func (nuo *NodeUpdateOne) SetUpdateTime(t time.Time) *NodeUpdateOne
- func (nuo *NodeUpdateOne) Where(ps ...predicate.Node) *NodeUpdateOne
- type Nodes
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RegistrationToken
- type RegistrationTokenClient
- func (c *RegistrationTokenClient) Create() *RegistrationTokenCreate
- func (c *RegistrationTokenClient) CreateBulk(builders ...*RegistrationTokenCreate) *RegistrationTokenCreateBulk
- func (c *RegistrationTokenClient) Delete() *RegistrationTokenDelete
- func (c *RegistrationTokenClient) DeleteOne(rt *RegistrationToken) *RegistrationTokenDeleteOne
- func (c *RegistrationTokenClient) DeleteOneID(id int) *RegistrationTokenDeleteOne
- func (c *RegistrationTokenClient) Get(ctx context.Context, id int) (*RegistrationToken, error)
- func (c *RegistrationTokenClient) GetX(ctx context.Context, id int) *RegistrationToken
- func (c *RegistrationTokenClient) Hooks() []Hook
- func (c *RegistrationTokenClient) Intercept(interceptors ...Interceptor)
- func (c *RegistrationTokenClient) Interceptors() []Interceptor
- func (c *RegistrationTokenClient) MapCreateBulk(slice any, setFunc func(*RegistrationTokenCreate, int)) *RegistrationTokenCreateBulk
- func (c *RegistrationTokenClient) Query() *RegistrationTokenQuery
- func (c *RegistrationTokenClient) QueryRegistrations(rt *RegistrationToken) *AccountQuery
- func (c *RegistrationTokenClient) Update() *RegistrationTokenUpdate
- func (c *RegistrationTokenClient) UpdateOne(rt *RegistrationToken) *RegistrationTokenUpdateOne
- func (c *RegistrationTokenClient) UpdateOneID(id int) *RegistrationTokenUpdateOne
- func (c *RegistrationTokenClient) Use(hooks ...Hook)
- type RegistrationTokenCreate
- func (rtc *RegistrationTokenCreate) AddRegistrationIDs(ids ...int) *RegistrationTokenCreate
- func (rtc *RegistrationTokenCreate) AddRegistrations(a ...*Account) *RegistrationTokenCreate
- func (rtc *RegistrationTokenCreate) Exec(ctx context.Context) error
- func (rtc *RegistrationTokenCreate) ExecX(ctx context.Context)
- func (rtc *RegistrationTokenCreate) Mutation() *RegistrationTokenMutation
- func (rtc *RegistrationTokenCreate) Save(ctx context.Context) (*RegistrationToken, error)
- func (rtc *RegistrationTokenCreate) SaveX(ctx context.Context) *RegistrationToken
- func (rtc *RegistrationTokenCreate) SetCreateTime(t time.Time) *RegistrationTokenCreate
- func (rtc *RegistrationTokenCreate) SetName(s string) *RegistrationTokenCreate
- func (rtc *RegistrationTokenCreate) SetNillableCreateTime(t *time.Time) *RegistrationTokenCreate
- func (rtc *RegistrationTokenCreate) SetNillableUpdateTime(t *time.Time) *RegistrationTokenCreate
- func (rtc *RegistrationTokenCreate) SetToken(b []byte) *RegistrationTokenCreate
- func (rtc *RegistrationTokenCreate) SetUpdateTime(t time.Time) *RegistrationTokenCreate
- type RegistrationTokenCreateBulk
- func (rtcb *RegistrationTokenCreateBulk) Exec(ctx context.Context) error
- func (rtcb *RegistrationTokenCreateBulk) ExecX(ctx context.Context)
- func (rtcb *RegistrationTokenCreateBulk) Save(ctx context.Context) ([]*RegistrationToken, error)
- func (rtcb *RegistrationTokenCreateBulk) SaveX(ctx context.Context) []*RegistrationToken
- type RegistrationTokenDelete
- type RegistrationTokenDeleteOne
- type RegistrationTokenEdges
- type RegistrationTokenGroupBy
- func (rtgb *RegistrationTokenGroupBy) Aggregate(fns ...AggregateFunc) *RegistrationTokenGroupBy
- func (s *RegistrationTokenGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *RegistrationTokenGroupBy) BoolX(ctx context.Context) bool
- func (s *RegistrationTokenGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *RegistrationTokenGroupBy) BoolsX(ctx context.Context) []bool
- func (s *RegistrationTokenGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *RegistrationTokenGroupBy) Float64X(ctx context.Context) float64
- func (s *RegistrationTokenGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *RegistrationTokenGroupBy) Float64sX(ctx context.Context) []float64
- func (s *RegistrationTokenGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *RegistrationTokenGroupBy) IntX(ctx context.Context) int
- func (s *RegistrationTokenGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *RegistrationTokenGroupBy) IntsX(ctx context.Context) []int
- func (rtgb *RegistrationTokenGroupBy) Scan(ctx context.Context, v any) error
- func (s *RegistrationTokenGroupBy) ScanX(ctx context.Context, v any)
- func (s *RegistrationTokenGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *RegistrationTokenGroupBy) StringX(ctx context.Context) string
- func (s *RegistrationTokenGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *RegistrationTokenGroupBy) StringsX(ctx context.Context) []string
- type RegistrationTokenMutation
- func (m *RegistrationTokenMutation) AddField(name string, value ent.Value) error
- func (m *RegistrationTokenMutation) AddRegistrationIDs(ids ...int)
- func (m *RegistrationTokenMutation) AddedEdges() []string
- func (m *RegistrationTokenMutation) AddedField(name string) (ent.Value, bool)
- func (m *RegistrationTokenMutation) AddedFields() []string
- func (m *RegistrationTokenMutation) AddedIDs(name string) []ent.Value
- func (m *RegistrationTokenMutation) ClearEdge(name string) error
- func (m *RegistrationTokenMutation) ClearField(name string) error
- func (m *RegistrationTokenMutation) ClearRegistrations()
- func (m *RegistrationTokenMutation) ClearedEdges() []string
- func (m *RegistrationTokenMutation) ClearedFields() []string
- func (m RegistrationTokenMutation) Client() *Client
- func (m *RegistrationTokenMutation) CreateTime() (r time.Time, exists bool)
- func (m *RegistrationTokenMutation) EdgeCleared(name string) bool
- func (m *RegistrationTokenMutation) Field(name string) (ent.Value, bool)
- func (m *RegistrationTokenMutation) FieldCleared(name string) bool
- func (m *RegistrationTokenMutation) Fields() []string
- func (m *RegistrationTokenMutation) ID() (id int, exists bool)
- func (m *RegistrationTokenMutation) IDs(ctx context.Context) ([]int, error)
- func (m *RegistrationTokenMutation) Name() (r string, exists bool)
- func (m *RegistrationTokenMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *RegistrationTokenMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *RegistrationTokenMutation) OldName(ctx context.Context) (v string, err error)
- func (m *RegistrationTokenMutation) OldToken(ctx context.Context) (v []byte, err error)
- func (m *RegistrationTokenMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *RegistrationTokenMutation) Op() Op
- func (m *RegistrationTokenMutation) RegistrationsCleared() bool
- func (m *RegistrationTokenMutation) RegistrationsIDs() (ids []int)
- func (m *RegistrationTokenMutation) RemoveRegistrationIDs(ids ...int)
- func (m *RegistrationTokenMutation) RemovedEdges() []string
- func (m *RegistrationTokenMutation) RemovedIDs(name string) []ent.Value
- func (m *RegistrationTokenMutation) RemovedRegistrationsIDs() (ids []int)
- func (m *RegistrationTokenMutation) ResetCreateTime()
- func (m *RegistrationTokenMutation) ResetEdge(name string) error
- func (m *RegistrationTokenMutation) ResetField(name string) error
- func (m *RegistrationTokenMutation) ResetName()
- func (m *RegistrationTokenMutation) ResetRegistrations()
- func (m *RegistrationTokenMutation) ResetToken()
- func (m *RegistrationTokenMutation) ResetUpdateTime()
- func (m *RegistrationTokenMutation) SetCreateTime(t time.Time)
- func (m *RegistrationTokenMutation) SetField(name string, value ent.Value) error
- func (m *RegistrationTokenMutation) SetName(s string)
- func (m *RegistrationTokenMutation) SetOp(op Op)
- func (m *RegistrationTokenMutation) SetToken(b []byte)
- func (m *RegistrationTokenMutation) SetUpdateTime(t time.Time)
- func (m *RegistrationTokenMutation) Token() (r []byte, exists bool)
- func (m RegistrationTokenMutation) Tx() (*Tx, error)
- func (m *RegistrationTokenMutation) Type() string
- func (m *RegistrationTokenMutation) UpdateTime() (r time.Time, exists bool)
- func (m *RegistrationTokenMutation) Where(ps ...predicate.RegistrationToken)
- func (m *RegistrationTokenMutation) WhereP(ps ...func(*sql.Selector))
- type RegistrationTokenQuery
- func (rtq *RegistrationTokenQuery) Aggregate(fns ...AggregateFunc) *RegistrationTokenSelect
- func (rtq *RegistrationTokenQuery) All(ctx context.Context) ([]*RegistrationToken, error)
- func (rtq *RegistrationTokenQuery) AllX(ctx context.Context) []*RegistrationToken
- func (rtq *RegistrationTokenQuery) Clone() *RegistrationTokenQuery
- func (rtq *RegistrationTokenQuery) Count(ctx context.Context) (int, error)
- func (rtq *RegistrationTokenQuery) CountX(ctx context.Context) int
- func (rtq *RegistrationTokenQuery) Exist(ctx context.Context) (bool, error)
- func (rtq *RegistrationTokenQuery) ExistX(ctx context.Context) bool
- func (rtq *RegistrationTokenQuery) First(ctx context.Context) (*RegistrationToken, error)
- func (rtq *RegistrationTokenQuery) FirstID(ctx context.Context) (id int, err error)
- func (rtq *RegistrationTokenQuery) FirstIDX(ctx context.Context) int
- func (rtq *RegistrationTokenQuery) FirstX(ctx context.Context) *RegistrationToken
- func (rtq *RegistrationTokenQuery) GroupBy(field string, fields ...string) *RegistrationTokenGroupBy
- func (rtq *RegistrationTokenQuery) IDs(ctx context.Context) (ids []int, err error)
- func (rtq *RegistrationTokenQuery) IDsX(ctx context.Context) []int
- func (rtq *RegistrationTokenQuery) Limit(limit int) *RegistrationTokenQuery
- func (rtq *RegistrationTokenQuery) Offset(offset int) *RegistrationTokenQuery
- func (rtq *RegistrationTokenQuery) Only(ctx context.Context) (*RegistrationToken, error)
- func (rtq *RegistrationTokenQuery) OnlyID(ctx context.Context) (id int, err error)
- func (rtq *RegistrationTokenQuery) OnlyIDX(ctx context.Context) int
- func (rtq *RegistrationTokenQuery) OnlyX(ctx context.Context) *RegistrationToken
- func (rtq *RegistrationTokenQuery) Order(o ...registrationtoken.OrderOption) *RegistrationTokenQuery
- func (rtq *RegistrationTokenQuery) QueryRegistrations() *AccountQuery
- func (rtq *RegistrationTokenQuery) Select(fields ...string) *RegistrationTokenSelect
- func (rtq *RegistrationTokenQuery) Unique(unique bool) *RegistrationTokenQuery
- func (rtq *RegistrationTokenQuery) Where(ps ...predicate.RegistrationToken) *RegistrationTokenQuery
- func (rtq *RegistrationTokenQuery) WithRegistrations(opts ...func(*AccountQuery)) *RegistrationTokenQuery
- type RegistrationTokenSelect
- func (rts *RegistrationTokenSelect) Aggregate(fns ...AggregateFunc) *RegistrationTokenSelect
- func (s *RegistrationTokenSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *RegistrationTokenSelect) BoolX(ctx context.Context) bool
- func (s *RegistrationTokenSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *RegistrationTokenSelect) BoolsX(ctx context.Context) []bool
- func (s *RegistrationTokenSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *RegistrationTokenSelect) Float64X(ctx context.Context) float64
- func (s *RegistrationTokenSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *RegistrationTokenSelect) Float64sX(ctx context.Context) []float64
- func (s *RegistrationTokenSelect) Int(ctx context.Context) (_ int, err error)
- func (s *RegistrationTokenSelect) IntX(ctx context.Context) int
- func (s *RegistrationTokenSelect) Ints(ctx context.Context) ([]int, error)
- func (s *RegistrationTokenSelect) IntsX(ctx context.Context) []int
- func (rts *RegistrationTokenSelect) Scan(ctx context.Context, v any) error
- func (s *RegistrationTokenSelect) ScanX(ctx context.Context, v any)
- func (s *RegistrationTokenSelect) String(ctx context.Context) (_ string, err error)
- func (s *RegistrationTokenSelect) StringX(ctx context.Context) string
- func (s *RegistrationTokenSelect) Strings(ctx context.Context) ([]string, error)
- func (s *RegistrationTokenSelect) StringsX(ctx context.Context) []string
- type RegistrationTokenUpdate
- func (rtu *RegistrationTokenUpdate) AddRegistrationIDs(ids ...int) *RegistrationTokenUpdate
- func (rtu *RegistrationTokenUpdate) AddRegistrations(a ...*Account) *RegistrationTokenUpdate
- func (rtu *RegistrationTokenUpdate) ClearRegistrations() *RegistrationTokenUpdate
- func (rtu *RegistrationTokenUpdate) Exec(ctx context.Context) error
- func (rtu *RegistrationTokenUpdate) ExecX(ctx context.Context)
- func (rtu *RegistrationTokenUpdate) Mutation() *RegistrationTokenMutation
- func (rtu *RegistrationTokenUpdate) RemoveRegistrationIDs(ids ...int) *RegistrationTokenUpdate
- func (rtu *RegistrationTokenUpdate) RemoveRegistrations(a ...*Account) *RegistrationTokenUpdate
- func (rtu *RegistrationTokenUpdate) Save(ctx context.Context) (int, error)
- func (rtu *RegistrationTokenUpdate) SaveX(ctx context.Context) int
- func (rtu *RegistrationTokenUpdate) SetName(s string) *RegistrationTokenUpdate
- func (rtu *RegistrationTokenUpdate) SetNillableName(s *string) *RegistrationTokenUpdate
- func (rtu *RegistrationTokenUpdate) SetToken(b []byte) *RegistrationTokenUpdate
- func (rtu *RegistrationTokenUpdate) SetUpdateTime(t time.Time) *RegistrationTokenUpdate
- func (rtu *RegistrationTokenUpdate) Where(ps ...predicate.RegistrationToken) *RegistrationTokenUpdate
- type RegistrationTokenUpdateOne
- func (rtuo *RegistrationTokenUpdateOne) AddRegistrationIDs(ids ...int) *RegistrationTokenUpdateOne
- func (rtuo *RegistrationTokenUpdateOne) AddRegistrations(a ...*Account) *RegistrationTokenUpdateOne
- func (rtuo *RegistrationTokenUpdateOne) ClearRegistrations() *RegistrationTokenUpdateOne
- func (rtuo *RegistrationTokenUpdateOne) Exec(ctx context.Context) error
- func (rtuo *RegistrationTokenUpdateOne) ExecX(ctx context.Context)
- func (rtuo *RegistrationTokenUpdateOne) Mutation() *RegistrationTokenMutation
- func (rtuo *RegistrationTokenUpdateOne) RemoveRegistrationIDs(ids ...int) *RegistrationTokenUpdateOne
- func (rtuo *RegistrationTokenUpdateOne) RemoveRegistrations(a ...*Account) *RegistrationTokenUpdateOne
- func (rtuo *RegistrationTokenUpdateOne) Save(ctx context.Context) (*RegistrationToken, error)
- func (rtuo *RegistrationTokenUpdateOne) SaveX(ctx context.Context) *RegistrationToken
- func (rtuo *RegistrationTokenUpdateOne) Select(field string, fields ...string) *RegistrationTokenUpdateOne
- func (rtuo *RegistrationTokenUpdateOne) SetName(s string) *RegistrationTokenUpdateOne
- func (rtuo *RegistrationTokenUpdateOne) SetNillableName(s *string) *RegistrationTokenUpdateOne
- func (rtuo *RegistrationTokenUpdateOne) SetToken(b []byte) *RegistrationTokenUpdateOne
- func (rtuo *RegistrationTokenUpdateOne) SetUpdateTime(t time.Time) *RegistrationTokenUpdateOne
- func (rtuo *RegistrationTokenUpdateOne) Where(ps ...predicate.RegistrationToken) *RegistrationTokenUpdateOne
- type RegistrationTokens
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Server
- type ServerClient
- func (c *ServerClient) Create() *ServerCreate
- func (c *ServerClient) CreateBulk(builders ...*ServerCreate) *ServerCreateBulk
- func (c *ServerClient) Delete() *ServerDelete
- func (c *ServerClient) DeleteOne(s *Server) *ServerDeleteOne
- func (c *ServerClient) DeleteOneID(id int) *ServerDeleteOne
- func (c *ServerClient) Get(ctx context.Context, id int) (*Server, error)
- func (c *ServerClient) GetX(ctx context.Context, id int) *Server
- func (c *ServerClient) Hooks() []Hook
- func (c *ServerClient) Intercept(interceptors ...Interceptor)
- func (c *ServerClient) Interceptors() []Interceptor
- func (c *ServerClient) MapCreateBulk(slice any, setFunc func(*ServerCreate, int)) *ServerCreateBulk
- func (c *ServerClient) Query() *ServerQuery
- func (c *ServerClient) QueryAccount(s *Server) *AccountQuery
- func (c *ServerClient) QueryNodes(s *Server) *NodeQuery
- func (c *ServerClient) Update() *ServerUpdate
- func (c *ServerClient) UpdateOne(s *Server) *ServerUpdateOne
- func (c *ServerClient) UpdateOneID(id int) *ServerUpdateOne
- func (c *ServerClient) Use(hooks ...Hook)
- type ServerCreate
- func (sc *ServerCreate) AddNodeIDs(ids ...int) *ServerCreate
- func (sc *ServerCreate) AddNodes(n ...*Node) *ServerCreate
- func (sc *ServerCreate) Exec(ctx context.Context) error
- func (sc *ServerCreate) ExecX(ctx context.Context)
- func (sc *ServerCreate) Mutation() *ServerMutation
- func (sc *ServerCreate) Save(ctx context.Context) (*Server, error)
- func (sc *ServerCreate) SaveX(ctx context.Context) *Server
- func (sc *ServerCreate) SetAccount(a *Account) *ServerCreate
- func (sc *ServerCreate) SetAccountID(id int) *ServerCreate
- func (sc *ServerCreate) SetCreateTime(t time.Time) *ServerCreate
- func (sc *ServerCreate) SetName(s string) *ServerCreate
- func (sc *ServerCreate) SetNillableCreateTime(t *time.Time) *ServerCreate
- func (sc *ServerCreate) SetNillableUpdateTime(t *time.Time) *ServerCreate
- func (sc *ServerCreate) SetUpdateTime(t time.Time) *ServerCreate
- type ServerCreateBulk
- type ServerDelete
- type ServerDeleteOne
- type ServerEdges
- type ServerGroupBy
- func (sgb *ServerGroupBy) Aggregate(fns ...AggregateFunc) *ServerGroupBy
- func (s *ServerGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ServerGroupBy) BoolX(ctx context.Context) bool
- func (s *ServerGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ServerGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ServerGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ServerGroupBy) Float64X(ctx context.Context) float64
- func (s *ServerGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ServerGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ServerGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ServerGroupBy) IntX(ctx context.Context) int
- func (s *ServerGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ServerGroupBy) IntsX(ctx context.Context) []int
- func (sgb *ServerGroupBy) Scan(ctx context.Context, v any) error
- func (s *ServerGroupBy) ScanX(ctx context.Context, v any)
- func (s *ServerGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ServerGroupBy) StringX(ctx context.Context) string
- func (s *ServerGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ServerGroupBy) StringsX(ctx context.Context) []string
- type ServerMutation
- func (m *ServerMutation) AccountCleared() bool
- func (m *ServerMutation) AccountID() (id int, exists bool)
- func (m *ServerMutation) AccountIDs() (ids []int)
- func (m *ServerMutation) AddField(name string, value ent.Value) error
- func (m *ServerMutation) AddNodeIDs(ids ...int)
- func (m *ServerMutation) AddedEdges() []string
- func (m *ServerMutation) AddedField(name string) (ent.Value, bool)
- func (m *ServerMutation) AddedFields() []string
- func (m *ServerMutation) AddedIDs(name string) []ent.Value
- func (m *ServerMutation) ClearAccount()
- func (m *ServerMutation) ClearEdge(name string) error
- func (m *ServerMutation) ClearField(name string) error
- func (m *ServerMutation) ClearNodes()
- func (m *ServerMutation) ClearedEdges() []string
- func (m *ServerMutation) ClearedFields() []string
- func (m ServerMutation) Client() *Client
- func (m *ServerMutation) CreateTime() (r time.Time, exists bool)
- func (m *ServerMutation) EdgeCleared(name string) bool
- func (m *ServerMutation) Field(name string) (ent.Value, bool)
- func (m *ServerMutation) FieldCleared(name string) bool
- func (m *ServerMutation) Fields() []string
- func (m *ServerMutation) ID() (id int, exists bool)
- func (m *ServerMutation) IDs(ctx context.Context) ([]int, error)
- func (m *ServerMutation) Name() (r string, exists bool)
- func (m *ServerMutation) NodesCleared() bool
- func (m *ServerMutation) NodesIDs() (ids []int)
- func (m *ServerMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *ServerMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ServerMutation) OldName(ctx context.Context) (v string, err error)
- func (m *ServerMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *ServerMutation) Op() Op
- func (m *ServerMutation) RemoveNodeIDs(ids ...int)
- func (m *ServerMutation) RemovedEdges() []string
- func (m *ServerMutation) RemovedIDs(name string) []ent.Value
- func (m *ServerMutation) RemovedNodesIDs() (ids []int)
- func (m *ServerMutation) ResetAccount()
- func (m *ServerMutation) ResetCreateTime()
- func (m *ServerMutation) ResetEdge(name string) error
- func (m *ServerMutation) ResetField(name string) error
- func (m *ServerMutation) ResetName()
- func (m *ServerMutation) ResetNodes()
- func (m *ServerMutation) ResetUpdateTime()
- func (m *ServerMutation) SetAccountID(id int)
- func (m *ServerMutation) SetCreateTime(t time.Time)
- func (m *ServerMutation) SetField(name string, value ent.Value) error
- func (m *ServerMutation) SetName(s string)
- func (m *ServerMutation) SetOp(op Op)
- func (m *ServerMutation) SetUpdateTime(t time.Time)
- func (m ServerMutation) Tx() (*Tx, error)
- func (m *ServerMutation) Type() string
- func (m *ServerMutation) UpdateTime() (r time.Time, exists bool)
- func (m *ServerMutation) Where(ps ...predicate.Server)
- func (m *ServerMutation) WhereP(ps ...func(*sql.Selector))
- type ServerQuery
- func (sq *ServerQuery) Aggregate(fns ...AggregateFunc) *ServerSelect
- func (sq *ServerQuery) All(ctx context.Context) ([]*Server, error)
- func (sq *ServerQuery) AllX(ctx context.Context) []*Server
- func (sq *ServerQuery) Clone() *ServerQuery
- func (sq *ServerQuery) Count(ctx context.Context) (int, error)
- func (sq *ServerQuery) CountX(ctx context.Context) int
- func (sq *ServerQuery) Exist(ctx context.Context) (bool, error)
- func (sq *ServerQuery) ExistX(ctx context.Context) bool
- func (sq *ServerQuery) First(ctx context.Context) (*Server, error)
- func (sq *ServerQuery) FirstID(ctx context.Context) (id int, err error)
- func (sq *ServerQuery) FirstIDX(ctx context.Context) int
- func (sq *ServerQuery) FirstX(ctx context.Context) *Server
- func (sq *ServerQuery) GroupBy(field string, fields ...string) *ServerGroupBy
- func (sq *ServerQuery) IDs(ctx context.Context) (ids []int, err error)
- func (sq *ServerQuery) IDsX(ctx context.Context) []int
- func (sq *ServerQuery) Limit(limit int) *ServerQuery
- func (sq *ServerQuery) Offset(offset int) *ServerQuery
- func (sq *ServerQuery) Only(ctx context.Context) (*Server, error)
- func (sq *ServerQuery) OnlyID(ctx context.Context) (id int, err error)
- func (sq *ServerQuery) OnlyIDX(ctx context.Context) int
- func (sq *ServerQuery) OnlyX(ctx context.Context) *Server
- func (sq *ServerQuery) Order(o ...server.OrderOption) *ServerQuery
- func (sq *ServerQuery) QueryAccount() *AccountQuery
- func (sq *ServerQuery) QueryNodes() *NodeQuery
- func (sq *ServerQuery) Select(fields ...string) *ServerSelect
- func (sq *ServerQuery) Unique(unique bool) *ServerQuery
- func (sq *ServerQuery) Where(ps ...predicate.Server) *ServerQuery
- func (sq *ServerQuery) WithAccount(opts ...func(*AccountQuery)) *ServerQuery
- func (sq *ServerQuery) WithNodes(opts ...func(*NodeQuery)) *ServerQuery
- type ServerSelect
- func (ss *ServerSelect) Aggregate(fns ...AggregateFunc) *ServerSelect
- func (s *ServerSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ServerSelect) BoolX(ctx context.Context) bool
- func (s *ServerSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ServerSelect) BoolsX(ctx context.Context) []bool
- func (s *ServerSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ServerSelect) Float64X(ctx context.Context) float64
- func (s *ServerSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ServerSelect) Float64sX(ctx context.Context) []float64
- func (s *ServerSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ServerSelect) IntX(ctx context.Context) int
- func (s *ServerSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ServerSelect) IntsX(ctx context.Context) []int
- func (ss *ServerSelect) Scan(ctx context.Context, v any) error
- func (s *ServerSelect) ScanX(ctx context.Context, v any)
- func (s *ServerSelect) String(ctx context.Context) (_ string, err error)
- func (s *ServerSelect) StringX(ctx context.Context) string
- func (s *ServerSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ServerSelect) StringsX(ctx context.Context) []string
- type ServerUpdate
- func (su *ServerUpdate) AddNodeIDs(ids ...int) *ServerUpdate
- func (su *ServerUpdate) AddNodes(n ...*Node) *ServerUpdate
- func (su *ServerUpdate) ClearAccount() *ServerUpdate
- func (su *ServerUpdate) ClearNodes() *ServerUpdate
- func (su *ServerUpdate) Exec(ctx context.Context) error
- func (su *ServerUpdate) ExecX(ctx context.Context)
- func (su *ServerUpdate) Mutation() *ServerMutation
- func (su *ServerUpdate) RemoveNodeIDs(ids ...int) *ServerUpdate
- func (su *ServerUpdate) RemoveNodes(n ...*Node) *ServerUpdate
- func (su *ServerUpdate) Save(ctx context.Context) (int, error)
- func (su *ServerUpdate) SaveX(ctx context.Context) int
- func (su *ServerUpdate) SetAccount(a *Account) *ServerUpdate
- func (su *ServerUpdate) SetAccountID(id int) *ServerUpdate
- func (su *ServerUpdate) SetName(s string) *ServerUpdate
- func (su *ServerUpdate) SetNillableName(s *string) *ServerUpdate
- func (su *ServerUpdate) SetUpdateTime(t time.Time) *ServerUpdate
- func (su *ServerUpdate) Where(ps ...predicate.Server) *ServerUpdate
- type ServerUpdateOne
- func (suo *ServerUpdateOne) AddNodeIDs(ids ...int) *ServerUpdateOne
- func (suo *ServerUpdateOne) AddNodes(n ...*Node) *ServerUpdateOne
- func (suo *ServerUpdateOne) ClearAccount() *ServerUpdateOne
- func (suo *ServerUpdateOne) ClearNodes() *ServerUpdateOne
- func (suo *ServerUpdateOne) Exec(ctx context.Context) error
- func (suo *ServerUpdateOne) ExecX(ctx context.Context)
- func (suo *ServerUpdateOne) Mutation() *ServerMutation
- func (suo *ServerUpdateOne) RemoveNodeIDs(ids ...int) *ServerUpdateOne
- func (suo *ServerUpdateOne) RemoveNodes(n ...*Node) *ServerUpdateOne
- func (suo *ServerUpdateOne) Save(ctx context.Context) (*Server, error)
- func (suo *ServerUpdateOne) SaveX(ctx context.Context) *Server
- func (suo *ServerUpdateOne) Select(field string, fields ...string) *ServerUpdateOne
- func (suo *ServerUpdateOne) SetAccount(a *Account) *ServerUpdateOne
- func (suo *ServerUpdateOne) SetAccountID(id int) *ServerUpdateOne
- func (suo *ServerUpdateOne) SetName(s string) *ServerUpdateOne
- func (suo *ServerUpdateOne) SetNillableName(s *string) *ServerUpdateOne
- func (suo *ServerUpdateOne) SetUpdateTime(t time.Time) *ServerUpdateOne
- func (suo *ServerUpdateOne) Where(ps ...predicate.Server) *ServerUpdateOne
- type Servers
- type TraverseFunc
- type Traverser
- type Tx
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeAccount = "Account" TypeNode = "Node" TypeRegistrationToken = "RegistrationToken" TypeServer = "Server" )
Variables ¶
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 IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type Account ¶
type Account struct { // ID of the ent. ID int `json:"id,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,omitempty"` // Username is the unique username of the account. Username string `json:"username,omitempty"` // AccessToken is the token used to access the account. AccessToken []byte `json:"access_token,omitempty"` // RefreshToken is the token used to refresh the account. RefreshToken []byte `json:"refresh_token,omitempty"` // RegistrationTokenID is the ID of the registration token. RegistrationTokenID int `json:"registration_token_id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the AccountQuery when eager-loading is set. Edges AccountEdges `json:"edges"` // contains filtered or unexported fields }
Account is the model entity for the Account schema.
func (*Account) QueryNodes ¶
QueryNodes queries the "nodes" edge of the Account entity.
func (*Account) QueryRegistrationToken ¶
func (a *Account) QueryRegistrationToken() *RegistrationTokenQuery
QueryRegistrationToken queries the "registration_token" edge of the Account entity.
func (*Account) QueryServers ¶
func (a *Account) QueryServers() *ServerQuery
QueryServers queries the "servers" edge of the Account entity.
func (*Account) Unwrap ¶
Unwrap unwraps the Account 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 (*Account) Update ¶
func (a *Account) Update() *AccountUpdateOne
Update returns a builder for updating this Account. Note that you need to call Account.Unwrap() before calling this method if this Account was returned from a transaction, and the transaction was committed or rolled back.
type AccountClient ¶
type AccountClient struct {
// contains filtered or unexported fields
}
AccountClient is a client for the Account schema.
func NewAccountClient ¶
func NewAccountClient(c config) *AccountClient
NewAccountClient returns a client for the Account from the given config.
func (*AccountClient) Create ¶
func (c *AccountClient) Create() *AccountCreate
Create returns a builder for creating a Account entity.
func (*AccountClient) CreateBulk ¶
func (c *AccountClient) CreateBulk(builders ...*AccountCreate) *AccountCreateBulk
CreateBulk returns a builder for creating a bulk of Account entities.
func (*AccountClient) Delete ¶
func (c *AccountClient) Delete() *AccountDelete
Delete returns a delete builder for Account.
func (*AccountClient) DeleteOne ¶
func (c *AccountClient) DeleteOne(a *Account) *AccountDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*AccountClient) DeleteOneID ¶
func (c *AccountClient) DeleteOneID(id int) *AccountDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*AccountClient) GetX ¶
func (c *AccountClient) GetX(ctx context.Context, id int) *Account
GetX is like Get, but panics if an error occurs.
func (*AccountClient) Hooks ¶
func (c *AccountClient) Hooks() []Hook
Hooks returns the client hooks.
func (*AccountClient) Intercept ¶
func (c *AccountClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `account.Intercept(f(g(h())))`.
func (*AccountClient) Interceptors ¶
func (c *AccountClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*AccountClient) MapCreateBulk ¶
func (c *AccountClient) MapCreateBulk(slice any, setFunc func(*AccountCreate, int)) *AccountCreateBulk
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 (*AccountClient) Query ¶
func (c *AccountClient) Query() *AccountQuery
Query returns a query builder for Account.
func (*AccountClient) QueryNodes ¶
func (c *AccountClient) QueryNodes(a *Account) *NodeQuery
QueryNodes queries the nodes edge of a Account.
func (*AccountClient) QueryRegistrationToken ¶
func (c *AccountClient) QueryRegistrationToken(a *Account) *RegistrationTokenQuery
QueryRegistrationToken queries the registration_token edge of a Account.
func (*AccountClient) QueryServers ¶
func (c *AccountClient) QueryServers(a *Account) *ServerQuery
QueryServers queries the servers edge of a Account.
func (*AccountClient) Update ¶
func (c *AccountClient) Update() *AccountUpdate
Update returns an update builder for Account.
func (*AccountClient) UpdateOne ¶
func (c *AccountClient) UpdateOne(a *Account) *AccountUpdateOne
UpdateOne returns an update builder for the given entity.
func (*AccountClient) UpdateOneID ¶
func (c *AccountClient) UpdateOneID(id int) *AccountUpdateOne
UpdateOneID returns an update builder for the given id.
func (*AccountClient) Use ¶
func (c *AccountClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `account.Hooks(f(g(h())))`.
type AccountCreate ¶
type AccountCreate struct {
// contains filtered or unexported fields
}
AccountCreate is the builder for creating a Account entity.
func (*AccountCreate) AddNodeIDs ¶
func (ac *AccountCreate) AddNodeIDs(ids ...int) *AccountCreate
AddNodeIDs adds the "nodes" edge to the Node entity by IDs.
func (*AccountCreate) AddNodes ¶
func (ac *AccountCreate) AddNodes(n ...*Node) *AccountCreate
AddNodes adds the "nodes" edges to the Node entity.
func (*AccountCreate) AddServerIDs ¶
func (ac *AccountCreate) AddServerIDs(ids ...int) *AccountCreate
AddServerIDs adds the "servers" edge to the Server entity by IDs.
func (*AccountCreate) AddServers ¶
func (ac *AccountCreate) AddServers(s ...*Server) *AccountCreate
AddServers adds the "servers" edges to the Server entity.
func (*AccountCreate) Exec ¶
func (ac *AccountCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*AccountCreate) ExecX ¶
func (ac *AccountCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AccountCreate) Mutation ¶
func (ac *AccountCreate) Mutation() *AccountMutation
Mutation returns the AccountMutation object of the builder.
func (*AccountCreate) Save ¶
func (ac *AccountCreate) Save(ctx context.Context) (*Account, error)
Save creates the Account in the database.
func (*AccountCreate) SaveX ¶
func (ac *AccountCreate) SaveX(ctx context.Context) *Account
SaveX calls Save and panics if Save returns an error.
func (*AccountCreate) SetAccessToken ¶
func (ac *AccountCreate) SetAccessToken(b []byte) *AccountCreate
SetAccessToken sets the "access_token" field.
func (*AccountCreate) SetCreateTime ¶
func (ac *AccountCreate) SetCreateTime(t time.Time) *AccountCreate
SetCreateTime sets the "create_time" field.
func (*AccountCreate) SetNillableCreateTime ¶
func (ac *AccountCreate) SetNillableCreateTime(t *time.Time) *AccountCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*AccountCreate) SetNillableRegistrationTokenID ¶
func (ac *AccountCreate) SetNillableRegistrationTokenID(i *int) *AccountCreate
SetNillableRegistrationTokenID sets the "registration_token_id" field if the given value is not nil.
func (*AccountCreate) SetNillableUpdateTime ¶
func (ac *AccountCreate) SetNillableUpdateTime(t *time.Time) *AccountCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*AccountCreate) SetRefreshToken ¶
func (ac *AccountCreate) SetRefreshToken(b []byte) *AccountCreate
SetRefreshToken sets the "refresh_token" field.
func (*AccountCreate) SetRegistrationToken ¶
func (ac *AccountCreate) SetRegistrationToken(r *RegistrationToken) *AccountCreate
SetRegistrationToken sets the "registration_token" edge to the RegistrationToken entity.
func (*AccountCreate) SetRegistrationTokenID ¶
func (ac *AccountCreate) SetRegistrationTokenID(i int) *AccountCreate
SetRegistrationTokenID sets the "registration_token_id" field.
func (*AccountCreate) SetUpdateTime ¶
func (ac *AccountCreate) SetUpdateTime(t time.Time) *AccountCreate
SetUpdateTime sets the "update_time" field.
func (*AccountCreate) SetUsername ¶
func (ac *AccountCreate) SetUsername(s string) *AccountCreate
SetUsername sets the "username" field.
type AccountCreateBulk ¶
type AccountCreateBulk struct {
// contains filtered or unexported fields
}
AccountCreateBulk is the builder for creating many Account entities in bulk.
func (*AccountCreateBulk) Exec ¶
func (acb *AccountCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*AccountCreateBulk) ExecX ¶
func (acb *AccountCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type AccountDelete ¶
type AccountDelete struct {
// contains filtered or unexported fields
}
AccountDelete is the builder for deleting a Account entity.
func (*AccountDelete) Exec ¶
func (ad *AccountDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*AccountDelete) ExecX ¶
func (ad *AccountDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*AccountDelete) Where ¶
func (ad *AccountDelete) Where(ps ...predicate.Account) *AccountDelete
Where appends a list predicates to the AccountDelete builder.
type AccountDeleteOne ¶
type AccountDeleteOne struct {
// contains filtered or unexported fields
}
AccountDeleteOne is the builder for deleting a single Account entity.
func (*AccountDeleteOne) Exec ¶
func (ado *AccountDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*AccountDeleteOne) ExecX ¶
func (ado *AccountDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AccountDeleteOne) Where ¶
func (ado *AccountDeleteOne) Where(ps ...predicate.Account) *AccountDeleteOne
Where appends a list predicates to the AccountDelete builder.
type AccountEdges ¶
type AccountEdges struct { // Servers holds the value of the servers edge. Servers []*Server `json:"servers,omitempty"` // Nodes holds the value of the nodes edge. Nodes []*Node `json:"nodes,omitempty"` // RegistrationToken holds the value of the registration_token edge. RegistrationToken *RegistrationToken `json:"registration_token,omitempty"` // contains filtered or unexported fields }
AccountEdges holds the relations/edges for other nodes in the graph.
func (AccountEdges) NodesOrErr ¶
func (e AccountEdges) NodesOrErr() ([]*Node, error)
NodesOrErr returns the Nodes value or an error if the edge was not loaded in eager-loading.
func (AccountEdges) RegistrationTokenOrErr ¶
func (e AccountEdges) RegistrationTokenOrErr() (*RegistrationToken, error)
RegistrationTokenOrErr returns the RegistrationToken value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (AccountEdges) ServersOrErr ¶
func (e AccountEdges) ServersOrErr() ([]*Server, error)
ServersOrErr returns the Servers value or an error if the edge was not loaded in eager-loading.
type AccountGroupBy ¶
type AccountGroupBy struct {
// contains filtered or unexported fields
}
AccountGroupBy is the group-by builder for Account entities.
func (*AccountGroupBy) Aggregate ¶
func (agb *AccountGroupBy) Aggregate(fns ...AggregateFunc) *AccountGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*AccountGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AccountGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AccountGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AccountGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AccountGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AccountGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AccountGroupBy) Scan ¶
func (agb *AccountGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*AccountGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AccountMutation ¶
type AccountMutation struct {
// contains filtered or unexported fields
}
AccountMutation represents an operation that mutates the Account nodes in the graph.
func (*AccountMutation) AccessToken ¶
func (m *AccountMutation) AccessToken() (r []byte, exists bool)
AccessToken returns the value of the "access_token" field in the mutation.
func (*AccountMutation) AddField ¶
func (m *AccountMutation) 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 (*AccountMutation) AddNodeIDs ¶
func (m *AccountMutation) AddNodeIDs(ids ...int)
AddNodeIDs adds the "nodes" edge to the Node entity by ids.
func (*AccountMutation) AddServerIDs ¶
func (m *AccountMutation) AddServerIDs(ids ...int)
AddServerIDs adds the "servers" edge to the Server entity by ids.
func (*AccountMutation) AddedEdges ¶
func (m *AccountMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*AccountMutation) AddedField ¶
func (m *AccountMutation) 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 (*AccountMutation) AddedFields ¶
func (m *AccountMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*AccountMutation) AddedIDs ¶
func (m *AccountMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*AccountMutation) ClearEdge ¶
func (m *AccountMutation) 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 (*AccountMutation) ClearField ¶
func (m *AccountMutation) 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 (*AccountMutation) ClearNodes ¶
func (m *AccountMutation) ClearNodes()
ClearNodes clears the "nodes" edge to the Node entity.
func (*AccountMutation) ClearRegistrationToken ¶
func (m *AccountMutation) ClearRegistrationToken()
ClearRegistrationToken clears the "registration_token" edge to the RegistrationToken entity.
func (*AccountMutation) ClearRegistrationTokenID ¶
func (m *AccountMutation) ClearRegistrationTokenID()
ClearRegistrationTokenID clears the value of the "registration_token_id" field.
func (*AccountMutation) ClearServers ¶
func (m *AccountMutation) ClearServers()
ClearServers clears the "servers" edge to the Server entity.
func (*AccountMutation) ClearedEdges ¶
func (m *AccountMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*AccountMutation) ClearedFields ¶
func (m *AccountMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (AccountMutation) Client ¶
func (m AccountMutation) 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 (*AccountMutation) CreateTime ¶
func (m *AccountMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*AccountMutation) EdgeCleared ¶
func (m *AccountMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*AccountMutation) Field ¶
func (m *AccountMutation) 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 (*AccountMutation) FieldCleared ¶
func (m *AccountMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*AccountMutation) Fields ¶
func (m *AccountMutation) 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 (*AccountMutation) ID ¶
func (m *AccountMutation) 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 (*AccountMutation) IDs ¶
func (m *AccountMutation) 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 (*AccountMutation) NodesCleared ¶
func (m *AccountMutation) NodesCleared() bool
NodesCleared reports if the "nodes" edge to the Node entity was cleared.
func (*AccountMutation) NodesIDs ¶
func (m *AccountMutation) NodesIDs() (ids []int)
NodesIDs returns the "nodes" edge IDs in the mutation.
func (*AccountMutation) OldAccessToken ¶
func (m *AccountMutation) OldAccessToken(ctx context.Context) (v []byte, err error)
OldAccessToken returns the old "access_token" field's value of the Account entity. If the Account 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 (*AccountMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the Account entity. If the Account 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 (*AccountMutation) OldField ¶
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 (*AccountMutation) OldRefreshToken ¶
func (m *AccountMutation) OldRefreshToken(ctx context.Context) (v []byte, err error)
OldRefreshToken returns the old "refresh_token" field's value of the Account entity. If the Account 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 (*AccountMutation) OldRegistrationTokenID ¶
func (m *AccountMutation) OldRegistrationTokenID(ctx context.Context) (v int, err error)
OldRegistrationTokenID returns the old "registration_token_id" field's value of the Account entity. If the Account 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 (*AccountMutation) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" field's value of the Account entity. If the Account 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 (*AccountMutation) OldUsername ¶
func (m *AccountMutation) OldUsername(ctx context.Context) (v string, err error)
OldUsername returns the old "username" field's value of the Account entity. If the Account 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 (*AccountMutation) RefreshToken ¶
func (m *AccountMutation) RefreshToken() (r []byte, exists bool)
RefreshToken returns the value of the "refresh_token" field in the mutation.
func (*AccountMutation) RegistrationTokenCleared ¶
func (m *AccountMutation) RegistrationTokenCleared() bool
RegistrationTokenCleared reports if the "registration_token" edge to the RegistrationToken entity was cleared.
func (*AccountMutation) RegistrationTokenID ¶
func (m *AccountMutation) RegistrationTokenID() (r int, exists bool)
RegistrationTokenID returns the value of the "registration_token_id" field in the mutation.
func (*AccountMutation) RegistrationTokenIDCleared ¶
func (m *AccountMutation) RegistrationTokenIDCleared() bool
RegistrationTokenIDCleared returns if the "registration_token_id" field was cleared in this mutation.
func (*AccountMutation) RegistrationTokenIDs ¶
func (m *AccountMutation) RegistrationTokenIDs() (ids []int)
RegistrationTokenIDs returns the "registration_token" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use RegistrationTokenID instead. It exists only for internal usage by the builders.
func (*AccountMutation) RemoveNodeIDs ¶
func (m *AccountMutation) RemoveNodeIDs(ids ...int)
RemoveNodeIDs removes the "nodes" edge to the Node entity by IDs.
func (*AccountMutation) RemoveServerIDs ¶
func (m *AccountMutation) RemoveServerIDs(ids ...int)
RemoveServerIDs removes the "servers" edge to the Server entity by IDs.
func (*AccountMutation) RemovedEdges ¶
func (m *AccountMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*AccountMutation) RemovedIDs ¶
func (m *AccountMutation) 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 (*AccountMutation) RemovedNodesIDs ¶
func (m *AccountMutation) RemovedNodesIDs() (ids []int)
RemovedNodes returns the removed IDs of the "nodes" edge to the Node entity.
func (*AccountMutation) RemovedServersIDs ¶
func (m *AccountMutation) RemovedServersIDs() (ids []int)
RemovedServers returns the removed IDs of the "servers" edge to the Server entity.
func (*AccountMutation) ResetAccessToken ¶
func (m *AccountMutation) ResetAccessToken()
ResetAccessToken resets all changes to the "access_token" field.
func (*AccountMutation) ResetCreateTime ¶
func (m *AccountMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*AccountMutation) ResetEdge ¶
func (m *AccountMutation) 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 (*AccountMutation) ResetField ¶
func (m *AccountMutation) 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 (*AccountMutation) ResetNodes ¶
func (m *AccountMutation) ResetNodes()
ResetNodes resets all changes to the "nodes" edge.
func (*AccountMutation) ResetRefreshToken ¶
func (m *AccountMutation) ResetRefreshToken()
ResetRefreshToken resets all changes to the "refresh_token" field.
func (*AccountMutation) ResetRegistrationToken ¶
func (m *AccountMutation) ResetRegistrationToken()
ResetRegistrationToken resets all changes to the "registration_token" edge.
func (*AccountMutation) ResetRegistrationTokenID ¶
func (m *AccountMutation) ResetRegistrationTokenID()
ResetRegistrationTokenID resets all changes to the "registration_token_id" field.
func (*AccountMutation) ResetServers ¶
func (m *AccountMutation) ResetServers()
ResetServers resets all changes to the "servers" edge.
func (*AccountMutation) ResetUpdateTime ¶
func (m *AccountMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*AccountMutation) ResetUsername ¶
func (m *AccountMutation) ResetUsername()
ResetUsername resets all changes to the "username" field.
func (*AccountMutation) ServersCleared ¶
func (m *AccountMutation) ServersCleared() bool
ServersCleared reports if the "servers" edge to the Server entity was cleared.
func (*AccountMutation) ServersIDs ¶
func (m *AccountMutation) ServersIDs() (ids []int)
ServersIDs returns the "servers" edge IDs in the mutation.
func (*AccountMutation) SetAccessToken ¶
func (m *AccountMutation) SetAccessToken(b []byte)
SetAccessToken sets the "access_token" field.
func (*AccountMutation) SetCreateTime ¶
func (m *AccountMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*AccountMutation) SetField ¶
func (m *AccountMutation) 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 (*AccountMutation) SetOp ¶
func (m *AccountMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*AccountMutation) SetRefreshToken ¶
func (m *AccountMutation) SetRefreshToken(b []byte)
SetRefreshToken sets the "refresh_token" field.
func (*AccountMutation) SetRegistrationTokenID ¶
func (m *AccountMutation) SetRegistrationTokenID(i int)
SetRegistrationTokenID sets the "registration_token_id" field.
func (*AccountMutation) SetUpdateTime ¶
func (m *AccountMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (*AccountMutation) SetUsername ¶
func (m *AccountMutation) SetUsername(s string)
SetUsername sets the "username" field.
func (AccountMutation) Tx ¶
func (m AccountMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*AccountMutation) Type ¶
func (m *AccountMutation) Type() string
Type returns the node type of this mutation (Account).
func (*AccountMutation) UpdateTime ¶
func (m *AccountMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*AccountMutation) Username ¶
func (m *AccountMutation) Username() (r string, exists bool)
Username returns the value of the "username" field in the mutation.
func (*AccountMutation) Where ¶
func (m *AccountMutation) Where(ps ...predicate.Account)
Where appends a list predicates to the AccountMutation builder.
func (*AccountMutation) WhereP ¶
func (m *AccountMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the AccountMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type AccountQuery ¶
type AccountQuery struct {
// contains filtered or unexported fields
}
AccountQuery is the builder for querying Account entities.
func (*AccountQuery) Aggregate ¶
func (aq *AccountQuery) Aggregate(fns ...AggregateFunc) *AccountSelect
Aggregate returns a AccountSelect configured with the given aggregations.
func (*AccountQuery) All ¶
func (aq *AccountQuery) All(ctx context.Context) ([]*Account, error)
All executes the query and returns a list of Accounts.
func (*AccountQuery) AllX ¶
func (aq *AccountQuery) AllX(ctx context.Context) []*Account
AllX is like All, but panics if an error occurs.
func (*AccountQuery) Clone ¶
func (aq *AccountQuery) Clone() *AccountQuery
Clone returns a duplicate of the AccountQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*AccountQuery) Count ¶
func (aq *AccountQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*AccountQuery) CountX ¶
func (aq *AccountQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*AccountQuery) Exist ¶
func (aq *AccountQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*AccountQuery) ExistX ¶
func (aq *AccountQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*AccountQuery) First ¶
func (aq *AccountQuery) First(ctx context.Context) (*Account, error)
First returns the first Account entity from the query. Returns a *NotFoundError when no Account was found.
func (*AccountQuery) FirstID ¶
func (aq *AccountQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Account ID from the query. Returns a *NotFoundError when no Account ID was found.
func (*AccountQuery) FirstIDX ¶
func (aq *AccountQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*AccountQuery) FirstX ¶
func (aq *AccountQuery) FirstX(ctx context.Context) *Account
FirstX is like First, but panics if an error occurs.
func (*AccountQuery) GroupBy ¶
func (aq *AccountQuery) GroupBy(field string, fields ...string) *AccountGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreateTime time.Time `json:"create_time,omitempty"` Count int `json:"count,omitempty"` } client.Account.Query(). GroupBy(account.FieldCreateTime). Aggregate(ent.Count()). Scan(ctx, &v)
func (*AccountQuery) IDs ¶
func (aq *AccountQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Account IDs.
func (*AccountQuery) IDsX ¶
func (aq *AccountQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*AccountQuery) Limit ¶
func (aq *AccountQuery) Limit(limit int) *AccountQuery
Limit the number of records to be returned by this query.
func (*AccountQuery) Offset ¶
func (aq *AccountQuery) Offset(offset int) *AccountQuery
Offset to start from.
func (*AccountQuery) Only ¶
func (aq *AccountQuery) Only(ctx context.Context) (*Account, error)
Only returns a single Account entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Account entity is found. Returns a *NotFoundError when no Account entities are found.
func (*AccountQuery) OnlyID ¶
func (aq *AccountQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Account ID in the query. Returns a *NotSingularError when more than one Account ID is found. Returns a *NotFoundError when no entities are found.
func (*AccountQuery) OnlyIDX ¶
func (aq *AccountQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*AccountQuery) OnlyX ¶
func (aq *AccountQuery) OnlyX(ctx context.Context) *Account
OnlyX is like Only, but panics if an error occurs.
func (*AccountQuery) Order ¶
func (aq *AccountQuery) Order(o ...account.OrderOption) *AccountQuery
Order specifies how the records should be ordered.
func (*AccountQuery) QueryNodes ¶
func (aq *AccountQuery) QueryNodes() *NodeQuery
QueryNodes chains the current query on the "nodes" edge.
func (*AccountQuery) QueryRegistrationToken ¶
func (aq *AccountQuery) QueryRegistrationToken() *RegistrationTokenQuery
QueryRegistrationToken chains the current query on the "registration_token" edge.
func (*AccountQuery) QueryServers ¶
func (aq *AccountQuery) QueryServers() *ServerQuery
QueryServers chains the current query on the "servers" edge.
func (*AccountQuery) Select ¶
func (aq *AccountQuery) Select(fields ...string) *AccountSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreateTime time.Time `json:"create_time,omitempty"` } client.Account.Query(). Select(account.FieldCreateTime). Scan(ctx, &v)
func (*AccountQuery) Unique ¶
func (aq *AccountQuery) Unique(unique bool) *AccountQuery
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 (*AccountQuery) Where ¶
func (aq *AccountQuery) Where(ps ...predicate.Account) *AccountQuery
Where adds a new predicate for the AccountQuery builder.
func (*AccountQuery) WithNodes ¶
func (aq *AccountQuery) WithNodes(opts ...func(*NodeQuery)) *AccountQuery
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 (*AccountQuery) WithRegistrationToken ¶
func (aq *AccountQuery) WithRegistrationToken(opts ...func(*RegistrationTokenQuery)) *AccountQuery
WithRegistrationToken tells the query-builder to eager-load the nodes that are connected to the "registration_token" edge. The optional arguments are used to configure the query builder of the edge.
func (*AccountQuery) WithServers ¶
func (aq *AccountQuery) WithServers(opts ...func(*ServerQuery)) *AccountQuery
WithServers tells the query-builder to eager-load the nodes that are connected to the "servers" edge. The optional arguments are used to configure the query builder of the edge.
type AccountSelect ¶
type AccountSelect struct { *AccountQuery // contains filtered or unexported fields }
AccountSelect is the builder for selecting fields of Account entities.
func (*AccountSelect) Aggregate ¶
func (as *AccountSelect) Aggregate(fns ...AggregateFunc) *AccountSelect
Aggregate adds the given aggregation functions to the selector query.
func (*AccountSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AccountSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AccountSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AccountSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AccountSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AccountSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AccountSelect) Scan ¶
func (as *AccountSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*AccountSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AccountUpdate ¶
type AccountUpdate struct {
// contains filtered or unexported fields
}
AccountUpdate is the builder for updating Account entities.
func (*AccountUpdate) AddNodeIDs ¶
func (au *AccountUpdate) AddNodeIDs(ids ...int) *AccountUpdate
AddNodeIDs adds the "nodes" edge to the Node entity by IDs.
func (*AccountUpdate) AddNodes ¶
func (au *AccountUpdate) AddNodes(n ...*Node) *AccountUpdate
AddNodes adds the "nodes" edges to the Node entity.
func (*AccountUpdate) AddServerIDs ¶
func (au *AccountUpdate) AddServerIDs(ids ...int) *AccountUpdate
AddServerIDs adds the "servers" edge to the Server entity by IDs.
func (*AccountUpdate) AddServers ¶
func (au *AccountUpdate) AddServers(s ...*Server) *AccountUpdate
AddServers adds the "servers" edges to the Server entity.
func (*AccountUpdate) ClearNodes ¶
func (au *AccountUpdate) ClearNodes() *AccountUpdate
ClearNodes clears all "nodes" edges to the Node entity.
func (*AccountUpdate) ClearRegistrationToken ¶
func (au *AccountUpdate) ClearRegistrationToken() *AccountUpdate
ClearRegistrationToken clears the "registration_token" edge to the RegistrationToken entity.
func (*AccountUpdate) ClearRegistrationTokenID ¶
func (au *AccountUpdate) ClearRegistrationTokenID() *AccountUpdate
ClearRegistrationTokenID clears the value of the "registration_token_id" field.
func (*AccountUpdate) ClearServers ¶
func (au *AccountUpdate) ClearServers() *AccountUpdate
ClearServers clears all "servers" edges to the Server entity.
func (*AccountUpdate) Exec ¶
func (au *AccountUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*AccountUpdate) ExecX ¶
func (au *AccountUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AccountUpdate) Mutation ¶
func (au *AccountUpdate) Mutation() *AccountMutation
Mutation returns the AccountMutation object of the builder.
func (*AccountUpdate) RemoveNodeIDs ¶
func (au *AccountUpdate) RemoveNodeIDs(ids ...int) *AccountUpdate
RemoveNodeIDs removes the "nodes" edge to Node entities by IDs.
func (*AccountUpdate) RemoveNodes ¶
func (au *AccountUpdate) RemoveNodes(n ...*Node) *AccountUpdate
RemoveNodes removes "nodes" edges to Node entities.
func (*AccountUpdate) RemoveServerIDs ¶
func (au *AccountUpdate) RemoveServerIDs(ids ...int) *AccountUpdate
RemoveServerIDs removes the "servers" edge to Server entities by IDs.
func (*AccountUpdate) RemoveServers ¶
func (au *AccountUpdate) RemoveServers(s ...*Server) *AccountUpdate
RemoveServers removes "servers" edges to Server entities.
func (*AccountUpdate) Save ¶
func (au *AccountUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*AccountUpdate) SaveX ¶
func (au *AccountUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*AccountUpdate) SetAccessToken ¶
func (au *AccountUpdate) SetAccessToken(b []byte) *AccountUpdate
SetAccessToken sets the "access_token" field.
func (*AccountUpdate) SetNillableRegistrationTokenID ¶
func (au *AccountUpdate) SetNillableRegistrationTokenID(i *int) *AccountUpdate
SetNillableRegistrationTokenID sets the "registration_token_id" field if the given value is not nil.
func (*AccountUpdate) SetNillableUsername ¶
func (au *AccountUpdate) SetNillableUsername(s *string) *AccountUpdate
SetNillableUsername sets the "username" field if the given value is not nil.
func (*AccountUpdate) SetRefreshToken ¶
func (au *AccountUpdate) SetRefreshToken(b []byte) *AccountUpdate
SetRefreshToken sets the "refresh_token" field.
func (*AccountUpdate) SetRegistrationToken ¶
func (au *AccountUpdate) SetRegistrationToken(r *RegistrationToken) *AccountUpdate
SetRegistrationToken sets the "registration_token" edge to the RegistrationToken entity.
func (*AccountUpdate) SetRegistrationTokenID ¶
func (au *AccountUpdate) SetRegistrationTokenID(i int) *AccountUpdate
SetRegistrationTokenID sets the "registration_token_id" field.
func (*AccountUpdate) SetUpdateTime ¶
func (au *AccountUpdate) SetUpdateTime(t time.Time) *AccountUpdate
SetUpdateTime sets the "update_time" field.
func (*AccountUpdate) SetUsername ¶
func (au *AccountUpdate) SetUsername(s string) *AccountUpdate
SetUsername sets the "username" field.
func (*AccountUpdate) Where ¶
func (au *AccountUpdate) Where(ps ...predicate.Account) *AccountUpdate
Where appends a list predicates to the AccountUpdate builder.
type AccountUpdateOne ¶
type AccountUpdateOne struct {
// contains filtered or unexported fields
}
AccountUpdateOne is the builder for updating a single Account entity.
func (*AccountUpdateOne) AddNodeIDs ¶
func (auo *AccountUpdateOne) AddNodeIDs(ids ...int) *AccountUpdateOne
AddNodeIDs adds the "nodes" edge to the Node entity by IDs.
func (*AccountUpdateOne) AddNodes ¶
func (auo *AccountUpdateOne) AddNodes(n ...*Node) *AccountUpdateOne
AddNodes adds the "nodes" edges to the Node entity.
func (*AccountUpdateOne) AddServerIDs ¶
func (auo *AccountUpdateOne) AddServerIDs(ids ...int) *AccountUpdateOne
AddServerIDs adds the "servers" edge to the Server entity by IDs.
func (*AccountUpdateOne) AddServers ¶
func (auo *AccountUpdateOne) AddServers(s ...*Server) *AccountUpdateOne
AddServers adds the "servers" edges to the Server entity.
func (*AccountUpdateOne) ClearNodes ¶
func (auo *AccountUpdateOne) ClearNodes() *AccountUpdateOne
ClearNodes clears all "nodes" edges to the Node entity.
func (*AccountUpdateOne) ClearRegistrationToken ¶
func (auo *AccountUpdateOne) ClearRegistrationToken() *AccountUpdateOne
ClearRegistrationToken clears the "registration_token" edge to the RegistrationToken entity.
func (*AccountUpdateOne) ClearRegistrationTokenID ¶
func (auo *AccountUpdateOne) ClearRegistrationTokenID() *AccountUpdateOne
ClearRegistrationTokenID clears the value of the "registration_token_id" field.
func (*AccountUpdateOne) ClearServers ¶
func (auo *AccountUpdateOne) ClearServers() *AccountUpdateOne
ClearServers clears all "servers" edges to the Server entity.
func (*AccountUpdateOne) Exec ¶
func (auo *AccountUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*AccountUpdateOne) ExecX ¶
func (auo *AccountUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AccountUpdateOne) Mutation ¶
func (auo *AccountUpdateOne) Mutation() *AccountMutation
Mutation returns the AccountMutation object of the builder.
func (*AccountUpdateOne) RemoveNodeIDs ¶
func (auo *AccountUpdateOne) RemoveNodeIDs(ids ...int) *AccountUpdateOne
RemoveNodeIDs removes the "nodes" edge to Node entities by IDs.
func (*AccountUpdateOne) RemoveNodes ¶
func (auo *AccountUpdateOne) RemoveNodes(n ...*Node) *AccountUpdateOne
RemoveNodes removes "nodes" edges to Node entities.
func (*AccountUpdateOne) RemoveServerIDs ¶
func (auo *AccountUpdateOne) RemoveServerIDs(ids ...int) *AccountUpdateOne
RemoveServerIDs removes the "servers" edge to Server entities by IDs.
func (*AccountUpdateOne) RemoveServers ¶
func (auo *AccountUpdateOne) RemoveServers(s ...*Server) *AccountUpdateOne
RemoveServers removes "servers" edges to Server entities.
func (*AccountUpdateOne) Save ¶
func (auo *AccountUpdateOne) Save(ctx context.Context) (*Account, error)
Save executes the query and returns the updated Account entity.
func (*AccountUpdateOne) SaveX ¶
func (auo *AccountUpdateOne) SaveX(ctx context.Context) *Account
SaveX is like Save, but panics if an error occurs.
func (*AccountUpdateOne) Select ¶
func (auo *AccountUpdateOne) Select(field string, fields ...string) *AccountUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*AccountUpdateOne) SetAccessToken ¶
func (auo *AccountUpdateOne) SetAccessToken(b []byte) *AccountUpdateOne
SetAccessToken sets the "access_token" field.
func (*AccountUpdateOne) SetNillableRegistrationTokenID ¶
func (auo *AccountUpdateOne) SetNillableRegistrationTokenID(i *int) *AccountUpdateOne
SetNillableRegistrationTokenID sets the "registration_token_id" field if the given value is not nil.
func (*AccountUpdateOne) SetNillableUsername ¶
func (auo *AccountUpdateOne) SetNillableUsername(s *string) *AccountUpdateOne
SetNillableUsername sets the "username" field if the given value is not nil.
func (*AccountUpdateOne) SetRefreshToken ¶
func (auo *AccountUpdateOne) SetRefreshToken(b []byte) *AccountUpdateOne
SetRefreshToken sets the "refresh_token" field.
func (*AccountUpdateOne) SetRegistrationToken ¶
func (auo *AccountUpdateOne) SetRegistrationToken(r *RegistrationToken) *AccountUpdateOne
SetRegistrationToken sets the "registration_token" edge to the RegistrationToken entity.
func (*AccountUpdateOne) SetRegistrationTokenID ¶
func (auo *AccountUpdateOne) SetRegistrationTokenID(i int) *AccountUpdateOne
SetRegistrationTokenID sets the "registration_token_id" field.
func (*AccountUpdateOne) SetUpdateTime ¶
func (auo *AccountUpdateOne) SetUpdateTime(t time.Time) *AccountUpdateOne
SetUpdateTime sets the "update_time" field.
func (*AccountUpdateOne) SetUsername ¶
func (auo *AccountUpdateOne) SetUsername(s string) *AccountUpdateOne
SetUsername sets the "username" field.
func (*AccountUpdateOne) Where ¶
func (auo *AccountUpdateOne) Where(ps ...predicate.Account) *AccountUpdateOne
Where appends a list predicates to the AccountUpdate builder.
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
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 // Account is the client for interacting with the Account builders. Account *AccountClient // Node is the client for interacting with the Node builders. Node *NodeClient // RegistrationToken is the client for interacting with the RegistrationToken builders. RegistrationToken *RegistrationTokenClient // Server is the client for interacting with the Server builders. Server *ServerClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
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) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). Account. 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(...)`.
type CommitFunc ¶
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.
type CommitHook ¶
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 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 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 Node ¶
type Node struct { // ID of the ent. ID int `json:"id,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,omitempty"` // Name is the unique name of the node. 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) QueryAccount ¶
func (n *Node) QueryAccount() *AccountQuery
QueryAccount queries the "account" edge of the Node entity.
func (*Node) QueryServer ¶
func (n *Node) QueryServer() *ServerQuery
QueryServer queries the "server" edge of the Node entity.
func (*Node) Unwrap ¶
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.
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) GetX ¶
func (c *NodeClient) GetX(ctx context.Context, id int) *Node
GetX is like Get, but panics if an error occurs.
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) QueryAccount ¶
func (c *NodeClient) QueryAccount(n *Node) *AccountQuery
QueryAccount queries the account edge of a Node.
func (*NodeClient) QueryServer ¶
func (c *NodeClient) QueryServer(n *Node) *ServerQuery
QueryServer queries the server 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) SetAccount ¶
func (nc *NodeCreate) SetAccount(a *Account) *NodeCreate
SetAccount sets the "account" edge to the Account entity.
func (*NodeCreate) SetAccountID ¶
func (nc *NodeCreate) SetAccountID(id int) *NodeCreate
SetAccountID sets the "account" edge to the Account entity by ID.
func (*NodeCreate) SetCreateTime ¶
func (nc *NodeCreate) SetCreateTime(t time.Time) *NodeCreate
SetCreateTime sets the "create_time" field.
func (*NodeCreate) SetName ¶
func (nc *NodeCreate) SetName(s string) *NodeCreate
SetName sets the "name" field.
func (*NodeCreate) SetNillableCreateTime ¶
func (nc *NodeCreate) SetNillableCreateTime(t *time.Time) *NodeCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*NodeCreate) SetNillableUpdateTime ¶
func (nc *NodeCreate) SetNillableUpdateTime(t *time.Time) *NodeCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*NodeCreate) SetServer ¶
func (nc *NodeCreate) SetServer(s *Server) *NodeCreate
SetServer sets the "server" edge to the Server entity.
func (*NodeCreate) SetServerID ¶
func (nc *NodeCreate) SetServerID(id int) *NodeCreate
SetServerID sets the "server" edge to the Server entity by ID.
func (*NodeCreate) SetUpdateTime ¶
func (nc *NodeCreate) SetUpdateTime(t time.Time) *NodeCreate
SetUpdateTime sets the "update_time" field.
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.
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 { // Account holds the value of the account edge. Account *Account `json:"account,omitempty"` // Server holds the value of the server edge. Server *Server `json:"server,omitempty"` // contains filtered or unexported fields }
NodeEdges holds the relations/edges for other nodes in the graph.
func (NodeEdges) AccountOrErr ¶
AccountOrErr returns the Account value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (NodeEdges) ServerOrErr ¶
ServerOrErr returns the Server 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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*NodeGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*NodeGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*NodeGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*NodeGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*NodeGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
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) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type NodeMutation ¶
type NodeMutation struct {
// contains filtered or unexported fields
}
NodeMutation represents an operation that mutates the Node nodes in the graph.
func (*NodeMutation) AccountCleared ¶
func (m *NodeMutation) AccountCleared() bool
AccountCleared reports if the "account" edge to the Account entity was cleared.
func (*NodeMutation) AccountID ¶
func (m *NodeMutation) AccountID() (id int, exists bool)
AccountID returns the "account" edge ID in the mutation.
func (*NodeMutation) AccountIDs ¶
func (m *NodeMutation) AccountIDs() (ids []int)
AccountIDs returns the "account" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AccountID instead. It exists only for internal usage by the builders.
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) ClearAccount ¶
func (m *NodeMutation) ClearAccount()
ClearAccount clears the "account" edge to the Account entity.
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) ClearServer ¶
func (m *NodeMutation) ClearServer()
ClearServer clears the "server" edge to the Server 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) CreateTime ¶
func (m *NodeMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
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) 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) OldCreateTime ¶
OldCreateTime returns the old "create_time" 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) OldField ¶
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) 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) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" 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) 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) ResetAccount ¶
func (m *NodeMutation) ResetAccount()
ResetAccount resets all changes to the "account" edge.
func (*NodeMutation) ResetCreateTime ¶
func (m *NodeMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
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) ResetName ¶
func (m *NodeMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*NodeMutation) ResetServer ¶
func (m *NodeMutation) ResetServer()
ResetServer resets all changes to the "server" edge.
func (*NodeMutation) ResetUpdateTime ¶
func (m *NodeMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*NodeMutation) ServerCleared ¶
func (m *NodeMutation) ServerCleared() bool
ServerCleared reports if the "server" edge to the Server entity was cleared.
func (*NodeMutation) ServerID ¶
func (m *NodeMutation) ServerID() (id int, exists bool)
ServerID returns the "server" edge ID in the mutation.
func (*NodeMutation) ServerIDs ¶
func (m *NodeMutation) ServerIDs() (ids []int)
ServerIDs returns the "server" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ServerID instead. It exists only for internal usage by the builders.
func (*NodeMutation) SetAccountID ¶
func (m *NodeMutation) SetAccountID(id int)
SetAccountID sets the "account" edge to the Account entity by id.
func (*NodeMutation) SetCreateTime ¶
func (m *NodeMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
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) 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) SetServerID ¶
func (m *NodeMutation) SetServerID(id int)
SetServerID sets the "server" edge to the Server entity by id.
func (*NodeMutation) SetUpdateTime ¶
func (m *NodeMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
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) UpdateTime ¶
func (m *NodeMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
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) Clone ¶
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) First ¶
First returns the first Node entity from the query. Returns a *NotFoundError when no Node was found.
func (*NodeQuery) FirstID ¶
FirstID returns the first Node ID from the query. Returns a *NotFoundError when no Node ID was found.
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 { CreateTime time.Time `json:"create_time,omitempty"` Count int `json:"count,omitempty"` } client.Node.Query(). GroupBy(node.FieldCreateTime). Aggregate(ent.Count()). Scan(ctx, &v)
func (*NodeQuery) Only ¶
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 ¶
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) Order ¶
func (nq *NodeQuery) Order(o ...node.OrderOption) *NodeQuery
Order specifies how the records should be ordered.
func (*NodeQuery) QueryAccount ¶
func (nq *NodeQuery) QueryAccount() *AccountQuery
QueryAccount chains the current query on the "account" edge.
func (*NodeQuery) QueryServer ¶
func (nq *NodeQuery) QueryServer() *ServerQuery
QueryServer chains the current query on the "server" 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 { CreateTime time.Time `json:"create_time,omitempty"` } client.Node.Query(). Select(node.FieldCreateTime). Scan(ctx, &v)
func (*NodeQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*NodeQuery) WithAccount ¶
func (nq *NodeQuery) WithAccount(opts ...func(*AccountQuery)) *NodeQuery
WithAccount tells the query-builder to eager-load the nodes that are connected to the "account" edge. The optional arguments are used to configure the query builder of the edge.
func (*NodeQuery) WithServer ¶
func (nq *NodeQuery) WithServer(opts ...func(*ServerQuery)) *NodeQuery
WithServer tells the query-builder to eager-load the nodes that are connected to the "server" 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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*NodeSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*NodeSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*NodeSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*NodeSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*NodeSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
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) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type NodeUpdate ¶
type NodeUpdate struct {
// contains filtered or unexported fields
}
NodeUpdate is the builder for updating Node entities.
func (*NodeUpdate) ClearAccount ¶
func (nu *NodeUpdate) ClearAccount() *NodeUpdate
ClearAccount clears the "account" edge to the Account entity.
func (*NodeUpdate) ClearServer ¶
func (nu *NodeUpdate) ClearServer() *NodeUpdate
ClearServer clears the "server" edge to the Server 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) SetAccount ¶
func (nu *NodeUpdate) SetAccount(a *Account) *NodeUpdate
SetAccount sets the "account" edge to the Account entity.
func (*NodeUpdate) SetAccountID ¶
func (nu *NodeUpdate) SetAccountID(id int) *NodeUpdate
SetAccountID sets the "account" edge to the Account entity by ID.
func (*NodeUpdate) SetName ¶
func (nu *NodeUpdate) SetName(s string) *NodeUpdate
SetName sets the "name" field.
func (*NodeUpdate) SetNillableName ¶
func (nu *NodeUpdate) SetNillableName(s *string) *NodeUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*NodeUpdate) SetServer ¶
func (nu *NodeUpdate) SetServer(s *Server) *NodeUpdate
SetServer sets the "server" edge to the Server entity.
func (*NodeUpdate) SetServerID ¶
func (nu *NodeUpdate) SetServerID(id int) *NodeUpdate
SetServerID sets the "server" edge to the Server entity by ID.
func (*NodeUpdate) SetUpdateTime ¶
func (nu *NodeUpdate) SetUpdateTime(t time.Time) *NodeUpdate
SetUpdateTime sets the "update_time" field.
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) ClearAccount ¶
func (nuo *NodeUpdateOne) ClearAccount() *NodeUpdateOne
ClearAccount clears the "account" edge to the Account entity.
func (*NodeUpdateOne) ClearServer ¶
func (nuo *NodeUpdateOne) ClearServer() *NodeUpdateOne
ClearServer clears the "server" edge to the Server 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) SetAccount ¶
func (nuo *NodeUpdateOne) SetAccount(a *Account) *NodeUpdateOne
SetAccount sets the "account" edge to the Account entity.
func (*NodeUpdateOne) SetAccountID ¶
func (nuo *NodeUpdateOne) SetAccountID(id int) *NodeUpdateOne
SetAccountID sets the "account" edge to the Account entity by ID.
func (*NodeUpdateOne) SetName ¶
func (nuo *NodeUpdateOne) SetName(s string) *NodeUpdateOne
SetName sets the "name" field.
func (*NodeUpdateOne) SetNillableName ¶
func (nuo *NodeUpdateOne) SetNillableName(s *string) *NodeUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*NodeUpdateOne) SetServer ¶
func (nuo *NodeUpdateOne) SetServer(s *Server) *NodeUpdateOne
SetServer sets the "server" edge to the Server entity.
func (*NodeUpdateOne) SetServerID ¶
func (nuo *NodeUpdateOne) SetServerID(id int) *NodeUpdateOne
SetServerID sets the "server" edge to the Server entity by ID.
func (*NodeUpdateOne) SetUpdateTime ¶
func (nuo *NodeUpdateOne) SetUpdateTime(t time.Time) *NodeUpdateOne
SetUpdateTime sets the "update_time" field.
func (*NodeUpdateOne) Where ¶
func (nuo *NodeUpdateOne) Where(ps ...predicate.Node) *NodeUpdateOne
Where appends a list predicates to the NodeUpdate builder.
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 OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
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 RegistrationToken ¶
type RegistrationToken struct { // ID of the ent. ID int `json:"id,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,omitempty"` // Name is the unique name of the registration token. Name string `json:"name,omitempty"` // Token is the registration token. Token []byte `json:"token,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the RegistrationTokenQuery when eager-loading is set. Edges RegistrationTokenEdges `json:"edges"` // contains filtered or unexported fields }
RegistrationToken is the model entity for the RegistrationToken schema.
func (*RegistrationToken) QueryRegistrations ¶
func (rt *RegistrationToken) QueryRegistrations() *AccountQuery
QueryRegistrations queries the "registrations" edge of the RegistrationToken entity.
func (*RegistrationToken) String ¶
func (rt *RegistrationToken) String() string
String implements the fmt.Stringer.
func (*RegistrationToken) Unwrap ¶
func (rt *RegistrationToken) Unwrap() *RegistrationToken
Unwrap unwraps the RegistrationToken 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 (*RegistrationToken) Update ¶
func (rt *RegistrationToken) Update() *RegistrationTokenUpdateOne
Update returns a builder for updating this RegistrationToken. Note that you need to call RegistrationToken.Unwrap() before calling this method if this RegistrationToken was returned from a transaction, and the transaction was committed or rolled back.
type RegistrationTokenClient ¶
type RegistrationTokenClient struct {
// contains filtered or unexported fields
}
RegistrationTokenClient is a client for the RegistrationToken schema.
func NewRegistrationTokenClient ¶
func NewRegistrationTokenClient(c config) *RegistrationTokenClient
NewRegistrationTokenClient returns a client for the RegistrationToken from the given config.
func (*RegistrationTokenClient) Create ¶
func (c *RegistrationTokenClient) Create() *RegistrationTokenCreate
Create returns a builder for creating a RegistrationToken entity.
func (*RegistrationTokenClient) CreateBulk ¶
func (c *RegistrationTokenClient) CreateBulk(builders ...*RegistrationTokenCreate) *RegistrationTokenCreateBulk
CreateBulk returns a builder for creating a bulk of RegistrationToken entities.
func (*RegistrationTokenClient) Delete ¶
func (c *RegistrationTokenClient) Delete() *RegistrationTokenDelete
Delete returns a delete builder for RegistrationToken.
func (*RegistrationTokenClient) DeleteOne ¶
func (c *RegistrationTokenClient) DeleteOne(rt *RegistrationToken) *RegistrationTokenDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*RegistrationTokenClient) DeleteOneID ¶
func (c *RegistrationTokenClient) DeleteOneID(id int) *RegistrationTokenDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*RegistrationTokenClient) Get ¶
func (c *RegistrationTokenClient) Get(ctx context.Context, id int) (*RegistrationToken, error)
Get returns a RegistrationToken entity by its id.
func (*RegistrationTokenClient) GetX ¶
func (c *RegistrationTokenClient) GetX(ctx context.Context, id int) *RegistrationToken
GetX is like Get, but panics if an error occurs.
func (*RegistrationTokenClient) Hooks ¶
func (c *RegistrationTokenClient) Hooks() []Hook
Hooks returns the client hooks.
func (*RegistrationTokenClient) Intercept ¶
func (c *RegistrationTokenClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `registrationtoken.Intercept(f(g(h())))`.
func (*RegistrationTokenClient) Interceptors ¶
func (c *RegistrationTokenClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*RegistrationTokenClient) MapCreateBulk ¶
func (c *RegistrationTokenClient) MapCreateBulk(slice any, setFunc func(*RegistrationTokenCreate, int)) *RegistrationTokenCreateBulk
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 (*RegistrationTokenClient) Query ¶
func (c *RegistrationTokenClient) Query() *RegistrationTokenQuery
Query returns a query builder for RegistrationToken.
func (*RegistrationTokenClient) QueryRegistrations ¶
func (c *RegistrationTokenClient) QueryRegistrations(rt *RegistrationToken) *AccountQuery
QueryRegistrations queries the registrations edge of a RegistrationToken.
func (*RegistrationTokenClient) Update ¶
func (c *RegistrationTokenClient) Update() *RegistrationTokenUpdate
Update returns an update builder for RegistrationToken.
func (*RegistrationTokenClient) UpdateOne ¶
func (c *RegistrationTokenClient) UpdateOne(rt *RegistrationToken) *RegistrationTokenUpdateOne
UpdateOne returns an update builder for the given entity.
func (*RegistrationTokenClient) UpdateOneID ¶
func (c *RegistrationTokenClient) UpdateOneID(id int) *RegistrationTokenUpdateOne
UpdateOneID returns an update builder for the given id.
func (*RegistrationTokenClient) Use ¶
func (c *RegistrationTokenClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `registrationtoken.Hooks(f(g(h())))`.
type RegistrationTokenCreate ¶
type RegistrationTokenCreate struct {
// contains filtered or unexported fields
}
RegistrationTokenCreate is the builder for creating a RegistrationToken entity.
func (*RegistrationTokenCreate) AddRegistrationIDs ¶
func (rtc *RegistrationTokenCreate) AddRegistrationIDs(ids ...int) *RegistrationTokenCreate
AddRegistrationIDs adds the "registrations" edge to the Account entity by IDs.
func (*RegistrationTokenCreate) AddRegistrations ¶
func (rtc *RegistrationTokenCreate) AddRegistrations(a ...*Account) *RegistrationTokenCreate
AddRegistrations adds the "registrations" edges to the Account entity.
func (*RegistrationTokenCreate) Exec ¶
func (rtc *RegistrationTokenCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*RegistrationTokenCreate) ExecX ¶
func (rtc *RegistrationTokenCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RegistrationTokenCreate) Mutation ¶
func (rtc *RegistrationTokenCreate) Mutation() *RegistrationTokenMutation
Mutation returns the RegistrationTokenMutation object of the builder.
func (*RegistrationTokenCreate) Save ¶
func (rtc *RegistrationTokenCreate) Save(ctx context.Context) (*RegistrationToken, error)
Save creates the RegistrationToken in the database.
func (*RegistrationTokenCreate) SaveX ¶
func (rtc *RegistrationTokenCreate) SaveX(ctx context.Context) *RegistrationToken
SaveX calls Save and panics if Save returns an error.
func (*RegistrationTokenCreate) SetCreateTime ¶
func (rtc *RegistrationTokenCreate) SetCreateTime(t time.Time) *RegistrationTokenCreate
SetCreateTime sets the "create_time" field.
func (*RegistrationTokenCreate) SetName ¶
func (rtc *RegistrationTokenCreate) SetName(s string) *RegistrationTokenCreate
SetName sets the "name" field.
func (*RegistrationTokenCreate) SetNillableCreateTime ¶
func (rtc *RegistrationTokenCreate) SetNillableCreateTime(t *time.Time) *RegistrationTokenCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*RegistrationTokenCreate) SetNillableUpdateTime ¶
func (rtc *RegistrationTokenCreate) SetNillableUpdateTime(t *time.Time) *RegistrationTokenCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*RegistrationTokenCreate) SetToken ¶
func (rtc *RegistrationTokenCreate) SetToken(b []byte) *RegistrationTokenCreate
SetToken sets the "token" field.
func (*RegistrationTokenCreate) SetUpdateTime ¶
func (rtc *RegistrationTokenCreate) SetUpdateTime(t time.Time) *RegistrationTokenCreate
SetUpdateTime sets the "update_time" field.
type RegistrationTokenCreateBulk ¶
type RegistrationTokenCreateBulk struct {
// contains filtered or unexported fields
}
RegistrationTokenCreateBulk is the builder for creating many RegistrationToken entities in bulk.
func (*RegistrationTokenCreateBulk) Exec ¶
func (rtcb *RegistrationTokenCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*RegistrationTokenCreateBulk) ExecX ¶
func (rtcb *RegistrationTokenCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RegistrationTokenCreateBulk) Save ¶
func (rtcb *RegistrationTokenCreateBulk) Save(ctx context.Context) ([]*RegistrationToken, error)
Save creates the RegistrationToken entities in the database.
func (*RegistrationTokenCreateBulk) SaveX ¶
func (rtcb *RegistrationTokenCreateBulk) SaveX(ctx context.Context) []*RegistrationToken
SaveX is like Save, but panics if an error occurs.
type RegistrationTokenDelete ¶
type RegistrationTokenDelete struct {
// contains filtered or unexported fields
}
RegistrationTokenDelete is the builder for deleting a RegistrationToken entity.
func (*RegistrationTokenDelete) Exec ¶
func (rtd *RegistrationTokenDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*RegistrationTokenDelete) ExecX ¶
func (rtd *RegistrationTokenDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*RegistrationTokenDelete) Where ¶
func (rtd *RegistrationTokenDelete) Where(ps ...predicate.RegistrationToken) *RegistrationTokenDelete
Where appends a list predicates to the RegistrationTokenDelete builder.
type RegistrationTokenDeleteOne ¶
type RegistrationTokenDeleteOne struct {
// contains filtered or unexported fields
}
RegistrationTokenDeleteOne is the builder for deleting a single RegistrationToken entity.
func (*RegistrationTokenDeleteOne) Exec ¶
func (rtdo *RegistrationTokenDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*RegistrationTokenDeleteOne) ExecX ¶
func (rtdo *RegistrationTokenDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RegistrationTokenDeleteOne) Where ¶
func (rtdo *RegistrationTokenDeleteOne) Where(ps ...predicate.RegistrationToken) *RegistrationTokenDeleteOne
Where appends a list predicates to the RegistrationTokenDelete builder.
type RegistrationTokenEdges ¶
type RegistrationTokenEdges struct { // Registrations holds the value of the registrations edge. Registrations []*Account `json:"registrations,omitempty"` // contains filtered or unexported fields }
RegistrationTokenEdges holds the relations/edges for other nodes in the graph.
func (RegistrationTokenEdges) RegistrationsOrErr ¶
func (e RegistrationTokenEdges) RegistrationsOrErr() ([]*Account, error)
RegistrationsOrErr returns the Registrations value or an error if the edge was not loaded in eager-loading.
type RegistrationTokenGroupBy ¶
type RegistrationTokenGroupBy struct {
// contains filtered or unexported fields
}
RegistrationTokenGroupBy is the group-by builder for RegistrationToken entities.
func (*RegistrationTokenGroupBy) Aggregate ¶
func (rtgb *RegistrationTokenGroupBy) Aggregate(fns ...AggregateFunc) *RegistrationTokenGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*RegistrationTokenGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RegistrationTokenGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RegistrationTokenGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RegistrationTokenGroupBy) Float64X ¶
Float64X is like Float64, but panics if an error occurs.
func (*RegistrationTokenGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RegistrationTokenGroupBy) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*RegistrationTokenGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RegistrationTokenGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RegistrationTokenGroupBy) Scan ¶
func (rtgb *RegistrationTokenGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*RegistrationTokenGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RegistrationTokenMutation ¶
type RegistrationTokenMutation struct {
// contains filtered or unexported fields
}
RegistrationTokenMutation represents an operation that mutates the RegistrationToken nodes in the graph.
func (*RegistrationTokenMutation) AddField ¶
func (m *RegistrationTokenMutation) 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 (*RegistrationTokenMutation) AddRegistrationIDs ¶
func (m *RegistrationTokenMutation) AddRegistrationIDs(ids ...int)
AddRegistrationIDs adds the "registrations" edge to the Account entity by ids.
func (*RegistrationTokenMutation) AddedEdges ¶
func (m *RegistrationTokenMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*RegistrationTokenMutation) AddedField ¶
func (m *RegistrationTokenMutation) 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 (*RegistrationTokenMutation) AddedFields ¶
func (m *RegistrationTokenMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*RegistrationTokenMutation) AddedIDs ¶
func (m *RegistrationTokenMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*RegistrationTokenMutation) ClearEdge ¶
func (m *RegistrationTokenMutation) 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 (*RegistrationTokenMutation) ClearField ¶
func (m *RegistrationTokenMutation) 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 (*RegistrationTokenMutation) ClearRegistrations ¶
func (m *RegistrationTokenMutation) ClearRegistrations()
ClearRegistrations clears the "registrations" edge to the Account entity.
func (*RegistrationTokenMutation) ClearedEdges ¶
func (m *RegistrationTokenMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*RegistrationTokenMutation) ClearedFields ¶
func (m *RegistrationTokenMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (RegistrationTokenMutation) Client ¶
func (m RegistrationTokenMutation) 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 (*RegistrationTokenMutation) CreateTime ¶
func (m *RegistrationTokenMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*RegistrationTokenMutation) EdgeCleared ¶
func (m *RegistrationTokenMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*RegistrationTokenMutation) Field ¶
func (m *RegistrationTokenMutation) 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 (*RegistrationTokenMutation) FieldCleared ¶
func (m *RegistrationTokenMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*RegistrationTokenMutation) Fields ¶
func (m *RegistrationTokenMutation) 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 (*RegistrationTokenMutation) ID ¶
func (m *RegistrationTokenMutation) 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 (*RegistrationTokenMutation) IDs ¶
func (m *RegistrationTokenMutation) 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 (*RegistrationTokenMutation) Name ¶
func (m *RegistrationTokenMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*RegistrationTokenMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the RegistrationToken entity. If the RegistrationToken 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 (*RegistrationTokenMutation) OldField ¶
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 (*RegistrationTokenMutation) OldName ¶
func (m *RegistrationTokenMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the RegistrationToken entity. If the RegistrationToken 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 (*RegistrationTokenMutation) OldToken ¶
func (m *RegistrationTokenMutation) OldToken(ctx context.Context) (v []byte, err error)
OldToken returns the old "token" field's value of the RegistrationToken entity. If the RegistrationToken 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 (*RegistrationTokenMutation) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" field's value of the RegistrationToken entity. If the RegistrationToken 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 (*RegistrationTokenMutation) Op ¶
func (m *RegistrationTokenMutation) Op() Op
Op returns the operation name.
func (*RegistrationTokenMutation) RegistrationsCleared ¶
func (m *RegistrationTokenMutation) RegistrationsCleared() bool
RegistrationsCleared reports if the "registrations" edge to the Account entity was cleared.
func (*RegistrationTokenMutation) RegistrationsIDs ¶
func (m *RegistrationTokenMutation) RegistrationsIDs() (ids []int)
RegistrationsIDs returns the "registrations" edge IDs in the mutation.
func (*RegistrationTokenMutation) RemoveRegistrationIDs ¶
func (m *RegistrationTokenMutation) RemoveRegistrationIDs(ids ...int)
RemoveRegistrationIDs removes the "registrations" edge to the Account entity by IDs.
func (*RegistrationTokenMutation) RemovedEdges ¶
func (m *RegistrationTokenMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*RegistrationTokenMutation) RemovedIDs ¶
func (m *RegistrationTokenMutation) 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 (*RegistrationTokenMutation) RemovedRegistrationsIDs ¶
func (m *RegistrationTokenMutation) RemovedRegistrationsIDs() (ids []int)
RemovedRegistrations returns the removed IDs of the "registrations" edge to the Account entity.
func (*RegistrationTokenMutation) ResetCreateTime ¶
func (m *RegistrationTokenMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*RegistrationTokenMutation) ResetEdge ¶
func (m *RegistrationTokenMutation) 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 (*RegistrationTokenMutation) ResetField ¶
func (m *RegistrationTokenMutation) 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 (*RegistrationTokenMutation) ResetName ¶
func (m *RegistrationTokenMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*RegistrationTokenMutation) ResetRegistrations ¶
func (m *RegistrationTokenMutation) ResetRegistrations()
ResetRegistrations resets all changes to the "registrations" edge.
func (*RegistrationTokenMutation) ResetToken ¶
func (m *RegistrationTokenMutation) ResetToken()
ResetToken resets all changes to the "token" field.
func (*RegistrationTokenMutation) ResetUpdateTime ¶
func (m *RegistrationTokenMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*RegistrationTokenMutation) SetCreateTime ¶
func (m *RegistrationTokenMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*RegistrationTokenMutation) SetField ¶
func (m *RegistrationTokenMutation) 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 (*RegistrationTokenMutation) SetName ¶
func (m *RegistrationTokenMutation) SetName(s string)
SetName sets the "name" field.
func (*RegistrationTokenMutation) SetOp ¶
func (m *RegistrationTokenMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*RegistrationTokenMutation) SetToken ¶
func (m *RegistrationTokenMutation) SetToken(b []byte)
SetToken sets the "token" field.
func (*RegistrationTokenMutation) SetUpdateTime ¶
func (m *RegistrationTokenMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (*RegistrationTokenMutation) Token ¶
func (m *RegistrationTokenMutation) Token() (r []byte, exists bool)
Token returns the value of the "token" field in the mutation.
func (RegistrationTokenMutation) Tx ¶
func (m RegistrationTokenMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*RegistrationTokenMutation) Type ¶
func (m *RegistrationTokenMutation) Type() string
Type returns the node type of this mutation (RegistrationToken).
func (*RegistrationTokenMutation) UpdateTime ¶
func (m *RegistrationTokenMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*RegistrationTokenMutation) Where ¶
func (m *RegistrationTokenMutation) Where(ps ...predicate.RegistrationToken)
Where appends a list predicates to the RegistrationTokenMutation builder.
func (*RegistrationTokenMutation) WhereP ¶
func (m *RegistrationTokenMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the RegistrationTokenMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type RegistrationTokenQuery ¶
type RegistrationTokenQuery struct {
// contains filtered or unexported fields
}
RegistrationTokenQuery is the builder for querying RegistrationToken entities.
func (*RegistrationTokenQuery) Aggregate ¶
func (rtq *RegistrationTokenQuery) Aggregate(fns ...AggregateFunc) *RegistrationTokenSelect
Aggregate returns a RegistrationTokenSelect configured with the given aggregations.
func (*RegistrationTokenQuery) All ¶
func (rtq *RegistrationTokenQuery) All(ctx context.Context) ([]*RegistrationToken, error)
All executes the query and returns a list of RegistrationTokens.
func (*RegistrationTokenQuery) AllX ¶
func (rtq *RegistrationTokenQuery) AllX(ctx context.Context) []*RegistrationToken
AllX is like All, but panics if an error occurs.
func (*RegistrationTokenQuery) Clone ¶
func (rtq *RegistrationTokenQuery) Clone() *RegistrationTokenQuery
Clone returns a duplicate of the RegistrationTokenQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*RegistrationTokenQuery) Count ¶
func (rtq *RegistrationTokenQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*RegistrationTokenQuery) CountX ¶
func (rtq *RegistrationTokenQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*RegistrationTokenQuery) Exist ¶
func (rtq *RegistrationTokenQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*RegistrationTokenQuery) ExistX ¶
func (rtq *RegistrationTokenQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*RegistrationTokenQuery) First ¶
func (rtq *RegistrationTokenQuery) First(ctx context.Context) (*RegistrationToken, error)
First returns the first RegistrationToken entity from the query. Returns a *NotFoundError when no RegistrationToken was found.
func (*RegistrationTokenQuery) FirstID ¶
func (rtq *RegistrationTokenQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first RegistrationToken ID from the query. Returns a *NotFoundError when no RegistrationToken ID was found.
func (*RegistrationTokenQuery) FirstIDX ¶
func (rtq *RegistrationTokenQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*RegistrationTokenQuery) FirstX ¶
func (rtq *RegistrationTokenQuery) FirstX(ctx context.Context) *RegistrationToken
FirstX is like First, but panics if an error occurs.
func (*RegistrationTokenQuery) GroupBy ¶
func (rtq *RegistrationTokenQuery) GroupBy(field string, fields ...string) *RegistrationTokenGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreateTime time.Time `json:"create_time,omitempty"` Count int `json:"count,omitempty"` } client.RegistrationToken.Query(). GroupBy(registrationtoken.FieldCreateTime). Aggregate(ent.Count()). Scan(ctx, &v)
func (*RegistrationTokenQuery) IDs ¶
func (rtq *RegistrationTokenQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of RegistrationToken IDs.
func (*RegistrationTokenQuery) IDsX ¶
func (rtq *RegistrationTokenQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*RegistrationTokenQuery) Limit ¶
func (rtq *RegistrationTokenQuery) Limit(limit int) *RegistrationTokenQuery
Limit the number of records to be returned by this query.
func (*RegistrationTokenQuery) Offset ¶
func (rtq *RegistrationTokenQuery) Offset(offset int) *RegistrationTokenQuery
Offset to start from.
func (*RegistrationTokenQuery) Only ¶
func (rtq *RegistrationTokenQuery) Only(ctx context.Context) (*RegistrationToken, error)
Only returns a single RegistrationToken entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one RegistrationToken entity is found. Returns a *NotFoundError when no RegistrationToken entities are found.
func (*RegistrationTokenQuery) OnlyID ¶
func (rtq *RegistrationTokenQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only RegistrationToken ID in the query. Returns a *NotSingularError when more than one RegistrationToken ID is found. Returns a *NotFoundError when no entities are found.
func (*RegistrationTokenQuery) OnlyIDX ¶
func (rtq *RegistrationTokenQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*RegistrationTokenQuery) OnlyX ¶
func (rtq *RegistrationTokenQuery) OnlyX(ctx context.Context) *RegistrationToken
OnlyX is like Only, but panics if an error occurs.
func (*RegistrationTokenQuery) Order ¶
func (rtq *RegistrationTokenQuery) Order(o ...registrationtoken.OrderOption) *RegistrationTokenQuery
Order specifies how the records should be ordered.
func (*RegistrationTokenQuery) QueryRegistrations ¶
func (rtq *RegistrationTokenQuery) QueryRegistrations() *AccountQuery
QueryRegistrations chains the current query on the "registrations" edge.
func (*RegistrationTokenQuery) Select ¶
func (rtq *RegistrationTokenQuery) Select(fields ...string) *RegistrationTokenSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreateTime time.Time `json:"create_time,omitempty"` } client.RegistrationToken.Query(). Select(registrationtoken.FieldCreateTime). Scan(ctx, &v)
func (*RegistrationTokenQuery) Unique ¶
func (rtq *RegistrationTokenQuery) Unique(unique bool) *RegistrationTokenQuery
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 (*RegistrationTokenQuery) Where ¶
func (rtq *RegistrationTokenQuery) Where(ps ...predicate.RegistrationToken) *RegistrationTokenQuery
Where adds a new predicate for the RegistrationTokenQuery builder.
func (*RegistrationTokenQuery) WithRegistrations ¶
func (rtq *RegistrationTokenQuery) WithRegistrations(opts ...func(*AccountQuery)) *RegistrationTokenQuery
WithRegistrations tells the query-builder to eager-load the nodes that are connected to the "registrations" edge. The optional arguments are used to configure the query builder of the edge.
type RegistrationTokenSelect ¶
type RegistrationTokenSelect struct { *RegistrationTokenQuery // contains filtered or unexported fields }
RegistrationTokenSelect is the builder for selecting fields of RegistrationToken entities.
func (*RegistrationTokenSelect) Aggregate ¶
func (rts *RegistrationTokenSelect) Aggregate(fns ...AggregateFunc) *RegistrationTokenSelect
Aggregate adds the given aggregation functions to the selector query.
func (*RegistrationTokenSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RegistrationTokenSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RegistrationTokenSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RegistrationTokenSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RegistrationTokenSelect) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*RegistrationTokenSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RegistrationTokenSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RegistrationTokenSelect) Scan ¶
func (rts *RegistrationTokenSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*RegistrationTokenSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RegistrationTokenUpdate ¶
type RegistrationTokenUpdate struct {
// contains filtered or unexported fields
}
RegistrationTokenUpdate is the builder for updating RegistrationToken entities.
func (*RegistrationTokenUpdate) AddRegistrationIDs ¶
func (rtu *RegistrationTokenUpdate) AddRegistrationIDs(ids ...int) *RegistrationTokenUpdate
AddRegistrationIDs adds the "registrations" edge to the Account entity by IDs.
func (*RegistrationTokenUpdate) AddRegistrations ¶
func (rtu *RegistrationTokenUpdate) AddRegistrations(a ...*Account) *RegistrationTokenUpdate
AddRegistrations adds the "registrations" edges to the Account entity.
func (*RegistrationTokenUpdate) ClearRegistrations ¶
func (rtu *RegistrationTokenUpdate) ClearRegistrations() *RegistrationTokenUpdate
ClearRegistrations clears all "registrations" edges to the Account entity.
func (*RegistrationTokenUpdate) Exec ¶
func (rtu *RegistrationTokenUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*RegistrationTokenUpdate) ExecX ¶
func (rtu *RegistrationTokenUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RegistrationTokenUpdate) Mutation ¶
func (rtu *RegistrationTokenUpdate) Mutation() *RegistrationTokenMutation
Mutation returns the RegistrationTokenMutation object of the builder.
func (*RegistrationTokenUpdate) RemoveRegistrationIDs ¶
func (rtu *RegistrationTokenUpdate) RemoveRegistrationIDs(ids ...int) *RegistrationTokenUpdate
RemoveRegistrationIDs removes the "registrations" edge to Account entities by IDs.
func (*RegistrationTokenUpdate) RemoveRegistrations ¶
func (rtu *RegistrationTokenUpdate) RemoveRegistrations(a ...*Account) *RegistrationTokenUpdate
RemoveRegistrations removes "registrations" edges to Account entities.
func (*RegistrationTokenUpdate) Save ¶
func (rtu *RegistrationTokenUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*RegistrationTokenUpdate) SaveX ¶
func (rtu *RegistrationTokenUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*RegistrationTokenUpdate) SetName ¶
func (rtu *RegistrationTokenUpdate) SetName(s string) *RegistrationTokenUpdate
SetName sets the "name" field.
func (*RegistrationTokenUpdate) SetNillableName ¶
func (rtu *RegistrationTokenUpdate) SetNillableName(s *string) *RegistrationTokenUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*RegistrationTokenUpdate) SetToken ¶
func (rtu *RegistrationTokenUpdate) SetToken(b []byte) *RegistrationTokenUpdate
SetToken sets the "token" field.
func (*RegistrationTokenUpdate) SetUpdateTime ¶
func (rtu *RegistrationTokenUpdate) SetUpdateTime(t time.Time) *RegistrationTokenUpdate
SetUpdateTime sets the "update_time" field.
func (*RegistrationTokenUpdate) Where ¶
func (rtu *RegistrationTokenUpdate) Where(ps ...predicate.RegistrationToken) *RegistrationTokenUpdate
Where appends a list predicates to the RegistrationTokenUpdate builder.
type RegistrationTokenUpdateOne ¶
type RegistrationTokenUpdateOne struct {
// contains filtered or unexported fields
}
RegistrationTokenUpdateOne is the builder for updating a single RegistrationToken entity.
func (*RegistrationTokenUpdateOne) AddRegistrationIDs ¶
func (rtuo *RegistrationTokenUpdateOne) AddRegistrationIDs(ids ...int) *RegistrationTokenUpdateOne
AddRegistrationIDs adds the "registrations" edge to the Account entity by IDs.
func (*RegistrationTokenUpdateOne) AddRegistrations ¶
func (rtuo *RegistrationTokenUpdateOne) AddRegistrations(a ...*Account) *RegistrationTokenUpdateOne
AddRegistrations adds the "registrations" edges to the Account entity.
func (*RegistrationTokenUpdateOne) ClearRegistrations ¶
func (rtuo *RegistrationTokenUpdateOne) ClearRegistrations() *RegistrationTokenUpdateOne
ClearRegistrations clears all "registrations" edges to the Account entity.
func (*RegistrationTokenUpdateOne) Exec ¶
func (rtuo *RegistrationTokenUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*RegistrationTokenUpdateOne) ExecX ¶
func (rtuo *RegistrationTokenUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RegistrationTokenUpdateOne) Mutation ¶
func (rtuo *RegistrationTokenUpdateOne) Mutation() *RegistrationTokenMutation
Mutation returns the RegistrationTokenMutation object of the builder.
func (*RegistrationTokenUpdateOne) RemoveRegistrationIDs ¶
func (rtuo *RegistrationTokenUpdateOne) RemoveRegistrationIDs(ids ...int) *RegistrationTokenUpdateOne
RemoveRegistrationIDs removes the "registrations" edge to Account entities by IDs.
func (*RegistrationTokenUpdateOne) RemoveRegistrations ¶
func (rtuo *RegistrationTokenUpdateOne) RemoveRegistrations(a ...*Account) *RegistrationTokenUpdateOne
RemoveRegistrations removes "registrations" edges to Account entities.
func (*RegistrationTokenUpdateOne) Save ¶
func (rtuo *RegistrationTokenUpdateOne) Save(ctx context.Context) (*RegistrationToken, error)
Save executes the query and returns the updated RegistrationToken entity.
func (*RegistrationTokenUpdateOne) SaveX ¶
func (rtuo *RegistrationTokenUpdateOne) SaveX(ctx context.Context) *RegistrationToken
SaveX is like Save, but panics if an error occurs.
func (*RegistrationTokenUpdateOne) Select ¶
func (rtuo *RegistrationTokenUpdateOne) Select(field string, fields ...string) *RegistrationTokenUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*RegistrationTokenUpdateOne) SetName ¶
func (rtuo *RegistrationTokenUpdateOne) SetName(s string) *RegistrationTokenUpdateOne
SetName sets the "name" field.
func (*RegistrationTokenUpdateOne) SetNillableName ¶
func (rtuo *RegistrationTokenUpdateOne) SetNillableName(s *string) *RegistrationTokenUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*RegistrationTokenUpdateOne) SetToken ¶
func (rtuo *RegistrationTokenUpdateOne) SetToken(b []byte) *RegistrationTokenUpdateOne
SetToken sets the "token" field.
func (*RegistrationTokenUpdateOne) SetUpdateTime ¶
func (rtuo *RegistrationTokenUpdateOne) SetUpdateTime(t time.Time) *RegistrationTokenUpdateOne
SetUpdateTime sets the "update_time" field.
func (*RegistrationTokenUpdateOne) Where ¶
func (rtuo *RegistrationTokenUpdateOne) Where(ps ...predicate.RegistrationToken) *RegistrationTokenUpdateOne
Where appends a list predicates to the RegistrationTokenUpdate builder.
type RegistrationTokens ¶
type RegistrationTokens []*RegistrationToken
RegistrationTokens is a parsable slice of RegistrationToken.
type RollbackFunc ¶
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.
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 ¶
Rollbacker is the interface that wraps the Rollback method.
type Server ¶
type Server struct { // ID of the ent. ID int `json:"id,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,omitempty"` // Name is the unique name of the server. Name string `json:"name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ServerQuery when eager-loading is set. Edges ServerEdges `json:"edges"` // contains filtered or unexported fields }
Server is the model entity for the Server schema.
func (*Server) QueryAccount ¶
func (s *Server) QueryAccount() *AccountQuery
QueryAccount queries the "account" edge of the Server entity.
func (*Server) QueryNodes ¶
QueryNodes queries the "nodes" edge of the Server entity.
func (*Server) Unwrap ¶
Unwrap unwraps the Server 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 (*Server) Update ¶
func (s *Server) Update() *ServerUpdateOne
Update returns a builder for updating this Server. Note that you need to call Server.Unwrap() before calling this method if this Server was returned from a transaction, and the transaction was committed or rolled back.
type ServerClient ¶
type ServerClient struct {
// contains filtered or unexported fields
}
ServerClient is a client for the Server schema.
func NewServerClient ¶
func NewServerClient(c config) *ServerClient
NewServerClient returns a client for the Server from the given config.
func (*ServerClient) Create ¶
func (c *ServerClient) Create() *ServerCreate
Create returns a builder for creating a Server entity.
func (*ServerClient) CreateBulk ¶
func (c *ServerClient) CreateBulk(builders ...*ServerCreate) *ServerCreateBulk
CreateBulk returns a builder for creating a bulk of Server entities.
func (*ServerClient) Delete ¶
func (c *ServerClient) Delete() *ServerDelete
Delete returns a delete builder for Server.
func (*ServerClient) DeleteOne ¶
func (c *ServerClient) DeleteOne(s *Server) *ServerDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ServerClient) DeleteOneID ¶
func (c *ServerClient) DeleteOneID(id int) *ServerDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ServerClient) GetX ¶
func (c *ServerClient) GetX(ctx context.Context, id int) *Server
GetX is like Get, but panics if an error occurs.
func (*ServerClient) Intercept ¶
func (c *ServerClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `server.Intercept(f(g(h())))`.
func (*ServerClient) Interceptors ¶
func (c *ServerClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ServerClient) MapCreateBulk ¶
func (c *ServerClient) MapCreateBulk(slice any, setFunc func(*ServerCreate, int)) *ServerCreateBulk
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 (*ServerClient) Query ¶
func (c *ServerClient) Query() *ServerQuery
Query returns a query builder for Server.
func (*ServerClient) QueryAccount ¶
func (c *ServerClient) QueryAccount(s *Server) *AccountQuery
QueryAccount queries the account edge of a Server.
func (*ServerClient) QueryNodes ¶
func (c *ServerClient) QueryNodes(s *Server) *NodeQuery
QueryNodes queries the nodes edge of a Server.
func (*ServerClient) Update ¶
func (c *ServerClient) Update() *ServerUpdate
Update returns an update builder for Server.
func (*ServerClient) UpdateOne ¶
func (c *ServerClient) UpdateOne(s *Server) *ServerUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ServerClient) UpdateOneID ¶
func (c *ServerClient) UpdateOneID(id int) *ServerUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ServerClient) Use ¶
func (c *ServerClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `server.Hooks(f(g(h())))`.
type ServerCreate ¶
type ServerCreate struct {
// contains filtered or unexported fields
}
ServerCreate is the builder for creating a Server entity.
func (*ServerCreate) AddNodeIDs ¶
func (sc *ServerCreate) AddNodeIDs(ids ...int) *ServerCreate
AddNodeIDs adds the "nodes" edge to the Node entity by IDs.
func (*ServerCreate) AddNodes ¶
func (sc *ServerCreate) AddNodes(n ...*Node) *ServerCreate
AddNodes adds the "nodes" edges to the Node entity.
func (*ServerCreate) Exec ¶
func (sc *ServerCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ServerCreate) ExecX ¶
func (sc *ServerCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ServerCreate) Mutation ¶
func (sc *ServerCreate) Mutation() *ServerMutation
Mutation returns the ServerMutation object of the builder.
func (*ServerCreate) Save ¶
func (sc *ServerCreate) Save(ctx context.Context) (*Server, error)
Save creates the Server in the database.
func (*ServerCreate) SaveX ¶
func (sc *ServerCreate) SaveX(ctx context.Context) *Server
SaveX calls Save and panics if Save returns an error.
func (*ServerCreate) SetAccount ¶
func (sc *ServerCreate) SetAccount(a *Account) *ServerCreate
SetAccount sets the "account" edge to the Account entity.
func (*ServerCreate) SetAccountID ¶
func (sc *ServerCreate) SetAccountID(id int) *ServerCreate
SetAccountID sets the "account" edge to the Account entity by ID.
func (*ServerCreate) SetCreateTime ¶
func (sc *ServerCreate) SetCreateTime(t time.Time) *ServerCreate
SetCreateTime sets the "create_time" field.
func (*ServerCreate) SetName ¶
func (sc *ServerCreate) SetName(s string) *ServerCreate
SetName sets the "name" field.
func (*ServerCreate) SetNillableCreateTime ¶
func (sc *ServerCreate) SetNillableCreateTime(t *time.Time) *ServerCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*ServerCreate) SetNillableUpdateTime ¶
func (sc *ServerCreate) SetNillableUpdateTime(t *time.Time) *ServerCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*ServerCreate) SetUpdateTime ¶
func (sc *ServerCreate) SetUpdateTime(t time.Time) *ServerCreate
SetUpdateTime sets the "update_time" field.
type ServerCreateBulk ¶
type ServerCreateBulk struct {
// contains filtered or unexported fields
}
ServerCreateBulk is the builder for creating many Server entities in bulk.
func (*ServerCreateBulk) Exec ¶
func (scb *ServerCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ServerCreateBulk) ExecX ¶
func (scb *ServerCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ServerDelete ¶
type ServerDelete struct {
// contains filtered or unexported fields
}
ServerDelete is the builder for deleting a Server entity.
func (*ServerDelete) Exec ¶
func (sd *ServerDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ServerDelete) ExecX ¶
func (sd *ServerDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ServerDelete) Where ¶
func (sd *ServerDelete) Where(ps ...predicate.Server) *ServerDelete
Where appends a list predicates to the ServerDelete builder.
type ServerDeleteOne ¶
type ServerDeleteOne struct {
// contains filtered or unexported fields
}
ServerDeleteOne is the builder for deleting a single Server entity.
func (*ServerDeleteOne) Exec ¶
func (sdo *ServerDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ServerDeleteOne) ExecX ¶
func (sdo *ServerDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ServerDeleteOne) Where ¶
func (sdo *ServerDeleteOne) Where(ps ...predicate.Server) *ServerDeleteOne
Where appends a list predicates to the ServerDelete builder.
type ServerEdges ¶
type ServerEdges struct { // Nodes holds the value of the nodes edge. Nodes []*Node `json:"nodes,omitempty"` // Account holds the value of the account edge. Account *Account `json:"account,omitempty"` // contains filtered or unexported fields }
ServerEdges holds the relations/edges for other nodes in the graph.
func (ServerEdges) AccountOrErr ¶
func (e ServerEdges) AccountOrErr() (*Account, error)
AccountOrErr returns the Account value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (ServerEdges) NodesOrErr ¶
func (e ServerEdges) NodesOrErr() ([]*Node, error)
NodesOrErr returns the Nodes value or an error if the edge was not loaded in eager-loading.
type ServerGroupBy ¶
type ServerGroupBy struct {
// contains filtered or unexported fields
}
ServerGroupBy is the group-by builder for Server entities.
func (*ServerGroupBy) Aggregate ¶
func (sgb *ServerGroupBy) Aggregate(fns ...AggregateFunc) *ServerGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ServerGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ServerGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ServerGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ServerGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ServerGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ServerGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ServerGroupBy) Scan ¶
func (sgb *ServerGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ServerGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ServerMutation ¶
type ServerMutation struct {
// contains filtered or unexported fields
}
ServerMutation represents an operation that mutates the Server nodes in the graph.
func (*ServerMutation) AccountCleared ¶
func (m *ServerMutation) AccountCleared() bool
AccountCleared reports if the "account" edge to the Account entity was cleared.
func (*ServerMutation) AccountID ¶
func (m *ServerMutation) AccountID() (id int, exists bool)
AccountID returns the "account" edge ID in the mutation.
func (*ServerMutation) AccountIDs ¶
func (m *ServerMutation) AccountIDs() (ids []int)
AccountIDs returns the "account" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AccountID instead. It exists only for internal usage by the builders.
func (*ServerMutation) AddField ¶
func (m *ServerMutation) 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 (*ServerMutation) AddNodeIDs ¶
func (m *ServerMutation) AddNodeIDs(ids ...int)
AddNodeIDs adds the "nodes" edge to the Node entity by ids.
func (*ServerMutation) AddedEdges ¶
func (m *ServerMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ServerMutation) AddedField ¶
func (m *ServerMutation) 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 (*ServerMutation) AddedFields ¶
func (m *ServerMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ServerMutation) AddedIDs ¶
func (m *ServerMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ServerMutation) ClearAccount ¶
func (m *ServerMutation) ClearAccount()
ClearAccount clears the "account" edge to the Account entity.
func (*ServerMutation) ClearEdge ¶
func (m *ServerMutation) 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 (*ServerMutation) ClearField ¶
func (m *ServerMutation) 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 (*ServerMutation) ClearNodes ¶
func (m *ServerMutation) ClearNodes()
ClearNodes clears the "nodes" edge to the Node entity.
func (*ServerMutation) ClearedEdges ¶
func (m *ServerMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ServerMutation) ClearedFields ¶
func (m *ServerMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ServerMutation) Client ¶
func (m ServerMutation) 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 (*ServerMutation) CreateTime ¶
func (m *ServerMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*ServerMutation) EdgeCleared ¶
func (m *ServerMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ServerMutation) Field ¶
func (m *ServerMutation) 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 (*ServerMutation) FieldCleared ¶
func (m *ServerMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ServerMutation) Fields ¶
func (m *ServerMutation) 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 (*ServerMutation) ID ¶
func (m *ServerMutation) 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 (*ServerMutation) IDs ¶
func (m *ServerMutation) 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 (*ServerMutation) Name ¶
func (m *ServerMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*ServerMutation) NodesCleared ¶
func (m *ServerMutation) NodesCleared() bool
NodesCleared reports if the "nodes" edge to the Node entity was cleared.
func (*ServerMutation) NodesIDs ¶
func (m *ServerMutation) NodesIDs() (ids []int)
NodesIDs returns the "nodes" edge IDs in the mutation.
func (*ServerMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the Server entity. If the Server 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 (*ServerMutation) OldField ¶
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 (*ServerMutation) OldName ¶
func (m *ServerMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Server entity. If the Server 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 (*ServerMutation) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" field's value of the Server entity. If the Server 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 (*ServerMutation) RemoveNodeIDs ¶
func (m *ServerMutation) RemoveNodeIDs(ids ...int)
RemoveNodeIDs removes the "nodes" edge to the Node entity by IDs.
func (*ServerMutation) RemovedEdges ¶
func (m *ServerMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ServerMutation) RemovedIDs ¶
func (m *ServerMutation) 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 (*ServerMutation) RemovedNodesIDs ¶
func (m *ServerMutation) RemovedNodesIDs() (ids []int)
RemovedNodes returns the removed IDs of the "nodes" edge to the Node entity.
func (*ServerMutation) ResetAccount ¶
func (m *ServerMutation) ResetAccount()
ResetAccount resets all changes to the "account" edge.
func (*ServerMutation) ResetCreateTime ¶
func (m *ServerMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*ServerMutation) ResetEdge ¶
func (m *ServerMutation) 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 (*ServerMutation) ResetField ¶
func (m *ServerMutation) 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 (*ServerMutation) ResetName ¶
func (m *ServerMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*ServerMutation) ResetNodes ¶
func (m *ServerMutation) ResetNodes()
ResetNodes resets all changes to the "nodes" edge.
func (*ServerMutation) ResetUpdateTime ¶
func (m *ServerMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*ServerMutation) SetAccountID ¶
func (m *ServerMutation) SetAccountID(id int)
SetAccountID sets the "account" edge to the Account entity by id.
func (*ServerMutation) SetCreateTime ¶
func (m *ServerMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*ServerMutation) SetField ¶
func (m *ServerMutation) 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 (*ServerMutation) SetName ¶
func (m *ServerMutation) SetName(s string)
SetName sets the "name" field.
func (*ServerMutation) SetOp ¶
func (m *ServerMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ServerMutation) SetUpdateTime ¶
func (m *ServerMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (ServerMutation) Tx ¶
func (m ServerMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ServerMutation) Type ¶
func (m *ServerMutation) Type() string
Type returns the node type of this mutation (Server).
func (*ServerMutation) UpdateTime ¶
func (m *ServerMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*ServerMutation) Where ¶
func (m *ServerMutation) Where(ps ...predicate.Server)
Where appends a list predicates to the ServerMutation builder.
func (*ServerMutation) WhereP ¶
func (m *ServerMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ServerMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ServerQuery ¶
type ServerQuery struct {
// contains filtered or unexported fields
}
ServerQuery is the builder for querying Server entities.
func (*ServerQuery) Aggregate ¶
func (sq *ServerQuery) Aggregate(fns ...AggregateFunc) *ServerSelect
Aggregate returns a ServerSelect configured with the given aggregations.
func (*ServerQuery) All ¶
func (sq *ServerQuery) All(ctx context.Context) ([]*Server, error)
All executes the query and returns a list of Servers.
func (*ServerQuery) AllX ¶
func (sq *ServerQuery) AllX(ctx context.Context) []*Server
AllX is like All, but panics if an error occurs.
func (*ServerQuery) Clone ¶
func (sq *ServerQuery) Clone() *ServerQuery
Clone returns a duplicate of the ServerQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ServerQuery) Count ¶
func (sq *ServerQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ServerQuery) CountX ¶
func (sq *ServerQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ServerQuery) Exist ¶
func (sq *ServerQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ServerQuery) ExistX ¶
func (sq *ServerQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ServerQuery) First ¶
func (sq *ServerQuery) First(ctx context.Context) (*Server, error)
First returns the first Server entity from the query. Returns a *NotFoundError when no Server was found.
func (*ServerQuery) FirstID ¶
func (sq *ServerQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Server ID from the query. Returns a *NotFoundError when no Server ID was found.
func (*ServerQuery) FirstIDX ¶
func (sq *ServerQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ServerQuery) FirstX ¶
func (sq *ServerQuery) FirstX(ctx context.Context) *Server
FirstX is like First, but panics if an error occurs.
func (*ServerQuery) GroupBy ¶
func (sq *ServerQuery) GroupBy(field string, fields ...string) *ServerGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreateTime time.Time `json:"create_time,omitempty"` Count int `json:"count,omitempty"` } client.Server.Query(). GroupBy(server.FieldCreateTime). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ServerQuery) IDs ¶
func (sq *ServerQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Server IDs.
func (*ServerQuery) IDsX ¶
func (sq *ServerQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ServerQuery) Limit ¶
func (sq *ServerQuery) Limit(limit int) *ServerQuery
Limit the number of records to be returned by this query.
func (*ServerQuery) Offset ¶
func (sq *ServerQuery) Offset(offset int) *ServerQuery
Offset to start from.
func (*ServerQuery) Only ¶
func (sq *ServerQuery) Only(ctx context.Context) (*Server, error)
Only returns a single Server entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Server entity is found. Returns a *NotFoundError when no Server entities are found.
func (*ServerQuery) OnlyID ¶
func (sq *ServerQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Server ID in the query. Returns a *NotSingularError when more than one Server ID is found. Returns a *NotFoundError when no entities are found.
func (*ServerQuery) OnlyIDX ¶
func (sq *ServerQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ServerQuery) OnlyX ¶
func (sq *ServerQuery) OnlyX(ctx context.Context) *Server
OnlyX is like Only, but panics if an error occurs.
func (*ServerQuery) Order ¶
func (sq *ServerQuery) Order(o ...server.OrderOption) *ServerQuery
Order specifies how the records should be ordered.
func (*ServerQuery) QueryAccount ¶
func (sq *ServerQuery) QueryAccount() *AccountQuery
QueryAccount chains the current query on the "account" edge.
func (*ServerQuery) QueryNodes ¶
func (sq *ServerQuery) QueryNodes() *NodeQuery
QueryNodes chains the current query on the "nodes" edge.
func (*ServerQuery) Select ¶
func (sq *ServerQuery) Select(fields ...string) *ServerSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreateTime time.Time `json:"create_time,omitempty"` } client.Server.Query(). Select(server.FieldCreateTime). Scan(ctx, &v)
func (*ServerQuery) Unique ¶
func (sq *ServerQuery) Unique(unique bool) *ServerQuery
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 (*ServerQuery) Where ¶
func (sq *ServerQuery) Where(ps ...predicate.Server) *ServerQuery
Where adds a new predicate for the ServerQuery builder.
func (*ServerQuery) WithAccount ¶
func (sq *ServerQuery) WithAccount(opts ...func(*AccountQuery)) *ServerQuery
WithAccount tells the query-builder to eager-load the nodes that are connected to the "account" edge. The optional arguments are used to configure the query builder of the edge.
func (*ServerQuery) WithNodes ¶
func (sq *ServerQuery) WithNodes(opts ...func(*NodeQuery)) *ServerQuery
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.
type ServerSelect ¶
type ServerSelect struct { *ServerQuery // contains filtered or unexported fields }
ServerSelect is the builder for selecting fields of Server entities.
func (*ServerSelect) Aggregate ¶
func (ss *ServerSelect) Aggregate(fns ...AggregateFunc) *ServerSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ServerSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ServerSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ServerSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ServerSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ServerSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ServerSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ServerSelect) Scan ¶
func (ss *ServerSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ServerSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ServerUpdate ¶
type ServerUpdate struct {
// contains filtered or unexported fields
}
ServerUpdate is the builder for updating Server entities.
func (*ServerUpdate) AddNodeIDs ¶
func (su *ServerUpdate) AddNodeIDs(ids ...int) *ServerUpdate
AddNodeIDs adds the "nodes" edge to the Node entity by IDs.
func (*ServerUpdate) AddNodes ¶
func (su *ServerUpdate) AddNodes(n ...*Node) *ServerUpdate
AddNodes adds the "nodes" edges to the Node entity.
func (*ServerUpdate) ClearAccount ¶
func (su *ServerUpdate) ClearAccount() *ServerUpdate
ClearAccount clears the "account" edge to the Account entity.
func (*ServerUpdate) ClearNodes ¶
func (su *ServerUpdate) ClearNodes() *ServerUpdate
ClearNodes clears all "nodes" edges to the Node entity.
func (*ServerUpdate) Exec ¶
func (su *ServerUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ServerUpdate) ExecX ¶
func (su *ServerUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ServerUpdate) Mutation ¶
func (su *ServerUpdate) Mutation() *ServerMutation
Mutation returns the ServerMutation object of the builder.
func (*ServerUpdate) RemoveNodeIDs ¶
func (su *ServerUpdate) RemoveNodeIDs(ids ...int) *ServerUpdate
RemoveNodeIDs removes the "nodes" edge to Node entities by IDs.
func (*ServerUpdate) RemoveNodes ¶
func (su *ServerUpdate) RemoveNodes(n ...*Node) *ServerUpdate
RemoveNodes removes "nodes" edges to Node entities.
func (*ServerUpdate) Save ¶
func (su *ServerUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ServerUpdate) SaveX ¶
func (su *ServerUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ServerUpdate) SetAccount ¶
func (su *ServerUpdate) SetAccount(a *Account) *ServerUpdate
SetAccount sets the "account" edge to the Account entity.
func (*ServerUpdate) SetAccountID ¶
func (su *ServerUpdate) SetAccountID(id int) *ServerUpdate
SetAccountID sets the "account" edge to the Account entity by ID.
func (*ServerUpdate) SetName ¶
func (su *ServerUpdate) SetName(s string) *ServerUpdate
SetName sets the "name" field.
func (*ServerUpdate) SetNillableName ¶
func (su *ServerUpdate) SetNillableName(s *string) *ServerUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*ServerUpdate) SetUpdateTime ¶
func (su *ServerUpdate) SetUpdateTime(t time.Time) *ServerUpdate
SetUpdateTime sets the "update_time" field.
func (*ServerUpdate) Where ¶
func (su *ServerUpdate) Where(ps ...predicate.Server) *ServerUpdate
Where appends a list predicates to the ServerUpdate builder.
type ServerUpdateOne ¶
type ServerUpdateOne struct {
// contains filtered or unexported fields
}
ServerUpdateOne is the builder for updating a single Server entity.
func (*ServerUpdateOne) AddNodeIDs ¶
func (suo *ServerUpdateOne) AddNodeIDs(ids ...int) *ServerUpdateOne
AddNodeIDs adds the "nodes" edge to the Node entity by IDs.
func (*ServerUpdateOne) AddNodes ¶
func (suo *ServerUpdateOne) AddNodes(n ...*Node) *ServerUpdateOne
AddNodes adds the "nodes" edges to the Node entity.
func (*ServerUpdateOne) ClearAccount ¶
func (suo *ServerUpdateOne) ClearAccount() *ServerUpdateOne
ClearAccount clears the "account" edge to the Account entity.
func (*ServerUpdateOne) ClearNodes ¶
func (suo *ServerUpdateOne) ClearNodes() *ServerUpdateOne
ClearNodes clears all "nodes" edges to the Node entity.
func (*ServerUpdateOne) Exec ¶
func (suo *ServerUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ServerUpdateOne) ExecX ¶
func (suo *ServerUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ServerUpdateOne) Mutation ¶
func (suo *ServerUpdateOne) Mutation() *ServerMutation
Mutation returns the ServerMutation object of the builder.
func (*ServerUpdateOne) RemoveNodeIDs ¶
func (suo *ServerUpdateOne) RemoveNodeIDs(ids ...int) *ServerUpdateOne
RemoveNodeIDs removes the "nodes" edge to Node entities by IDs.
func (*ServerUpdateOne) RemoveNodes ¶
func (suo *ServerUpdateOne) RemoveNodes(n ...*Node) *ServerUpdateOne
RemoveNodes removes "nodes" edges to Node entities.
func (*ServerUpdateOne) Save ¶
func (suo *ServerUpdateOne) Save(ctx context.Context) (*Server, error)
Save executes the query and returns the updated Server entity.
func (*ServerUpdateOne) SaveX ¶
func (suo *ServerUpdateOne) SaveX(ctx context.Context) *Server
SaveX is like Save, but panics if an error occurs.
func (*ServerUpdateOne) Select ¶
func (suo *ServerUpdateOne) Select(field string, fields ...string) *ServerUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ServerUpdateOne) SetAccount ¶
func (suo *ServerUpdateOne) SetAccount(a *Account) *ServerUpdateOne
SetAccount sets the "account" edge to the Account entity.
func (*ServerUpdateOne) SetAccountID ¶
func (suo *ServerUpdateOne) SetAccountID(id int) *ServerUpdateOne
SetAccountID sets the "account" edge to the Account entity by ID.
func (*ServerUpdateOne) SetName ¶
func (suo *ServerUpdateOne) SetName(s string) *ServerUpdateOne
SetName sets the "name" field.
func (*ServerUpdateOne) SetNillableName ¶
func (suo *ServerUpdateOne) SetNillableName(s *string) *ServerUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*ServerUpdateOne) SetUpdateTime ¶
func (suo *ServerUpdateOne) SetUpdateTime(t time.Time) *ServerUpdateOne
SetUpdateTime sets the "update_time" field.
func (*ServerUpdateOne) Where ¶
func (suo *ServerUpdateOne) Where(ps ...predicate.Server) *ServerUpdateOne
Where appends a list predicates to the ServerUpdate builder.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Account is the client for interacting with the Account builders. Account *AccountClient // Node is the client for interacting with the Node builders. Node *NodeClient // RegistrationToken is the client for interacting with the RegistrationToken builders. RegistrationToken *RegistrationTokenClient // Server is the client for interacting with the Server builders. Server *ServerClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
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.
Source Files ¶
- account.go
- account_create.go
- account_delete.go
- account_query.go
- account_update.go
- client.go
- ent.go
- generate.go
- mutation.go
- node.go
- node_create.go
- node_delete.go
- node_query.go
- node_update.go
- registrationtoken.go
- registrationtoken_create.go
- registrationtoken_delete.go
- registrationtoken_query.go
- registrationtoken_update.go
- runtime.go
- server.go
- server_create.go
- server_delete.go
- server_query.go
- server_update.go
- tx.go