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 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 FuncEdge
- type FuncEdgeClient
- func (c *FuncEdgeClient) Create() *FuncEdgeCreate
- func (c *FuncEdgeClient) CreateBulk(builders ...*FuncEdgeCreate) *FuncEdgeCreateBulk
- func (c *FuncEdgeClient) Delete() *FuncEdgeDelete
- func (c *FuncEdgeClient) DeleteOne(fe *FuncEdge) *FuncEdgeDeleteOne
- func (c *FuncEdgeClient) DeleteOneID(id int) *FuncEdgeDeleteOne
- func (c *FuncEdgeClient) Get(ctx context.Context, id int) (*FuncEdge, error)
- func (c *FuncEdgeClient) GetX(ctx context.Context, id int) *FuncEdge
- func (c *FuncEdgeClient) Hooks() []Hook
- func (c *FuncEdgeClient) Intercept(interceptors ...Interceptor)
- func (c *FuncEdgeClient) Interceptors() []Interceptor
- func (c *FuncEdgeClient) MapCreateBulk(slice any, setFunc func(*FuncEdgeCreate, int)) *FuncEdgeCreateBulk
- func (c *FuncEdgeClient) Query() *FuncEdgeQuery
- func (c *FuncEdgeClient) Update() *FuncEdgeUpdate
- func (c *FuncEdgeClient) UpdateOne(fe *FuncEdge) *FuncEdgeUpdateOne
- func (c *FuncEdgeClient) UpdateOneID(id int) *FuncEdgeUpdateOne
- func (c *FuncEdgeClient) Use(hooks ...Hook)
- type FuncEdgeCreate
- func (fec *FuncEdgeCreate) Exec(ctx context.Context) error
- func (fec *FuncEdgeCreate) ExecX(ctx context.Context)
- func (fec *FuncEdgeCreate) Mutation() *FuncEdgeMutation
- func (fec *FuncEdgeCreate) Save(ctx context.Context) (*FuncEdge, error)
- func (fec *FuncEdgeCreate) SaveX(ctx context.Context) *FuncEdge
- func (fec *FuncEdgeCreate) SetCalleeKey(s string) *FuncEdgeCreate
- func (fec *FuncEdgeCreate) SetCallerKey(s string) *FuncEdgeCreate
- func (fec *FuncEdgeCreate) SetCreatedAt(t time.Time) *FuncEdgeCreate
- func (fec *FuncEdgeCreate) SetUpdatedAt(t time.Time) *FuncEdgeCreate
- type FuncEdgeCreateBulk
- type FuncEdgeDelete
- type FuncEdgeDeleteOne
- type FuncEdgeGroupBy
- func (fegb *FuncEdgeGroupBy) Aggregate(fns ...AggregateFunc) *FuncEdgeGroupBy
- func (s *FuncEdgeGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *FuncEdgeGroupBy) BoolX(ctx context.Context) bool
- func (s *FuncEdgeGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *FuncEdgeGroupBy) BoolsX(ctx context.Context) []bool
- func (s *FuncEdgeGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *FuncEdgeGroupBy) Float64X(ctx context.Context) float64
- func (s *FuncEdgeGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *FuncEdgeGroupBy) Float64sX(ctx context.Context) []float64
- func (s *FuncEdgeGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *FuncEdgeGroupBy) IntX(ctx context.Context) int
- func (s *FuncEdgeGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *FuncEdgeGroupBy) IntsX(ctx context.Context) []int
- func (fegb *FuncEdgeGroupBy) Scan(ctx context.Context, v any) error
- func (s *FuncEdgeGroupBy) ScanX(ctx context.Context, v any)
- func (s *FuncEdgeGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *FuncEdgeGroupBy) StringX(ctx context.Context) string
- func (s *FuncEdgeGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *FuncEdgeGroupBy) StringsX(ctx context.Context) []string
- type FuncEdgeMutation
- func (m *FuncEdgeMutation) AddField(name string, value ent.Value) error
- func (m *FuncEdgeMutation) AddedEdges() []string
- func (m *FuncEdgeMutation) AddedField(name string) (ent.Value, bool)
- func (m *FuncEdgeMutation) AddedFields() []string
- func (m *FuncEdgeMutation) AddedIDs(name string) []ent.Value
- func (m *FuncEdgeMutation) CalleeKey() (r string, exists bool)
- func (m *FuncEdgeMutation) CallerKey() (r string, exists bool)
- func (m *FuncEdgeMutation) ClearEdge(name string) error
- func (m *FuncEdgeMutation) ClearField(name string) error
- func (m *FuncEdgeMutation) ClearedEdges() []string
- func (m *FuncEdgeMutation) ClearedFields() []string
- func (m FuncEdgeMutation) Client() *Client
- func (m *FuncEdgeMutation) CreatedAt() (r time.Time, exists bool)
- func (m *FuncEdgeMutation) EdgeCleared(name string) bool
- func (m *FuncEdgeMutation) Field(name string) (ent.Value, bool)
- func (m *FuncEdgeMutation) FieldCleared(name string) bool
- func (m *FuncEdgeMutation) Fields() []string
- func (m *FuncEdgeMutation) ID() (id int, exists bool)
- func (m *FuncEdgeMutation) IDs(ctx context.Context) ([]int, error)
- func (m *FuncEdgeMutation) OldCalleeKey(ctx context.Context) (v string, err error)
- func (m *FuncEdgeMutation) OldCallerKey(ctx context.Context) (v string, err error)
- func (m *FuncEdgeMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *FuncEdgeMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *FuncEdgeMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *FuncEdgeMutation) Op() Op
- func (m *FuncEdgeMutation) RemovedEdges() []string
- func (m *FuncEdgeMutation) RemovedIDs(name string) []ent.Value
- func (m *FuncEdgeMutation) ResetCalleeKey()
- func (m *FuncEdgeMutation) ResetCallerKey()
- func (m *FuncEdgeMutation) ResetCreatedAt()
- func (m *FuncEdgeMutation) ResetEdge(name string) error
- func (m *FuncEdgeMutation) ResetField(name string) error
- func (m *FuncEdgeMutation) ResetUpdatedAt()
- func (m *FuncEdgeMutation) SetCalleeKey(s string)
- func (m *FuncEdgeMutation) SetCallerKey(s string)
- func (m *FuncEdgeMutation) SetCreatedAt(t time.Time)
- func (m *FuncEdgeMutation) SetField(name string, value ent.Value) error
- func (m *FuncEdgeMutation) SetOp(op Op)
- func (m *FuncEdgeMutation) SetUpdatedAt(t time.Time)
- func (m FuncEdgeMutation) Tx() (*Tx, error)
- func (m *FuncEdgeMutation) Type() string
- func (m *FuncEdgeMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *FuncEdgeMutation) Where(ps ...predicate.FuncEdge)
- func (m *FuncEdgeMutation) WhereP(ps ...func(*sql.Selector))
- type FuncEdgeQuery
- func (feq *FuncEdgeQuery) Aggregate(fns ...AggregateFunc) *FuncEdgeSelect
- func (feq *FuncEdgeQuery) All(ctx context.Context) ([]*FuncEdge, error)
- func (feq *FuncEdgeQuery) AllX(ctx context.Context) []*FuncEdge
- func (feq *FuncEdgeQuery) Clone() *FuncEdgeQuery
- func (feq *FuncEdgeQuery) Count(ctx context.Context) (int, error)
- func (feq *FuncEdgeQuery) CountX(ctx context.Context) int
- func (feq *FuncEdgeQuery) Exist(ctx context.Context) (bool, error)
- func (feq *FuncEdgeQuery) ExistX(ctx context.Context) bool
- func (feq *FuncEdgeQuery) First(ctx context.Context) (*FuncEdge, error)
- func (feq *FuncEdgeQuery) FirstID(ctx context.Context) (id int, err error)
- func (feq *FuncEdgeQuery) FirstIDX(ctx context.Context) int
- func (feq *FuncEdgeQuery) FirstX(ctx context.Context) *FuncEdge
- func (feq *FuncEdgeQuery) GroupBy(field string, fields ...string) *FuncEdgeGroupBy
- func (feq *FuncEdgeQuery) IDs(ctx context.Context) (ids []int, err error)
- func (feq *FuncEdgeQuery) IDsX(ctx context.Context) []int
- func (feq *FuncEdgeQuery) Limit(limit int) *FuncEdgeQuery
- func (feq *FuncEdgeQuery) Offset(offset int) *FuncEdgeQuery
- func (feq *FuncEdgeQuery) Only(ctx context.Context) (*FuncEdge, error)
- func (feq *FuncEdgeQuery) OnlyID(ctx context.Context) (id int, err error)
- func (feq *FuncEdgeQuery) OnlyIDX(ctx context.Context) int
- func (feq *FuncEdgeQuery) OnlyX(ctx context.Context) *FuncEdge
- func (feq *FuncEdgeQuery) Order(o ...funcedge.OrderOption) *FuncEdgeQuery
- func (feq *FuncEdgeQuery) Select(fields ...string) *FuncEdgeSelect
- func (feq *FuncEdgeQuery) Unique(unique bool) *FuncEdgeQuery
- func (feq *FuncEdgeQuery) Where(ps ...predicate.FuncEdge) *FuncEdgeQuery
- type FuncEdgeSelect
- func (fes *FuncEdgeSelect) Aggregate(fns ...AggregateFunc) *FuncEdgeSelect
- func (s *FuncEdgeSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *FuncEdgeSelect) BoolX(ctx context.Context) bool
- func (s *FuncEdgeSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *FuncEdgeSelect) BoolsX(ctx context.Context) []bool
- func (s *FuncEdgeSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *FuncEdgeSelect) Float64X(ctx context.Context) float64
- func (s *FuncEdgeSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *FuncEdgeSelect) Float64sX(ctx context.Context) []float64
- func (s *FuncEdgeSelect) Int(ctx context.Context) (_ int, err error)
- func (s *FuncEdgeSelect) IntX(ctx context.Context) int
- func (s *FuncEdgeSelect) Ints(ctx context.Context) ([]int, error)
- func (s *FuncEdgeSelect) IntsX(ctx context.Context) []int
- func (fes *FuncEdgeSelect) Scan(ctx context.Context, v any) error
- func (s *FuncEdgeSelect) ScanX(ctx context.Context, v any)
- func (s *FuncEdgeSelect) String(ctx context.Context) (_ string, err error)
- func (s *FuncEdgeSelect) StringX(ctx context.Context) string
- func (s *FuncEdgeSelect) Strings(ctx context.Context) ([]string, error)
- func (s *FuncEdgeSelect) StringsX(ctx context.Context) []string
- type FuncEdgeUpdate
- func (feu *FuncEdgeUpdate) Exec(ctx context.Context) error
- func (feu *FuncEdgeUpdate) ExecX(ctx context.Context)
- func (feu *FuncEdgeUpdate) Mutation() *FuncEdgeMutation
- func (feu *FuncEdgeUpdate) Save(ctx context.Context) (int, error)
- func (feu *FuncEdgeUpdate) SaveX(ctx context.Context) int
- func (feu *FuncEdgeUpdate) SetCalleeKey(s string) *FuncEdgeUpdate
- func (feu *FuncEdgeUpdate) SetCallerKey(s string) *FuncEdgeUpdate
- func (feu *FuncEdgeUpdate) SetCreatedAt(t time.Time) *FuncEdgeUpdate
- func (feu *FuncEdgeUpdate) SetNillableCalleeKey(s *string) *FuncEdgeUpdate
- func (feu *FuncEdgeUpdate) SetNillableCallerKey(s *string) *FuncEdgeUpdate
- func (feu *FuncEdgeUpdate) SetNillableCreatedAt(t *time.Time) *FuncEdgeUpdate
- func (feu *FuncEdgeUpdate) SetNillableUpdatedAt(t *time.Time) *FuncEdgeUpdate
- func (feu *FuncEdgeUpdate) SetUpdatedAt(t time.Time) *FuncEdgeUpdate
- func (feu *FuncEdgeUpdate) Where(ps ...predicate.FuncEdge) *FuncEdgeUpdate
- type FuncEdgeUpdateOne
- func (feuo *FuncEdgeUpdateOne) Exec(ctx context.Context) error
- func (feuo *FuncEdgeUpdateOne) ExecX(ctx context.Context)
- func (feuo *FuncEdgeUpdateOne) Mutation() *FuncEdgeMutation
- func (feuo *FuncEdgeUpdateOne) Save(ctx context.Context) (*FuncEdge, error)
- func (feuo *FuncEdgeUpdateOne) SaveX(ctx context.Context) *FuncEdge
- func (feuo *FuncEdgeUpdateOne) Select(field string, fields ...string) *FuncEdgeUpdateOne
- func (feuo *FuncEdgeUpdateOne) SetCalleeKey(s string) *FuncEdgeUpdateOne
- func (feuo *FuncEdgeUpdateOne) SetCallerKey(s string) *FuncEdgeUpdateOne
- func (feuo *FuncEdgeUpdateOne) SetCreatedAt(t time.Time) *FuncEdgeUpdateOne
- func (feuo *FuncEdgeUpdateOne) SetNillableCalleeKey(s *string) *FuncEdgeUpdateOne
- func (feuo *FuncEdgeUpdateOne) SetNillableCallerKey(s *string) *FuncEdgeUpdateOne
- func (feuo *FuncEdgeUpdateOne) SetNillableCreatedAt(t *time.Time) *FuncEdgeUpdateOne
- func (feuo *FuncEdgeUpdateOne) SetNillableUpdatedAt(t *time.Time) *FuncEdgeUpdateOne
- func (feuo *FuncEdgeUpdateOne) SetUpdatedAt(t time.Time) *FuncEdgeUpdateOne
- func (feuo *FuncEdgeUpdateOne) Where(ps ...predicate.FuncEdge) *FuncEdgeUpdateOne
- type FuncEdges
- type FuncNode
- type FuncNodeClient
- func (c *FuncNodeClient) Create() *FuncNodeCreate
- func (c *FuncNodeClient) CreateBulk(builders ...*FuncNodeCreate) *FuncNodeCreateBulk
- func (c *FuncNodeClient) Delete() *FuncNodeDelete
- func (c *FuncNodeClient) DeleteOne(fn *FuncNode) *FuncNodeDeleteOne
- func (c *FuncNodeClient) DeleteOneID(id int) *FuncNodeDeleteOne
- func (c *FuncNodeClient) Get(ctx context.Context, id int) (*FuncNode, error)
- func (c *FuncNodeClient) GetX(ctx context.Context, id int) *FuncNode
- func (c *FuncNodeClient) Hooks() []Hook
- func (c *FuncNodeClient) Intercept(interceptors ...Interceptor)
- func (c *FuncNodeClient) Interceptors() []Interceptor
- func (c *FuncNodeClient) MapCreateBulk(slice any, setFunc func(*FuncNodeCreate, int)) *FuncNodeCreateBulk
- func (c *FuncNodeClient) Query() *FuncNodeQuery
- func (c *FuncNodeClient) Update() *FuncNodeUpdate
- func (c *FuncNodeClient) UpdateOne(fn *FuncNode) *FuncNodeUpdateOne
- func (c *FuncNodeClient) UpdateOneID(id int) *FuncNodeUpdateOne
- func (c *FuncNodeClient) Use(hooks ...Hook)
- type FuncNodeCreate
- func (fnc *FuncNodeCreate) Exec(ctx context.Context) error
- func (fnc *FuncNodeCreate) ExecX(ctx context.Context)
- func (fnc *FuncNodeCreate) Mutation() *FuncNodeMutation
- func (fnc *FuncNodeCreate) Save(ctx context.Context) (*FuncNode, error)
- func (fnc *FuncNodeCreate) SaveX(ctx context.Context) *FuncNode
- func (fnc *FuncNodeCreate) SetCreatedAt(t time.Time) *FuncNodeCreate
- func (fnc *FuncNodeCreate) SetFullName(s string) *FuncNodeCreate
- func (fnc *FuncNodeCreate) SetKey(s string) *FuncNodeCreate
- func (fnc *FuncNodeCreate) SetName(s string) *FuncNodeCreate
- func (fnc *FuncNodeCreate) SetNillableCreatedAt(t *time.Time) *FuncNodeCreate
- func (fnc *FuncNodeCreate) SetNillableUpdatedAt(t *time.Time) *FuncNodeCreate
- func (fnc *FuncNodeCreate) SetPkg(s string) *FuncNodeCreate
- func (fnc *FuncNodeCreate) SetUpdatedAt(t time.Time) *FuncNodeCreate
- type FuncNodeCreateBulk
- type FuncNodeDelete
- type FuncNodeDeleteOne
- type FuncNodeGroupBy
- func (fngb *FuncNodeGroupBy) Aggregate(fns ...AggregateFunc) *FuncNodeGroupBy
- func (s *FuncNodeGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *FuncNodeGroupBy) BoolX(ctx context.Context) bool
- func (s *FuncNodeGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *FuncNodeGroupBy) BoolsX(ctx context.Context) []bool
- func (s *FuncNodeGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *FuncNodeGroupBy) Float64X(ctx context.Context) float64
- func (s *FuncNodeGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *FuncNodeGroupBy) Float64sX(ctx context.Context) []float64
- func (s *FuncNodeGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *FuncNodeGroupBy) IntX(ctx context.Context) int
- func (s *FuncNodeGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *FuncNodeGroupBy) IntsX(ctx context.Context) []int
- func (fngb *FuncNodeGroupBy) Scan(ctx context.Context, v any) error
- func (s *FuncNodeGroupBy) ScanX(ctx context.Context, v any)
- func (s *FuncNodeGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *FuncNodeGroupBy) StringX(ctx context.Context) string
- func (s *FuncNodeGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *FuncNodeGroupBy) StringsX(ctx context.Context) []string
- type FuncNodeMutation
- func (m *FuncNodeMutation) AddField(name string, value ent.Value) error
- func (m *FuncNodeMutation) AddedEdges() []string
- func (m *FuncNodeMutation) AddedField(name string) (ent.Value, bool)
- func (m *FuncNodeMutation) AddedFields() []string
- func (m *FuncNodeMutation) AddedIDs(name string) []ent.Value
- func (m *FuncNodeMutation) ClearEdge(name string) error
- func (m *FuncNodeMutation) ClearField(name string) error
- func (m *FuncNodeMutation) ClearedEdges() []string
- func (m *FuncNodeMutation) ClearedFields() []string
- func (m FuncNodeMutation) Client() *Client
- func (m *FuncNodeMutation) CreatedAt() (r time.Time, exists bool)
- func (m *FuncNodeMutation) EdgeCleared(name string) bool
- func (m *FuncNodeMutation) Field(name string) (ent.Value, bool)
- func (m *FuncNodeMutation) FieldCleared(name string) bool
- func (m *FuncNodeMutation) Fields() []string
- func (m *FuncNodeMutation) FullName() (r string, exists bool)
- func (m *FuncNodeMutation) ID() (id int, exists bool)
- func (m *FuncNodeMutation) IDs(ctx context.Context) ([]int, error)
- func (m *FuncNodeMutation) Key() (r string, exists bool)
- func (m *FuncNodeMutation) Name() (r string, exists bool)
- func (m *FuncNodeMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *FuncNodeMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *FuncNodeMutation) OldFullName(ctx context.Context) (v string, err error)
- func (m *FuncNodeMutation) OldKey(ctx context.Context) (v string, err error)
- func (m *FuncNodeMutation) OldName(ctx context.Context) (v string, err error)
- func (m *FuncNodeMutation) OldPkg(ctx context.Context) (v string, err error)
- func (m *FuncNodeMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *FuncNodeMutation) Op() Op
- func (m *FuncNodeMutation) Pkg() (r string, exists bool)
- func (m *FuncNodeMutation) RemovedEdges() []string
- func (m *FuncNodeMutation) RemovedIDs(name string) []ent.Value
- func (m *FuncNodeMutation) ResetCreatedAt()
- func (m *FuncNodeMutation) ResetEdge(name string) error
- func (m *FuncNodeMutation) ResetField(name string) error
- func (m *FuncNodeMutation) ResetFullName()
- func (m *FuncNodeMutation) ResetKey()
- func (m *FuncNodeMutation) ResetName()
- func (m *FuncNodeMutation) ResetPkg()
- func (m *FuncNodeMutation) ResetUpdatedAt()
- func (m *FuncNodeMutation) SetCreatedAt(t time.Time)
- func (m *FuncNodeMutation) SetField(name string, value ent.Value) error
- func (m *FuncNodeMutation) SetFullName(s string)
- func (m *FuncNodeMutation) SetKey(s string)
- func (m *FuncNodeMutation) SetName(s string)
- func (m *FuncNodeMutation) SetOp(op Op)
- func (m *FuncNodeMutation) SetPkg(s string)
- func (m *FuncNodeMutation) SetUpdatedAt(t time.Time)
- func (m FuncNodeMutation) Tx() (*Tx, error)
- func (m *FuncNodeMutation) Type() string
- func (m *FuncNodeMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *FuncNodeMutation) Where(ps ...predicate.FuncNode)
- func (m *FuncNodeMutation) WhereP(ps ...func(*sql.Selector))
- type FuncNodeQuery
- func (fnq *FuncNodeQuery) Aggregate(fns ...AggregateFunc) *FuncNodeSelect
- func (fnq *FuncNodeQuery) All(ctx context.Context) ([]*FuncNode, error)
- func (fnq *FuncNodeQuery) AllX(ctx context.Context) []*FuncNode
- func (fnq *FuncNodeQuery) Clone() *FuncNodeQuery
- func (fnq *FuncNodeQuery) Count(ctx context.Context) (int, error)
- func (fnq *FuncNodeQuery) CountX(ctx context.Context) int
- func (fnq *FuncNodeQuery) Exist(ctx context.Context) (bool, error)
- func (fnq *FuncNodeQuery) ExistX(ctx context.Context) bool
- func (fnq *FuncNodeQuery) First(ctx context.Context) (*FuncNode, error)
- func (fnq *FuncNodeQuery) FirstID(ctx context.Context) (id int, err error)
- func (fnq *FuncNodeQuery) FirstIDX(ctx context.Context) int
- func (fnq *FuncNodeQuery) FirstX(ctx context.Context) *FuncNode
- func (fnq *FuncNodeQuery) GroupBy(field string, fields ...string) *FuncNodeGroupBy
- func (fnq *FuncNodeQuery) IDs(ctx context.Context) (ids []int, err error)
- func (fnq *FuncNodeQuery) IDsX(ctx context.Context) []int
- func (fnq *FuncNodeQuery) Limit(limit int) *FuncNodeQuery
- func (fnq *FuncNodeQuery) Offset(offset int) *FuncNodeQuery
- func (fnq *FuncNodeQuery) Only(ctx context.Context) (*FuncNode, error)
- func (fnq *FuncNodeQuery) OnlyID(ctx context.Context) (id int, err error)
- func (fnq *FuncNodeQuery) OnlyIDX(ctx context.Context) int
- func (fnq *FuncNodeQuery) OnlyX(ctx context.Context) *FuncNode
- func (fnq *FuncNodeQuery) Order(o ...funcnode.OrderOption) *FuncNodeQuery
- func (fnq *FuncNodeQuery) Select(fields ...string) *FuncNodeSelect
- func (fnq *FuncNodeQuery) Unique(unique bool) *FuncNodeQuery
- func (fnq *FuncNodeQuery) Where(ps ...predicate.FuncNode) *FuncNodeQuery
- type FuncNodeSelect
- func (fns *FuncNodeSelect) Aggregate(fnss ...AggregateFunc) *FuncNodeSelect
- func (s *FuncNodeSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *FuncNodeSelect) BoolX(ctx context.Context) bool
- func (s *FuncNodeSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *FuncNodeSelect) BoolsX(ctx context.Context) []bool
- func (s *FuncNodeSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *FuncNodeSelect) Float64X(ctx context.Context) float64
- func (s *FuncNodeSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *FuncNodeSelect) Float64sX(ctx context.Context) []float64
- func (s *FuncNodeSelect) Int(ctx context.Context) (_ int, err error)
- func (s *FuncNodeSelect) IntX(ctx context.Context) int
- func (s *FuncNodeSelect) Ints(ctx context.Context) ([]int, error)
- func (s *FuncNodeSelect) IntsX(ctx context.Context) []int
- func (fns *FuncNodeSelect) Scan(ctx context.Context, v any) error
- func (s *FuncNodeSelect) ScanX(ctx context.Context, v any)
- func (s *FuncNodeSelect) String(ctx context.Context) (_ string, err error)
- func (s *FuncNodeSelect) StringX(ctx context.Context) string
- func (s *FuncNodeSelect) Strings(ctx context.Context) ([]string, error)
- func (s *FuncNodeSelect) StringsX(ctx context.Context) []string
- type FuncNodeUpdate
- func (fnu *FuncNodeUpdate) Exec(ctx context.Context) error
- func (fnu *FuncNodeUpdate) ExecX(ctx context.Context)
- func (fnu *FuncNodeUpdate) Mutation() *FuncNodeMutation
- func (fnu *FuncNodeUpdate) Save(ctx context.Context) (int, error)
- func (fnu *FuncNodeUpdate) SaveX(ctx context.Context) int
- func (fnu *FuncNodeUpdate) SetCreatedAt(t time.Time) *FuncNodeUpdate
- func (fnu *FuncNodeUpdate) SetFullName(s string) *FuncNodeUpdate
- func (fnu *FuncNodeUpdate) SetKey(s string) *FuncNodeUpdate
- func (fnu *FuncNodeUpdate) SetName(s string) *FuncNodeUpdate
- func (fnu *FuncNodeUpdate) SetNillableCreatedAt(t *time.Time) *FuncNodeUpdate
- func (fnu *FuncNodeUpdate) SetNillableFullName(s *string) *FuncNodeUpdate
- func (fnu *FuncNodeUpdate) SetNillableKey(s *string) *FuncNodeUpdate
- func (fnu *FuncNodeUpdate) SetNillableName(s *string) *FuncNodeUpdate
- func (fnu *FuncNodeUpdate) SetNillablePkg(s *string) *FuncNodeUpdate
- func (fnu *FuncNodeUpdate) SetNillableUpdatedAt(t *time.Time) *FuncNodeUpdate
- func (fnu *FuncNodeUpdate) SetPkg(s string) *FuncNodeUpdate
- func (fnu *FuncNodeUpdate) SetUpdatedAt(t time.Time) *FuncNodeUpdate
- func (fnu *FuncNodeUpdate) Where(ps ...predicate.FuncNode) *FuncNodeUpdate
- type FuncNodeUpdateOne
- func (fnuo *FuncNodeUpdateOne) Exec(ctx context.Context) error
- func (fnuo *FuncNodeUpdateOne) ExecX(ctx context.Context)
- func (fnuo *FuncNodeUpdateOne) Mutation() *FuncNodeMutation
- func (fnuo *FuncNodeUpdateOne) Save(ctx context.Context) (*FuncNode, error)
- func (fnuo *FuncNodeUpdateOne) SaveX(ctx context.Context) *FuncNode
- func (fnuo *FuncNodeUpdateOne) Select(field string, fields ...string) *FuncNodeUpdateOne
- func (fnuo *FuncNodeUpdateOne) SetCreatedAt(t time.Time) *FuncNodeUpdateOne
- func (fnuo *FuncNodeUpdateOne) SetFullName(s string) *FuncNodeUpdateOne
- func (fnuo *FuncNodeUpdateOne) SetKey(s string) *FuncNodeUpdateOne
- func (fnuo *FuncNodeUpdateOne) SetName(s string) *FuncNodeUpdateOne
- func (fnuo *FuncNodeUpdateOne) SetNillableCreatedAt(t *time.Time) *FuncNodeUpdateOne
- func (fnuo *FuncNodeUpdateOne) SetNillableFullName(s *string) *FuncNodeUpdateOne
- func (fnuo *FuncNodeUpdateOne) SetNillableKey(s *string) *FuncNodeUpdateOne
- func (fnuo *FuncNodeUpdateOne) SetNillableName(s *string) *FuncNodeUpdateOne
- func (fnuo *FuncNodeUpdateOne) SetNillablePkg(s *string) *FuncNodeUpdateOne
- func (fnuo *FuncNodeUpdateOne) SetNillableUpdatedAt(t *time.Time) *FuncNodeUpdateOne
- func (fnuo *FuncNodeUpdateOne) SetPkg(s string) *FuncNodeUpdateOne
- func (fnuo *FuncNodeUpdateOne) SetUpdatedAt(t time.Time) *FuncNodeUpdateOne
- func (fnuo *FuncNodeUpdateOne) Where(ps ...predicate.FuncNode) *FuncNodeUpdateOne
- type FuncNodes
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- 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. TypeFuncEdge = "FuncEdge" TypeFuncNode = "FuncNode" )
Variables ¶
var ErrTxStarted = errors.New("gen: 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 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(gen.As(gen.Sum(field1), "sum_field1"), (gen.As(gen.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
// FuncEdge is the client for interacting with the FuncEdge builders.
FuncEdge *FuncEdgeClient
// FuncNode is the client for interacting with the FuncNode builders.
FuncNode *FuncNodeClient
// 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(). FuncEdge. 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 FuncEdge ¶
type FuncEdge struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// CreatedAt holds the value of the "CreatedAt" field.
CreatedAt time.Time `json:"CreatedAt,omitempty"`
// UpdatedAt holds the value of the "UpdatedAt" field.
UpdatedAt time.Time `json:"UpdatedAt,omitempty"`
// CallerKey holds the value of the "CallerKey" field.
CallerKey string `json:"CallerKey,omitempty"`
// CalleeKey holds the value of the "CalleeKey" field.
CalleeKey string `json:"CalleeKey,omitempty"`
// contains filtered or unexported fields
}
FuncEdge is the model entity for the FuncEdge schema.
func (*FuncEdge) Unwrap ¶
Unwrap unwraps the FuncEdge 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 (*FuncEdge) Update ¶
func (fe *FuncEdge) Update() *FuncEdgeUpdateOne
Update returns a builder for updating this FuncEdge. Note that you need to call FuncEdge.Unwrap() before calling this method if this FuncEdge was returned from a transaction, and the transaction was committed or rolled back.
type FuncEdgeClient ¶
type FuncEdgeClient struct {
// contains filtered or unexported fields
}
FuncEdgeClient is a client for the FuncEdge schema.
func NewFuncEdgeClient ¶
func NewFuncEdgeClient(c config) *FuncEdgeClient
NewFuncEdgeClient returns a client for the FuncEdge from the given config.
func (*FuncEdgeClient) Create ¶
func (c *FuncEdgeClient) Create() *FuncEdgeCreate
Create returns a builder for creating a FuncEdge entity.
func (*FuncEdgeClient) CreateBulk ¶
func (c *FuncEdgeClient) CreateBulk(builders ...*FuncEdgeCreate) *FuncEdgeCreateBulk
CreateBulk returns a builder for creating a bulk of FuncEdge entities.
func (*FuncEdgeClient) Delete ¶
func (c *FuncEdgeClient) Delete() *FuncEdgeDelete
Delete returns a delete builder for FuncEdge.
func (*FuncEdgeClient) DeleteOne ¶
func (c *FuncEdgeClient) DeleteOne(fe *FuncEdge) *FuncEdgeDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*FuncEdgeClient) DeleteOneID ¶
func (c *FuncEdgeClient) DeleteOneID(id int) *FuncEdgeDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*FuncEdgeClient) GetX ¶
func (c *FuncEdgeClient) GetX(ctx context.Context, id int) *FuncEdge
GetX is like Get, but panics if an error occurs.
func (*FuncEdgeClient) Hooks ¶
func (c *FuncEdgeClient) Hooks() []Hook
Hooks returns the client hooks.
func (*FuncEdgeClient) Intercept ¶
func (c *FuncEdgeClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `funcedge.Intercept(f(g(h())))`.
func (*FuncEdgeClient) Interceptors ¶
func (c *FuncEdgeClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*FuncEdgeClient) MapCreateBulk ¶
func (c *FuncEdgeClient) MapCreateBulk(slice any, setFunc func(*FuncEdgeCreate, int)) *FuncEdgeCreateBulk
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 (*FuncEdgeClient) Query ¶
func (c *FuncEdgeClient) Query() *FuncEdgeQuery
Query returns a query builder for FuncEdge.
func (*FuncEdgeClient) Update ¶
func (c *FuncEdgeClient) Update() *FuncEdgeUpdate
Update returns an update builder for FuncEdge.
func (*FuncEdgeClient) UpdateOne ¶
func (c *FuncEdgeClient) UpdateOne(fe *FuncEdge) *FuncEdgeUpdateOne
UpdateOne returns an update builder for the given entity.
func (*FuncEdgeClient) UpdateOneID ¶
func (c *FuncEdgeClient) UpdateOneID(id int) *FuncEdgeUpdateOne
UpdateOneID returns an update builder for the given id.
func (*FuncEdgeClient) Use ¶
func (c *FuncEdgeClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `funcedge.Hooks(f(g(h())))`.
type FuncEdgeCreate ¶
type FuncEdgeCreate struct {
// contains filtered or unexported fields
}
FuncEdgeCreate is the builder for creating a FuncEdge entity.
func (*FuncEdgeCreate) Exec ¶
func (fec *FuncEdgeCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*FuncEdgeCreate) ExecX ¶
func (fec *FuncEdgeCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FuncEdgeCreate) Mutation ¶
func (fec *FuncEdgeCreate) Mutation() *FuncEdgeMutation
Mutation returns the FuncEdgeMutation object of the builder.
func (*FuncEdgeCreate) Save ¶
func (fec *FuncEdgeCreate) Save(ctx context.Context) (*FuncEdge, error)
Save creates the FuncEdge in the database.
func (*FuncEdgeCreate) SaveX ¶
func (fec *FuncEdgeCreate) SaveX(ctx context.Context) *FuncEdge
SaveX calls Save and panics if Save returns an error.
func (*FuncEdgeCreate) SetCalleeKey ¶
func (fec *FuncEdgeCreate) SetCalleeKey(s string) *FuncEdgeCreate
SetCalleeKey sets the "CalleeKey" field.
func (*FuncEdgeCreate) SetCallerKey ¶
func (fec *FuncEdgeCreate) SetCallerKey(s string) *FuncEdgeCreate
SetCallerKey sets the "CallerKey" field.
func (*FuncEdgeCreate) SetCreatedAt ¶
func (fec *FuncEdgeCreate) SetCreatedAt(t time.Time) *FuncEdgeCreate
SetCreatedAt sets the "CreatedAt" field.
func (*FuncEdgeCreate) SetUpdatedAt ¶
func (fec *FuncEdgeCreate) SetUpdatedAt(t time.Time) *FuncEdgeCreate
SetUpdatedAt sets the "UpdatedAt" field.
type FuncEdgeCreateBulk ¶
type FuncEdgeCreateBulk struct {
// contains filtered or unexported fields
}
FuncEdgeCreateBulk is the builder for creating many FuncEdge entities in bulk.
func (*FuncEdgeCreateBulk) Exec ¶
func (fecb *FuncEdgeCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*FuncEdgeCreateBulk) ExecX ¶
func (fecb *FuncEdgeCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type FuncEdgeDelete ¶
type FuncEdgeDelete struct {
// contains filtered or unexported fields
}
FuncEdgeDelete is the builder for deleting a FuncEdge entity.
func (*FuncEdgeDelete) Exec ¶
func (fed *FuncEdgeDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*FuncEdgeDelete) ExecX ¶
func (fed *FuncEdgeDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*FuncEdgeDelete) Where ¶
func (fed *FuncEdgeDelete) Where(ps ...predicate.FuncEdge) *FuncEdgeDelete
Where appends a list predicates to the FuncEdgeDelete builder.
type FuncEdgeDeleteOne ¶
type FuncEdgeDeleteOne struct {
// contains filtered or unexported fields
}
FuncEdgeDeleteOne is the builder for deleting a single FuncEdge entity.
func (*FuncEdgeDeleteOne) Exec ¶
func (fedo *FuncEdgeDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*FuncEdgeDeleteOne) ExecX ¶
func (fedo *FuncEdgeDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FuncEdgeDeleteOne) Where ¶
func (fedo *FuncEdgeDeleteOne) Where(ps ...predicate.FuncEdge) *FuncEdgeDeleteOne
Where appends a list predicates to the FuncEdgeDelete builder.
type FuncEdgeGroupBy ¶
type FuncEdgeGroupBy struct {
// contains filtered or unexported fields
}
FuncEdgeGroupBy is the group-by builder for FuncEdge entities.
func (*FuncEdgeGroupBy) Aggregate ¶
func (fegb *FuncEdgeGroupBy) Aggregate(fns ...AggregateFunc) *FuncEdgeGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*FuncEdgeGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FuncEdgeGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FuncEdgeGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FuncEdgeGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FuncEdgeGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FuncEdgeGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FuncEdgeGroupBy) Scan ¶
func (fegb *FuncEdgeGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FuncEdgeGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FuncEdgeMutation ¶
type FuncEdgeMutation struct {
// contains filtered or unexported fields
}
FuncEdgeMutation represents an operation that mutates the FuncEdge nodes in the graph.
func (*FuncEdgeMutation) AddField ¶
func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) AddedEdges ¶
func (m *FuncEdgeMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*FuncEdgeMutation) AddedField ¶
func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) AddedFields ¶
func (m *FuncEdgeMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*FuncEdgeMutation) AddedIDs ¶
func (m *FuncEdgeMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*FuncEdgeMutation) CalleeKey ¶
func (m *FuncEdgeMutation) CalleeKey() (r string, exists bool)
CalleeKey returns the value of the "CalleeKey" field in the mutation.
func (*FuncEdgeMutation) CallerKey ¶
func (m *FuncEdgeMutation) CallerKey() (r string, exists bool)
CallerKey returns the value of the "CallerKey" field in the mutation.
func (*FuncEdgeMutation) ClearEdge ¶
func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) ClearField ¶
func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) ClearedEdges ¶
func (m *FuncEdgeMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*FuncEdgeMutation) ClearedFields ¶
func (m *FuncEdgeMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (FuncEdgeMutation) Client ¶
func (m FuncEdgeMutation) 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 (*FuncEdgeMutation) CreatedAt ¶
func (m *FuncEdgeMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "CreatedAt" field in the mutation.
func (*FuncEdgeMutation) EdgeCleared ¶
func (m *FuncEdgeMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*FuncEdgeMutation) Field ¶
func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) FieldCleared ¶
func (m *FuncEdgeMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*FuncEdgeMutation) Fields ¶
func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) ID ¶
func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) IDs ¶
func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) OldCalleeKey ¶
func (m *FuncEdgeMutation) OldCalleeKey(ctx context.Context) (v string, err error)
OldCalleeKey returns the old "CalleeKey" field's value of the FuncEdge entity. If the FuncEdge 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 (*FuncEdgeMutation) OldCallerKey ¶
func (m *FuncEdgeMutation) OldCallerKey(ctx context.Context) (v string, err error)
OldCallerKey returns the old "CallerKey" field's value of the FuncEdge entity. If the FuncEdge 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 (*FuncEdgeMutation) OldCreatedAt ¶
OldCreatedAt returns the old "CreatedAt" field's value of the FuncEdge entity. If the FuncEdge 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 (*FuncEdgeMutation) 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 (*FuncEdgeMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "UpdatedAt" field's value of the FuncEdge entity. If the FuncEdge 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 (*FuncEdgeMutation) RemovedEdges ¶
func (m *FuncEdgeMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*FuncEdgeMutation) RemovedIDs ¶
func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) ResetCalleeKey ¶
func (m *FuncEdgeMutation) ResetCalleeKey()
ResetCalleeKey resets all changes to the "CalleeKey" field.
func (*FuncEdgeMutation) ResetCallerKey ¶
func (m *FuncEdgeMutation) ResetCallerKey()
ResetCallerKey resets all changes to the "CallerKey" field.
func (*FuncEdgeMutation) ResetCreatedAt ¶
func (m *FuncEdgeMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "CreatedAt" field.
func (*FuncEdgeMutation) ResetEdge ¶
func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) ResetField ¶
func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) ResetUpdatedAt ¶
func (m *FuncEdgeMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "UpdatedAt" field.
func (*FuncEdgeMutation) SetCalleeKey ¶
func (m *FuncEdgeMutation) SetCalleeKey(s string)
SetCalleeKey sets the "CalleeKey" field.
func (*FuncEdgeMutation) SetCallerKey ¶
func (m *FuncEdgeMutation) SetCallerKey(s string)
SetCallerKey sets the "CallerKey" field.
func (*FuncEdgeMutation) SetCreatedAt ¶
func (m *FuncEdgeMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "CreatedAt" field.
func (*FuncEdgeMutation) SetField ¶
func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) SetOp ¶
func (m *FuncEdgeMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*FuncEdgeMutation) SetUpdatedAt ¶
func (m *FuncEdgeMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "UpdatedAt" field.
func (FuncEdgeMutation) Tx ¶
func (m FuncEdgeMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*FuncEdgeMutation) Type ¶
func (m *FuncEdgeMutation) Type() string
Type returns the node type of this mutation (FuncEdge).
func (*FuncEdgeMutation) UpdatedAt ¶
func (m *FuncEdgeMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "UpdatedAt" field in the mutation.
func (*FuncEdgeMutation) Where ¶
func (m *FuncEdgeMutation) Where(ps ...predicate.FuncEdge)
Where appends a list predicates to the FuncEdgeMutation builder.
func (*FuncEdgeMutation) WhereP ¶
func (m *FuncEdgeMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the FuncEdgeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type FuncEdgeQuery ¶
type FuncEdgeQuery struct {
// contains filtered or unexported fields
}
FuncEdgeQuery is the builder for querying FuncEdge entities.
func (*FuncEdgeQuery) Aggregate ¶
func (feq *FuncEdgeQuery) Aggregate(fns ...AggregateFunc) *FuncEdgeSelect
Aggregate returns a FuncEdgeSelect configured with the given aggregations.
func (*FuncEdgeQuery) All ¶
func (feq *FuncEdgeQuery) All(ctx context.Context) ([]*FuncEdge, error)
All executes the query and returns a list of FuncEdges.
func (*FuncEdgeQuery) AllX ¶
func (feq *FuncEdgeQuery) AllX(ctx context.Context) []*FuncEdge
AllX is like All, but panics if an error occurs.
func (*FuncEdgeQuery) Clone ¶
func (feq *FuncEdgeQuery) Clone() *FuncEdgeQuery
Clone returns a duplicate of the FuncEdgeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*FuncEdgeQuery) Count ¶
func (feq *FuncEdgeQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*FuncEdgeQuery) CountX ¶
func (feq *FuncEdgeQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*FuncEdgeQuery) Exist ¶
func (feq *FuncEdgeQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*FuncEdgeQuery) ExistX ¶
func (feq *FuncEdgeQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*FuncEdgeQuery) First ¶
func (feq *FuncEdgeQuery) First(ctx context.Context) (*FuncEdge, error)
First returns the first FuncEdge entity from the query. Returns a *NotFoundError when no FuncEdge was found.
func (*FuncEdgeQuery) FirstID ¶
func (feq *FuncEdgeQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first FuncEdge ID from the query. Returns a *NotFoundError when no FuncEdge ID was found.
func (*FuncEdgeQuery) FirstIDX ¶
func (feq *FuncEdgeQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*FuncEdgeQuery) FirstX ¶
func (feq *FuncEdgeQuery) FirstX(ctx context.Context) *FuncEdge
FirstX is like First, but panics if an error occurs.
func (*FuncEdgeQuery) GroupBy ¶
func (feq *FuncEdgeQuery) GroupBy(field string, fields ...string) *FuncEdgeGroupBy
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 {
CreatedAt time.Time `json:"CreatedAt,omitempty"`
Count int `json:"count,omitempty"`
}
client.FuncEdge.Query().
GroupBy(funcedge.FieldCreatedAt).
Aggregate(gen.Count()).
Scan(ctx, &v)
func (*FuncEdgeQuery) IDs ¶
func (feq *FuncEdgeQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of FuncEdge IDs.
func (*FuncEdgeQuery) IDsX ¶
func (feq *FuncEdgeQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*FuncEdgeQuery) Limit ¶
func (feq *FuncEdgeQuery) Limit(limit int) *FuncEdgeQuery
Limit the number of records to be returned by this query.
func (*FuncEdgeQuery) Offset ¶
func (feq *FuncEdgeQuery) Offset(offset int) *FuncEdgeQuery
Offset to start from.
func (*FuncEdgeQuery) Only ¶
func (feq *FuncEdgeQuery) Only(ctx context.Context) (*FuncEdge, error)
Only returns a single FuncEdge entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one FuncEdge entity is found. Returns a *NotFoundError when no FuncEdge entities are found.
func (*FuncEdgeQuery) OnlyID ¶
func (feq *FuncEdgeQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only FuncEdge ID in the query. Returns a *NotSingularError when more than one FuncEdge ID is found. Returns a *NotFoundError when no entities are found.
func (*FuncEdgeQuery) OnlyIDX ¶
func (feq *FuncEdgeQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*FuncEdgeQuery) OnlyX ¶
func (feq *FuncEdgeQuery) OnlyX(ctx context.Context) *FuncEdge
OnlyX is like Only, but panics if an error occurs.
func (*FuncEdgeQuery) Order ¶
func (feq *FuncEdgeQuery) Order(o ...funcedge.OrderOption) *FuncEdgeQuery
Order specifies how the records should be ordered.
func (*FuncEdgeQuery) Select ¶
func (feq *FuncEdgeQuery) Select(fields ...string) *FuncEdgeSelect
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 {
CreatedAt time.Time `json:"CreatedAt,omitempty"`
}
client.FuncEdge.Query().
Select(funcedge.FieldCreatedAt).
Scan(ctx, &v)
func (*FuncEdgeQuery) Unique ¶
func (feq *FuncEdgeQuery) Unique(unique bool) *FuncEdgeQuery
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 (*FuncEdgeQuery) Where ¶
func (feq *FuncEdgeQuery) Where(ps ...predicate.FuncEdge) *FuncEdgeQuery
Where adds a new predicate for the FuncEdgeQuery builder.
type FuncEdgeSelect ¶
type FuncEdgeSelect struct {
*FuncEdgeQuery
// contains filtered or unexported fields
}
FuncEdgeSelect is the builder for selecting fields of FuncEdge entities.
func (*FuncEdgeSelect) Aggregate ¶
func (fes *FuncEdgeSelect) Aggregate(fns ...AggregateFunc) *FuncEdgeSelect
Aggregate adds the given aggregation functions to the selector query.
func (*FuncEdgeSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FuncEdgeSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FuncEdgeSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FuncEdgeSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FuncEdgeSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FuncEdgeSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FuncEdgeSelect) Scan ¶
func (fes *FuncEdgeSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FuncEdgeSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FuncEdgeUpdate ¶
type FuncEdgeUpdate struct {
// contains filtered or unexported fields
}
FuncEdgeUpdate is the builder for updating FuncEdge entities.
func (*FuncEdgeUpdate) Exec ¶
func (feu *FuncEdgeUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*FuncEdgeUpdate) ExecX ¶
func (feu *FuncEdgeUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FuncEdgeUpdate) Mutation ¶
func (feu *FuncEdgeUpdate) Mutation() *FuncEdgeMutation
Mutation returns the FuncEdgeMutation object of the builder.
func (*FuncEdgeUpdate) Save ¶
func (feu *FuncEdgeUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*FuncEdgeUpdate) SaveX ¶
func (feu *FuncEdgeUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*FuncEdgeUpdate) SetCalleeKey ¶
func (feu *FuncEdgeUpdate) SetCalleeKey(s string) *FuncEdgeUpdate
SetCalleeKey sets the "CalleeKey" field.
func (*FuncEdgeUpdate) SetCallerKey ¶
func (feu *FuncEdgeUpdate) SetCallerKey(s string) *FuncEdgeUpdate
SetCallerKey sets the "CallerKey" field.
func (*FuncEdgeUpdate) SetCreatedAt ¶
func (feu *FuncEdgeUpdate) SetCreatedAt(t time.Time) *FuncEdgeUpdate
SetCreatedAt sets the "CreatedAt" field.
func (*FuncEdgeUpdate) SetNillableCalleeKey ¶
func (feu *FuncEdgeUpdate) SetNillableCalleeKey(s *string) *FuncEdgeUpdate
SetNillableCalleeKey sets the "CalleeKey" field if the given value is not nil.
func (*FuncEdgeUpdate) SetNillableCallerKey ¶
func (feu *FuncEdgeUpdate) SetNillableCallerKey(s *string) *FuncEdgeUpdate
SetNillableCallerKey sets the "CallerKey" field if the given value is not nil.
func (*FuncEdgeUpdate) SetNillableCreatedAt ¶
func (feu *FuncEdgeUpdate) SetNillableCreatedAt(t *time.Time) *FuncEdgeUpdate
SetNillableCreatedAt sets the "CreatedAt" field if the given value is not nil.
func (*FuncEdgeUpdate) SetNillableUpdatedAt ¶
func (feu *FuncEdgeUpdate) SetNillableUpdatedAt(t *time.Time) *FuncEdgeUpdate
SetNillableUpdatedAt sets the "UpdatedAt" field if the given value is not nil.
func (*FuncEdgeUpdate) SetUpdatedAt ¶
func (feu *FuncEdgeUpdate) SetUpdatedAt(t time.Time) *FuncEdgeUpdate
SetUpdatedAt sets the "UpdatedAt" field.
func (*FuncEdgeUpdate) Where ¶
func (feu *FuncEdgeUpdate) Where(ps ...predicate.FuncEdge) *FuncEdgeUpdate
Where appends a list predicates to the FuncEdgeUpdate builder.
type FuncEdgeUpdateOne ¶
type FuncEdgeUpdateOne struct {
// contains filtered or unexported fields
}
FuncEdgeUpdateOne is the builder for updating a single FuncEdge entity.
func (*FuncEdgeUpdateOne) Exec ¶
func (feuo *FuncEdgeUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*FuncEdgeUpdateOne) ExecX ¶
func (feuo *FuncEdgeUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FuncEdgeUpdateOne) Mutation ¶
func (feuo *FuncEdgeUpdateOne) Mutation() *FuncEdgeMutation
Mutation returns the FuncEdgeMutation object of the builder.
func (*FuncEdgeUpdateOne) Save ¶
func (feuo *FuncEdgeUpdateOne) Save(ctx context.Context) (*FuncEdge, error)
Save executes the query and returns the updated FuncEdge entity.
func (*FuncEdgeUpdateOne) SaveX ¶
func (feuo *FuncEdgeUpdateOne) SaveX(ctx context.Context) *FuncEdge
SaveX is like Save, but panics if an error occurs.
func (*FuncEdgeUpdateOne) Select ¶
func (feuo *FuncEdgeUpdateOne) Select(field string, fields ...string) *FuncEdgeUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*FuncEdgeUpdateOne) SetCalleeKey ¶
func (feuo *FuncEdgeUpdateOne) SetCalleeKey(s string) *FuncEdgeUpdateOne
SetCalleeKey sets the "CalleeKey" field.
func (*FuncEdgeUpdateOne) SetCallerKey ¶
func (feuo *FuncEdgeUpdateOne) SetCallerKey(s string) *FuncEdgeUpdateOne
SetCallerKey sets the "CallerKey" field.
func (*FuncEdgeUpdateOne) SetCreatedAt ¶
func (feuo *FuncEdgeUpdateOne) SetCreatedAt(t time.Time) *FuncEdgeUpdateOne
SetCreatedAt sets the "CreatedAt" field.
func (*FuncEdgeUpdateOne) SetNillableCalleeKey ¶
func (feuo *FuncEdgeUpdateOne) SetNillableCalleeKey(s *string) *FuncEdgeUpdateOne
SetNillableCalleeKey sets the "CalleeKey" field if the given value is not nil.
func (*FuncEdgeUpdateOne) SetNillableCallerKey ¶
func (feuo *FuncEdgeUpdateOne) SetNillableCallerKey(s *string) *FuncEdgeUpdateOne
SetNillableCallerKey sets the "CallerKey" field if the given value is not nil.
func (*FuncEdgeUpdateOne) SetNillableCreatedAt ¶
func (feuo *FuncEdgeUpdateOne) SetNillableCreatedAt(t *time.Time) *FuncEdgeUpdateOne
SetNillableCreatedAt sets the "CreatedAt" field if the given value is not nil.
func (*FuncEdgeUpdateOne) SetNillableUpdatedAt ¶
func (feuo *FuncEdgeUpdateOne) SetNillableUpdatedAt(t *time.Time) *FuncEdgeUpdateOne
SetNillableUpdatedAt sets the "UpdatedAt" field if the given value is not nil.
func (*FuncEdgeUpdateOne) SetUpdatedAt ¶
func (feuo *FuncEdgeUpdateOne) SetUpdatedAt(t time.Time) *FuncEdgeUpdateOne
SetUpdatedAt sets the "UpdatedAt" field.
func (*FuncEdgeUpdateOne) Where ¶
func (feuo *FuncEdgeUpdateOne) Where(ps ...predicate.FuncEdge) *FuncEdgeUpdateOne
Where appends a list predicates to the FuncEdgeUpdate builder.
type FuncNode ¶
type FuncNode struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// 短格式唯一标识,如 n6796
Key string `json:"key,omitempty"`
// 完整的函数路径,如 crypto/hmac.New$1
FullName string `json:"full_name,omitempty"`
// Pkg holds the value of the "pkg" field.
Pkg string `json:"pkg,omitempty"`
// Name holds the value of the "name" field.
Name string `json:"name,omitempty"`
// CreatedAt holds the value of the "CreatedAt" field.
CreatedAt time.Time `json:"CreatedAt,omitempty"`
// UpdatedAt holds the value of the "UpdatedAt" field.
UpdatedAt time.Time `json:"UpdatedAt,omitempty"`
// contains filtered or unexported fields
}
FuncNode is the model entity for the FuncNode schema.
func (*FuncNode) Unwrap ¶
Unwrap unwraps the FuncNode 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 (*FuncNode) Update ¶
func (fn *FuncNode) Update() *FuncNodeUpdateOne
Update returns a builder for updating this FuncNode. Note that you need to call FuncNode.Unwrap() before calling this method if this FuncNode was returned from a transaction, and the transaction was committed or rolled back.
type FuncNodeClient ¶
type FuncNodeClient struct {
// contains filtered or unexported fields
}
FuncNodeClient is a client for the FuncNode schema.
func NewFuncNodeClient ¶
func NewFuncNodeClient(c config) *FuncNodeClient
NewFuncNodeClient returns a client for the FuncNode from the given config.
func (*FuncNodeClient) Create ¶
func (c *FuncNodeClient) Create() *FuncNodeCreate
Create returns a builder for creating a FuncNode entity.
func (*FuncNodeClient) CreateBulk ¶
func (c *FuncNodeClient) CreateBulk(builders ...*FuncNodeCreate) *FuncNodeCreateBulk
CreateBulk returns a builder for creating a bulk of FuncNode entities.
func (*FuncNodeClient) Delete ¶
func (c *FuncNodeClient) Delete() *FuncNodeDelete
Delete returns a delete builder for FuncNode.
func (*FuncNodeClient) DeleteOne ¶
func (c *FuncNodeClient) DeleteOne(fn *FuncNode) *FuncNodeDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*FuncNodeClient) DeleteOneID ¶
func (c *FuncNodeClient) DeleteOneID(id int) *FuncNodeDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*FuncNodeClient) GetX ¶
func (c *FuncNodeClient) GetX(ctx context.Context, id int) *FuncNode
GetX is like Get, but panics if an error occurs.
func (*FuncNodeClient) Hooks ¶
func (c *FuncNodeClient) Hooks() []Hook
Hooks returns the client hooks.
func (*FuncNodeClient) Intercept ¶
func (c *FuncNodeClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `funcnode.Intercept(f(g(h())))`.
func (*FuncNodeClient) Interceptors ¶
func (c *FuncNodeClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*FuncNodeClient) MapCreateBulk ¶
func (c *FuncNodeClient) MapCreateBulk(slice any, setFunc func(*FuncNodeCreate, int)) *FuncNodeCreateBulk
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 (*FuncNodeClient) Query ¶
func (c *FuncNodeClient) Query() *FuncNodeQuery
Query returns a query builder for FuncNode.
func (*FuncNodeClient) Update ¶
func (c *FuncNodeClient) Update() *FuncNodeUpdate
Update returns an update builder for FuncNode.
func (*FuncNodeClient) UpdateOne ¶
func (c *FuncNodeClient) UpdateOne(fn *FuncNode) *FuncNodeUpdateOne
UpdateOne returns an update builder for the given entity.
func (*FuncNodeClient) UpdateOneID ¶
func (c *FuncNodeClient) UpdateOneID(id int) *FuncNodeUpdateOne
UpdateOneID returns an update builder for the given id.
func (*FuncNodeClient) Use ¶
func (c *FuncNodeClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `funcnode.Hooks(f(g(h())))`.
type FuncNodeCreate ¶
type FuncNodeCreate struct {
// contains filtered or unexported fields
}
FuncNodeCreate is the builder for creating a FuncNode entity.
func (*FuncNodeCreate) Exec ¶
func (fnc *FuncNodeCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*FuncNodeCreate) ExecX ¶
func (fnc *FuncNodeCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FuncNodeCreate) Mutation ¶
func (fnc *FuncNodeCreate) Mutation() *FuncNodeMutation
Mutation returns the FuncNodeMutation object of the builder.
func (*FuncNodeCreate) Save ¶
func (fnc *FuncNodeCreate) Save(ctx context.Context) (*FuncNode, error)
Save creates the FuncNode in the database.
func (*FuncNodeCreate) SaveX ¶
func (fnc *FuncNodeCreate) SaveX(ctx context.Context) *FuncNode
SaveX calls Save and panics if Save returns an error.
func (*FuncNodeCreate) SetCreatedAt ¶
func (fnc *FuncNodeCreate) SetCreatedAt(t time.Time) *FuncNodeCreate
SetCreatedAt sets the "CreatedAt" field.
func (*FuncNodeCreate) SetFullName ¶ added in v1.1.6
func (fnc *FuncNodeCreate) SetFullName(s string) *FuncNodeCreate
SetFullName sets the "full_name" field.
func (*FuncNodeCreate) SetKey ¶
func (fnc *FuncNodeCreate) SetKey(s string) *FuncNodeCreate
SetKey sets the "key" field.
func (*FuncNodeCreate) SetName ¶
func (fnc *FuncNodeCreate) SetName(s string) *FuncNodeCreate
SetName sets the "name" field.
func (*FuncNodeCreate) SetNillableCreatedAt ¶
func (fnc *FuncNodeCreate) SetNillableCreatedAt(t *time.Time) *FuncNodeCreate
SetNillableCreatedAt sets the "CreatedAt" field if the given value is not nil.
func (*FuncNodeCreate) SetNillableUpdatedAt ¶
func (fnc *FuncNodeCreate) SetNillableUpdatedAt(t *time.Time) *FuncNodeCreate
SetNillableUpdatedAt sets the "UpdatedAt" field if the given value is not nil.
func (*FuncNodeCreate) SetPkg ¶
func (fnc *FuncNodeCreate) SetPkg(s string) *FuncNodeCreate
SetPkg sets the "pkg" field.
func (*FuncNodeCreate) SetUpdatedAt ¶
func (fnc *FuncNodeCreate) SetUpdatedAt(t time.Time) *FuncNodeCreate
SetUpdatedAt sets the "UpdatedAt" field.
type FuncNodeCreateBulk ¶
type FuncNodeCreateBulk struct {
// contains filtered or unexported fields
}
FuncNodeCreateBulk is the builder for creating many FuncNode entities in bulk.
func (*FuncNodeCreateBulk) Exec ¶
func (fncb *FuncNodeCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*FuncNodeCreateBulk) ExecX ¶
func (fncb *FuncNodeCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type FuncNodeDelete ¶
type FuncNodeDelete struct {
// contains filtered or unexported fields
}
FuncNodeDelete is the builder for deleting a FuncNode entity.
func (*FuncNodeDelete) Exec ¶
func (fnd *FuncNodeDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*FuncNodeDelete) ExecX ¶
func (fnd *FuncNodeDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*FuncNodeDelete) Where ¶
func (fnd *FuncNodeDelete) Where(ps ...predicate.FuncNode) *FuncNodeDelete
Where appends a list predicates to the FuncNodeDelete builder.
type FuncNodeDeleteOne ¶
type FuncNodeDeleteOne struct {
// contains filtered or unexported fields
}
FuncNodeDeleteOne is the builder for deleting a single FuncNode entity.
func (*FuncNodeDeleteOne) Exec ¶
func (fndo *FuncNodeDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*FuncNodeDeleteOne) ExecX ¶
func (fndo *FuncNodeDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FuncNodeDeleteOne) Where ¶
func (fndo *FuncNodeDeleteOne) Where(ps ...predicate.FuncNode) *FuncNodeDeleteOne
Where appends a list predicates to the FuncNodeDelete builder.
type FuncNodeGroupBy ¶
type FuncNodeGroupBy struct {
// contains filtered or unexported fields
}
FuncNodeGroupBy is the group-by builder for FuncNode entities.
func (*FuncNodeGroupBy) Aggregate ¶
func (fngb *FuncNodeGroupBy) Aggregate(fns ...AggregateFunc) *FuncNodeGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*FuncNodeGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FuncNodeGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FuncNodeGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FuncNodeGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FuncNodeGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FuncNodeGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FuncNodeGroupBy) Scan ¶
func (fngb *FuncNodeGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FuncNodeGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FuncNodeMutation ¶
type FuncNodeMutation struct {
// contains filtered or unexported fields
}
FuncNodeMutation represents an operation that mutates the FuncNode nodes in the graph.
func (*FuncNodeMutation) AddField ¶
func (m *FuncNodeMutation) 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 (*FuncNodeMutation) AddedEdges ¶
func (m *FuncNodeMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*FuncNodeMutation) AddedField ¶
func (m *FuncNodeMutation) 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 (*FuncNodeMutation) AddedFields ¶
func (m *FuncNodeMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*FuncNodeMutation) AddedIDs ¶
func (m *FuncNodeMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*FuncNodeMutation) ClearEdge ¶
func (m *FuncNodeMutation) 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 (*FuncNodeMutation) ClearField ¶
func (m *FuncNodeMutation) 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 (*FuncNodeMutation) ClearedEdges ¶
func (m *FuncNodeMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*FuncNodeMutation) ClearedFields ¶
func (m *FuncNodeMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (FuncNodeMutation) Client ¶
func (m FuncNodeMutation) 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 (*FuncNodeMutation) CreatedAt ¶
func (m *FuncNodeMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "CreatedAt" field in the mutation.
func (*FuncNodeMutation) EdgeCleared ¶
func (m *FuncNodeMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*FuncNodeMutation) Field ¶
func (m *FuncNodeMutation) 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 (*FuncNodeMutation) FieldCleared ¶
func (m *FuncNodeMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*FuncNodeMutation) Fields ¶
func (m *FuncNodeMutation) 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 (*FuncNodeMutation) FullName ¶ added in v1.1.6
func (m *FuncNodeMutation) FullName() (r string, exists bool)
FullName returns the value of the "full_name" field in the mutation.
func (*FuncNodeMutation) ID ¶
func (m *FuncNodeMutation) 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 (*FuncNodeMutation) IDs ¶
func (m *FuncNodeMutation) 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 (*FuncNodeMutation) Key ¶
func (m *FuncNodeMutation) Key() (r string, exists bool)
Key returns the value of the "key" field in the mutation.
func (*FuncNodeMutation) Name ¶
func (m *FuncNodeMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*FuncNodeMutation) OldCreatedAt ¶
OldCreatedAt returns the old "CreatedAt" field's value of the FuncNode entity. If the FuncNode 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 (*FuncNodeMutation) 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 (*FuncNodeMutation) OldFullName ¶ added in v1.1.6
func (m *FuncNodeMutation) OldFullName(ctx context.Context) (v string, err error)
OldFullName returns the old "full_name" field's value of the FuncNode entity. If the FuncNode 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 (*FuncNodeMutation) OldKey ¶
func (m *FuncNodeMutation) OldKey(ctx context.Context) (v string, err error)
OldKey returns the old "key" field's value of the FuncNode entity. If the FuncNode 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 (*FuncNodeMutation) OldName ¶
func (m *FuncNodeMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the FuncNode entity. If the FuncNode 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 (*FuncNodeMutation) OldPkg ¶
func (m *FuncNodeMutation) OldPkg(ctx context.Context) (v string, err error)
OldPkg returns the old "pkg" field's value of the FuncNode entity. If the FuncNode 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 (*FuncNodeMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "UpdatedAt" field's value of the FuncNode entity. If the FuncNode 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 (*FuncNodeMutation) Pkg ¶
func (m *FuncNodeMutation) Pkg() (r string, exists bool)
Pkg returns the value of the "pkg" field in the mutation.
func (*FuncNodeMutation) RemovedEdges ¶
func (m *FuncNodeMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*FuncNodeMutation) RemovedIDs ¶
func (m *FuncNodeMutation) 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 (*FuncNodeMutation) ResetCreatedAt ¶
func (m *FuncNodeMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "CreatedAt" field.
func (*FuncNodeMutation) ResetEdge ¶
func (m *FuncNodeMutation) 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 (*FuncNodeMutation) ResetField ¶
func (m *FuncNodeMutation) 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 (*FuncNodeMutation) ResetFullName ¶ added in v1.1.6
func (m *FuncNodeMutation) ResetFullName()
ResetFullName resets all changes to the "full_name" field.
func (*FuncNodeMutation) ResetKey ¶
func (m *FuncNodeMutation) ResetKey()
ResetKey resets all changes to the "key" field.
func (*FuncNodeMutation) ResetName ¶
func (m *FuncNodeMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*FuncNodeMutation) ResetPkg ¶
func (m *FuncNodeMutation) ResetPkg()
ResetPkg resets all changes to the "pkg" field.
func (*FuncNodeMutation) ResetUpdatedAt ¶
func (m *FuncNodeMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "UpdatedAt" field.
func (*FuncNodeMutation) SetCreatedAt ¶
func (m *FuncNodeMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "CreatedAt" field.
func (*FuncNodeMutation) SetField ¶
func (m *FuncNodeMutation) 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 (*FuncNodeMutation) SetFullName ¶ added in v1.1.6
func (m *FuncNodeMutation) SetFullName(s string)
SetFullName sets the "full_name" field.
func (*FuncNodeMutation) SetKey ¶
func (m *FuncNodeMutation) SetKey(s string)
SetKey sets the "key" field.
func (*FuncNodeMutation) SetName ¶
func (m *FuncNodeMutation) SetName(s string)
SetName sets the "name" field.
func (*FuncNodeMutation) SetOp ¶
func (m *FuncNodeMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*FuncNodeMutation) SetPkg ¶
func (m *FuncNodeMutation) SetPkg(s string)
SetPkg sets the "pkg" field.
func (*FuncNodeMutation) SetUpdatedAt ¶
func (m *FuncNodeMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "UpdatedAt" field.
func (FuncNodeMutation) Tx ¶
func (m FuncNodeMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*FuncNodeMutation) Type ¶
func (m *FuncNodeMutation) Type() string
Type returns the node type of this mutation (FuncNode).
func (*FuncNodeMutation) UpdatedAt ¶
func (m *FuncNodeMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "UpdatedAt" field in the mutation.
func (*FuncNodeMutation) Where ¶
func (m *FuncNodeMutation) Where(ps ...predicate.FuncNode)
Where appends a list predicates to the FuncNodeMutation builder.
func (*FuncNodeMutation) WhereP ¶
func (m *FuncNodeMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the FuncNodeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type FuncNodeQuery ¶
type FuncNodeQuery struct {
// contains filtered or unexported fields
}
FuncNodeQuery is the builder for querying FuncNode entities.
func (*FuncNodeQuery) Aggregate ¶
func (fnq *FuncNodeQuery) Aggregate(fns ...AggregateFunc) *FuncNodeSelect
Aggregate returns a FuncNodeSelect configured with the given aggregations.
func (*FuncNodeQuery) All ¶
func (fnq *FuncNodeQuery) All(ctx context.Context) ([]*FuncNode, error)
All executes the query and returns a list of FuncNodes.
func (*FuncNodeQuery) AllX ¶
func (fnq *FuncNodeQuery) AllX(ctx context.Context) []*FuncNode
AllX is like All, but panics if an error occurs.
func (*FuncNodeQuery) Clone ¶
func (fnq *FuncNodeQuery) Clone() *FuncNodeQuery
Clone returns a duplicate of the FuncNodeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*FuncNodeQuery) Count ¶
func (fnq *FuncNodeQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*FuncNodeQuery) CountX ¶
func (fnq *FuncNodeQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*FuncNodeQuery) Exist ¶
func (fnq *FuncNodeQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*FuncNodeQuery) ExistX ¶
func (fnq *FuncNodeQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*FuncNodeQuery) First ¶
func (fnq *FuncNodeQuery) First(ctx context.Context) (*FuncNode, error)
First returns the first FuncNode entity from the query. Returns a *NotFoundError when no FuncNode was found.
func (*FuncNodeQuery) FirstID ¶
func (fnq *FuncNodeQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first FuncNode ID from the query. Returns a *NotFoundError when no FuncNode ID was found.
func (*FuncNodeQuery) FirstIDX ¶
func (fnq *FuncNodeQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*FuncNodeQuery) FirstX ¶
func (fnq *FuncNodeQuery) FirstX(ctx context.Context) *FuncNode
FirstX is like First, but panics if an error occurs.
func (*FuncNodeQuery) GroupBy ¶
func (fnq *FuncNodeQuery) GroupBy(field string, fields ...string) *FuncNodeGroupBy
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 {
Key string `json:"key,omitempty"`
Count int `json:"count,omitempty"`
}
client.FuncNode.Query().
GroupBy(funcnode.FieldKey).
Aggregate(gen.Count()).
Scan(ctx, &v)
func (*FuncNodeQuery) IDs ¶
func (fnq *FuncNodeQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of FuncNode IDs.
func (*FuncNodeQuery) IDsX ¶
func (fnq *FuncNodeQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*FuncNodeQuery) Limit ¶
func (fnq *FuncNodeQuery) Limit(limit int) *FuncNodeQuery
Limit the number of records to be returned by this query.
func (*FuncNodeQuery) Offset ¶
func (fnq *FuncNodeQuery) Offset(offset int) *FuncNodeQuery
Offset to start from.
func (*FuncNodeQuery) Only ¶
func (fnq *FuncNodeQuery) Only(ctx context.Context) (*FuncNode, error)
Only returns a single FuncNode entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one FuncNode entity is found. Returns a *NotFoundError when no FuncNode entities are found.
func (*FuncNodeQuery) OnlyID ¶
func (fnq *FuncNodeQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only FuncNode ID in the query. Returns a *NotSingularError when more than one FuncNode ID is found. Returns a *NotFoundError when no entities are found.
func (*FuncNodeQuery) OnlyIDX ¶
func (fnq *FuncNodeQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*FuncNodeQuery) OnlyX ¶
func (fnq *FuncNodeQuery) OnlyX(ctx context.Context) *FuncNode
OnlyX is like Only, but panics if an error occurs.
func (*FuncNodeQuery) Order ¶
func (fnq *FuncNodeQuery) Order(o ...funcnode.OrderOption) *FuncNodeQuery
Order specifies how the records should be ordered.
func (*FuncNodeQuery) Select ¶
func (fnq *FuncNodeQuery) Select(fields ...string) *FuncNodeSelect
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 {
Key string `json:"key,omitempty"`
}
client.FuncNode.Query().
Select(funcnode.FieldKey).
Scan(ctx, &v)
func (*FuncNodeQuery) Unique ¶
func (fnq *FuncNodeQuery) Unique(unique bool) *FuncNodeQuery
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 (*FuncNodeQuery) Where ¶
func (fnq *FuncNodeQuery) Where(ps ...predicate.FuncNode) *FuncNodeQuery
Where adds a new predicate for the FuncNodeQuery builder.
type FuncNodeSelect ¶
type FuncNodeSelect struct {
*FuncNodeQuery
// contains filtered or unexported fields
}
FuncNodeSelect is the builder for selecting fields of FuncNode entities.
func (*FuncNodeSelect) Aggregate ¶
func (fns *FuncNodeSelect) Aggregate(fnss ...AggregateFunc) *FuncNodeSelect
Aggregate adds the given aggregation functions to the selector query.
func (*FuncNodeSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FuncNodeSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FuncNodeSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FuncNodeSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FuncNodeSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FuncNodeSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FuncNodeSelect) Scan ¶
func (fns *FuncNodeSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FuncNodeSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FuncNodeUpdate ¶
type FuncNodeUpdate struct {
// contains filtered or unexported fields
}
FuncNodeUpdate is the builder for updating FuncNode entities.
func (*FuncNodeUpdate) Exec ¶
func (fnu *FuncNodeUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*FuncNodeUpdate) ExecX ¶
func (fnu *FuncNodeUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FuncNodeUpdate) Mutation ¶
func (fnu *FuncNodeUpdate) Mutation() *FuncNodeMutation
Mutation returns the FuncNodeMutation object of the builder.
func (*FuncNodeUpdate) Save ¶
func (fnu *FuncNodeUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*FuncNodeUpdate) SaveX ¶
func (fnu *FuncNodeUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*FuncNodeUpdate) SetCreatedAt ¶
func (fnu *FuncNodeUpdate) SetCreatedAt(t time.Time) *FuncNodeUpdate
SetCreatedAt sets the "CreatedAt" field.
func (*FuncNodeUpdate) SetFullName ¶ added in v1.1.6
func (fnu *FuncNodeUpdate) SetFullName(s string) *FuncNodeUpdate
SetFullName sets the "full_name" field.
func (*FuncNodeUpdate) SetKey ¶
func (fnu *FuncNodeUpdate) SetKey(s string) *FuncNodeUpdate
SetKey sets the "key" field.
func (*FuncNodeUpdate) SetName ¶
func (fnu *FuncNodeUpdate) SetName(s string) *FuncNodeUpdate
SetName sets the "name" field.
func (*FuncNodeUpdate) SetNillableCreatedAt ¶
func (fnu *FuncNodeUpdate) SetNillableCreatedAt(t *time.Time) *FuncNodeUpdate
SetNillableCreatedAt sets the "CreatedAt" field if the given value is not nil.
func (*FuncNodeUpdate) SetNillableFullName ¶ added in v1.1.6
func (fnu *FuncNodeUpdate) SetNillableFullName(s *string) *FuncNodeUpdate
SetNillableFullName sets the "full_name" field if the given value is not nil.
func (*FuncNodeUpdate) SetNillableKey ¶
func (fnu *FuncNodeUpdate) SetNillableKey(s *string) *FuncNodeUpdate
SetNillableKey sets the "key" field if the given value is not nil.
func (*FuncNodeUpdate) SetNillableName ¶
func (fnu *FuncNodeUpdate) SetNillableName(s *string) *FuncNodeUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*FuncNodeUpdate) SetNillablePkg ¶
func (fnu *FuncNodeUpdate) SetNillablePkg(s *string) *FuncNodeUpdate
SetNillablePkg sets the "pkg" field if the given value is not nil.
func (*FuncNodeUpdate) SetNillableUpdatedAt ¶
func (fnu *FuncNodeUpdate) SetNillableUpdatedAt(t *time.Time) *FuncNodeUpdate
SetNillableUpdatedAt sets the "UpdatedAt" field if the given value is not nil.
func (*FuncNodeUpdate) SetPkg ¶
func (fnu *FuncNodeUpdate) SetPkg(s string) *FuncNodeUpdate
SetPkg sets the "pkg" field.
func (*FuncNodeUpdate) SetUpdatedAt ¶
func (fnu *FuncNodeUpdate) SetUpdatedAt(t time.Time) *FuncNodeUpdate
SetUpdatedAt sets the "UpdatedAt" field.
func (*FuncNodeUpdate) Where ¶
func (fnu *FuncNodeUpdate) Where(ps ...predicate.FuncNode) *FuncNodeUpdate
Where appends a list predicates to the FuncNodeUpdate builder.
type FuncNodeUpdateOne ¶
type FuncNodeUpdateOne struct {
// contains filtered or unexported fields
}
FuncNodeUpdateOne is the builder for updating a single FuncNode entity.
func (*FuncNodeUpdateOne) Exec ¶
func (fnuo *FuncNodeUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*FuncNodeUpdateOne) ExecX ¶
func (fnuo *FuncNodeUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FuncNodeUpdateOne) Mutation ¶
func (fnuo *FuncNodeUpdateOne) Mutation() *FuncNodeMutation
Mutation returns the FuncNodeMutation object of the builder.
func (*FuncNodeUpdateOne) Save ¶
func (fnuo *FuncNodeUpdateOne) Save(ctx context.Context) (*FuncNode, error)
Save executes the query and returns the updated FuncNode entity.
func (*FuncNodeUpdateOne) SaveX ¶
func (fnuo *FuncNodeUpdateOne) SaveX(ctx context.Context) *FuncNode
SaveX is like Save, but panics if an error occurs.
func (*FuncNodeUpdateOne) Select ¶
func (fnuo *FuncNodeUpdateOne) Select(field string, fields ...string) *FuncNodeUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*FuncNodeUpdateOne) SetCreatedAt ¶
func (fnuo *FuncNodeUpdateOne) SetCreatedAt(t time.Time) *FuncNodeUpdateOne
SetCreatedAt sets the "CreatedAt" field.
func (*FuncNodeUpdateOne) SetFullName ¶ added in v1.1.6
func (fnuo *FuncNodeUpdateOne) SetFullName(s string) *FuncNodeUpdateOne
SetFullName sets the "full_name" field.
func (*FuncNodeUpdateOne) SetKey ¶
func (fnuo *FuncNodeUpdateOne) SetKey(s string) *FuncNodeUpdateOne
SetKey sets the "key" field.
func (*FuncNodeUpdateOne) SetName ¶
func (fnuo *FuncNodeUpdateOne) SetName(s string) *FuncNodeUpdateOne
SetName sets the "name" field.
func (*FuncNodeUpdateOne) SetNillableCreatedAt ¶
func (fnuo *FuncNodeUpdateOne) SetNillableCreatedAt(t *time.Time) *FuncNodeUpdateOne
SetNillableCreatedAt sets the "CreatedAt" field if the given value is not nil.
func (*FuncNodeUpdateOne) SetNillableFullName ¶ added in v1.1.6
func (fnuo *FuncNodeUpdateOne) SetNillableFullName(s *string) *FuncNodeUpdateOne
SetNillableFullName sets the "full_name" field if the given value is not nil.
func (*FuncNodeUpdateOne) SetNillableKey ¶
func (fnuo *FuncNodeUpdateOne) SetNillableKey(s *string) *FuncNodeUpdateOne
SetNillableKey sets the "key" field if the given value is not nil.
func (*FuncNodeUpdateOne) SetNillableName ¶
func (fnuo *FuncNodeUpdateOne) SetNillableName(s *string) *FuncNodeUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*FuncNodeUpdateOne) SetNillablePkg ¶
func (fnuo *FuncNodeUpdateOne) SetNillablePkg(s *string) *FuncNodeUpdateOne
SetNillablePkg sets the "pkg" field if the given value is not nil.
func (*FuncNodeUpdateOne) SetNillableUpdatedAt ¶
func (fnuo *FuncNodeUpdateOne) SetNillableUpdatedAt(t *time.Time) *FuncNodeUpdateOne
SetNillableUpdatedAt sets the "UpdatedAt" field if the given value is not nil.
func (*FuncNodeUpdateOne) SetPkg ¶
func (fnuo *FuncNodeUpdateOne) SetPkg(s string) *FuncNodeUpdateOne
SetPkg sets the "pkg" field.
func (*FuncNodeUpdateOne) SetUpdatedAt ¶
func (fnuo *FuncNodeUpdateOne) SetUpdatedAt(t time.Time) *FuncNodeUpdateOne
SetUpdatedAt sets the "UpdatedAt" field.
func (*FuncNodeUpdateOne) Where ¶
func (fnuo *FuncNodeUpdateOne) Where(ps ...predicate.FuncNode) *FuncNodeUpdateOne
Where appends a list predicates to the FuncNodeUpdate builder.
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 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 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 TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct {
// FuncEdge is the client for interacting with the FuncEdge builders.
FuncEdge *FuncEdgeClient
// FuncNode is the client for interacting with the FuncNode builders.
FuncNode *FuncNodeClient
// 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.