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 Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Pkg
- type PkgClient
- func (c *PkgClient) Create() *PkgCreate
- func (c *PkgClient) CreateBulk(builders ...*PkgCreate) *PkgCreateBulk
- func (c *PkgClient) Delete() *PkgDelete
- func (c *PkgClient) DeleteOne(pk *Pkg) *PkgDeleteOne
- func (c *PkgClient) DeleteOneID(id uuid.UUID) *PkgDeleteOne
- func (c *PkgClient) Get(ctx context.Context, id uuid.UUID) (*Pkg, error)
- func (c *PkgClient) GetX(ctx context.Context, id uuid.UUID) *Pkg
- func (c *PkgClient) Hooks() []Hook
- func (c *PkgClient) Intercept(interceptors ...Interceptor)
- func (c *PkgClient) Interceptors() []Interceptor
- func (c *PkgClient) MapCreateBulk(slice any, setFunc func(*PkgCreate, int)) *PkgCreateBulk
- func (c *PkgClient) Query() *PkgQuery
- func (c *PkgClient) QueryTarget(pk *Pkg) *TargetQuery
- func (c *PkgClient) Update() *PkgUpdate
- func (c *PkgClient) UpdateOne(pk *Pkg) *PkgUpdateOne
- func (c *PkgClient) UpdateOneID(id uuid.UUID) *PkgUpdateOne
- func (c *PkgClient) Use(hooks ...Hook)
- type PkgCreate
- func (pc *PkgCreate) Exec(ctx context.Context) error
- func (pc *PkgCreate) ExecX(ctx context.Context)
- func (pc *PkgCreate) Mutation() *PkgMutation
- func (pc *PkgCreate) Save(ctx context.Context) (*Pkg, error)
- func (pc *PkgCreate) SaveX(ctx context.Context) *Pkg
- func (pc *PkgCreate) SetCategory(s string) *PkgCreate
- func (pc *PkgCreate) SetID(u uuid.UUID) *PkgCreate
- func (pc *PkgCreate) SetName(s string) *PkgCreate
- func (pc *PkgCreate) SetNillableID(u *uuid.UUID) *PkgCreate
- func (pc *PkgCreate) SetPackageFields(value *parser.PackageCommon) *PkgCreate
- func (pc *PkgCreate) SetRepository(s string) *PkgCreate
- func (pc *PkgCreate) SetTarget(t *Target) *PkgCreate
- func (pc *PkgCreate) SetTargetID(u uuid.UUID) *PkgCreate
- func (pc *PkgCreate) SetVersion(s string) *PkgCreate
- type PkgCreateBulk
- type PkgDelete
- type PkgDeleteOne
- type PkgEdges
- type PkgGroupBy
- func (pgb *PkgGroupBy) Aggregate(fns ...AggregateFunc) *PkgGroupBy
- func (s *PkgGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *PkgGroupBy) BoolX(ctx context.Context) bool
- func (s *PkgGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *PkgGroupBy) BoolsX(ctx context.Context) []bool
- func (s *PkgGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *PkgGroupBy) Float64X(ctx context.Context) float64
- func (s *PkgGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *PkgGroupBy) Float64sX(ctx context.Context) []float64
- func (s *PkgGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *PkgGroupBy) IntX(ctx context.Context) int
- func (s *PkgGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *PkgGroupBy) IntsX(ctx context.Context) []int
- func (pgb *PkgGroupBy) Scan(ctx context.Context, v any) error
- func (s *PkgGroupBy) ScanX(ctx context.Context, v any)
- func (s *PkgGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *PkgGroupBy) StringX(ctx context.Context) string
- func (s *PkgGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *PkgGroupBy) StringsX(ctx context.Context) []string
- type PkgMutation
- func (m *PkgMutation) AddField(name string, value ent.Value) error
- func (m *PkgMutation) AddedEdges() []string
- func (m *PkgMutation) AddedField(name string) (ent.Value, bool)
- func (m *PkgMutation) AddedFields() []string
- func (m *PkgMutation) AddedIDs(name string) []ent.Value
- func (m *PkgMutation) Category() (r string, exists bool)
- func (m *PkgMutation) ClearEdge(name string) error
- func (m *PkgMutation) ClearField(name string) error
- func (m *PkgMutation) ClearTarget()
- func (m *PkgMutation) ClearedEdges() []string
- func (m *PkgMutation) ClearedFields() []string
- func (m PkgMutation) Client() *Client
- func (m *PkgMutation) EdgeCleared(name string) bool
- func (m *PkgMutation) Field(name string) (ent.Value, bool)
- func (m *PkgMutation) FieldCleared(name string) bool
- func (m *PkgMutation) Fields() []string
- func (m *PkgMutation) ID() (id uuid.UUID, exists bool)
- func (m *PkgMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *PkgMutation) Name() (r string, exists bool)
- func (m *PkgMutation) OldCategory(ctx context.Context) (v string, err error)
- func (m *PkgMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *PkgMutation) OldName(ctx context.Context) (v string, err error)
- func (m *PkgMutation) OldPackageFields(ctx context.Context) (v *parser.PackageCommon, err error)
- func (m *PkgMutation) OldRepository(ctx context.Context) (v string, err error)
- func (m *PkgMutation) OldTargetID(ctx context.Context) (v uuid.UUID, err error)
- func (m *PkgMutation) OldVersion(ctx context.Context) (v string, err error)
- func (m *PkgMutation) Op() Op
- func (m *PkgMutation) PackageFields() (r *parser.PackageCommon, exists bool)
- func (m *PkgMutation) RemovedEdges() []string
- func (m *PkgMutation) RemovedIDs(name string) []ent.Value
- func (m *PkgMutation) Repository() (r string, exists bool)
- func (m *PkgMutation) ResetCategory()
- func (m *PkgMutation) ResetEdge(name string) error
- func (m *PkgMutation) ResetField(name string) error
- func (m *PkgMutation) ResetName()
- func (m *PkgMutation) ResetPackageFields()
- func (m *PkgMutation) ResetRepository()
- func (m *PkgMutation) ResetTarget()
- func (m *PkgMutation) ResetTargetID()
- func (m *PkgMutation) ResetVersion()
- func (m *PkgMutation) SetCategory(s string)
- func (m *PkgMutation) SetField(name string, value ent.Value) error
- func (m *PkgMutation) SetID(id uuid.UUID)
- func (m *PkgMutation) SetName(s string)
- func (m *PkgMutation) SetOp(op Op)
- func (m *PkgMutation) SetPackageFields(pc *parser.PackageCommon)
- func (m *PkgMutation) SetRepository(s string)
- func (m *PkgMutation) SetTargetID(u uuid.UUID)
- func (m *PkgMutation) SetVersion(s string)
- func (m *PkgMutation) TargetCleared() bool
- func (m *PkgMutation) TargetID() (r uuid.UUID, exists bool)
- func (m *PkgMutation) TargetIDs() (ids []uuid.UUID)
- func (m PkgMutation) Tx() (*Tx, error)
- func (m *PkgMutation) Type() string
- func (m *PkgMutation) Version() (r string, exists bool)
- func (m *PkgMutation) Where(ps ...predicate.Pkg)
- func (m *PkgMutation) WhereP(ps ...func(*sql.Selector))
- type PkgQuery
- func (pq *PkgQuery) Aggregate(fns ...AggregateFunc) *PkgSelect
- func (pq *PkgQuery) All(ctx context.Context) ([]*Pkg, error)
- func (pq *PkgQuery) AllX(ctx context.Context) []*Pkg
- func (pq *PkgQuery) Clone() *PkgQuery
- func (pq *PkgQuery) Count(ctx context.Context) (int, error)
- func (pq *PkgQuery) CountX(ctx context.Context) int
- func (pq *PkgQuery) Exist(ctx context.Context) (bool, error)
- func (pq *PkgQuery) ExistX(ctx context.Context) bool
- func (pq *PkgQuery) First(ctx context.Context) (*Pkg, error)
- func (pq *PkgQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (pq *PkgQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (pq *PkgQuery) FirstX(ctx context.Context) *Pkg
- func (pq *PkgQuery) GroupBy(field string, fields ...string) *PkgGroupBy
- func (pq *PkgQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (pq *PkgQuery) IDsX(ctx context.Context) []uuid.UUID
- func (pq *PkgQuery) Limit(limit int) *PkgQuery
- func (pq *PkgQuery) Offset(offset int) *PkgQuery
- func (pq *PkgQuery) Only(ctx context.Context) (*Pkg, error)
- func (pq *PkgQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (pq *PkgQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (pq *PkgQuery) OnlyX(ctx context.Context) *Pkg
- func (pq *PkgQuery) Order(o ...pkg.OrderOption) *PkgQuery
- func (pq *PkgQuery) QueryTarget() *TargetQuery
- func (pq *PkgQuery) Select(fields ...string) *PkgSelect
- func (pq *PkgQuery) Unique(unique bool) *PkgQuery
- func (pq *PkgQuery) Where(ps ...predicate.Pkg) *PkgQuery
- func (pq *PkgQuery) WithTarget(opts ...func(*TargetQuery)) *PkgQuery
- type PkgSelect
- func (ps *PkgSelect) Aggregate(fns ...AggregateFunc) *PkgSelect
- func (s *PkgSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *PkgSelect) BoolX(ctx context.Context) bool
- func (s *PkgSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *PkgSelect) BoolsX(ctx context.Context) []bool
- func (s *PkgSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *PkgSelect) Float64X(ctx context.Context) float64
- func (s *PkgSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *PkgSelect) Float64sX(ctx context.Context) []float64
- func (s *PkgSelect) Int(ctx context.Context) (_ int, err error)
- func (s *PkgSelect) IntX(ctx context.Context) int
- func (s *PkgSelect) Ints(ctx context.Context) ([]int, error)
- func (s *PkgSelect) IntsX(ctx context.Context) []int
- func (ps *PkgSelect) Scan(ctx context.Context, v any) error
- func (s *PkgSelect) ScanX(ctx context.Context, v any)
- func (s *PkgSelect) String(ctx context.Context) (_ string, err error)
- func (s *PkgSelect) StringX(ctx context.Context) string
- func (s *PkgSelect) Strings(ctx context.Context) ([]string, error)
- func (s *PkgSelect) StringsX(ctx context.Context) []string
- type PkgUpdate
- func (pu *PkgUpdate) ClearTarget() *PkgUpdate
- func (pu *PkgUpdate) Exec(ctx context.Context) error
- func (pu *PkgUpdate) ExecX(ctx context.Context)
- func (pu *PkgUpdate) Mutation() *PkgMutation
- func (pu *PkgUpdate) Save(ctx context.Context) (int, error)
- func (pu *PkgUpdate) SaveX(ctx context.Context) int
- func (pu *PkgUpdate) SetCategory(s string) *PkgUpdate
- func (pu *PkgUpdate) SetName(s string) *PkgUpdate
- func (pu *PkgUpdate) SetNillableCategory(s *string) *PkgUpdate
- func (pu *PkgUpdate) SetNillableName(s *string) *PkgUpdate
- func (pu *PkgUpdate) SetNillableRepository(s *string) *PkgUpdate
- func (pu *PkgUpdate) SetNillableTargetID(u *uuid.UUID) *PkgUpdate
- func (pu *PkgUpdate) SetNillableVersion(s *string) *PkgUpdate
- func (pu *PkgUpdate) SetPackageFields(pc *parser.PackageCommon) *PkgUpdate
- func (pu *PkgUpdate) SetRepository(s string) *PkgUpdate
- func (pu *PkgUpdate) SetTarget(t *Target) *PkgUpdate
- func (pu *PkgUpdate) SetTargetID(u uuid.UUID) *PkgUpdate
- func (pu *PkgUpdate) SetVersion(s string) *PkgUpdate
- func (pu *PkgUpdate) Where(ps ...predicate.Pkg) *PkgUpdate
- type PkgUpdateOne
- func (puo *PkgUpdateOne) ClearTarget() *PkgUpdateOne
- func (puo *PkgUpdateOne) Exec(ctx context.Context) error
- func (puo *PkgUpdateOne) ExecX(ctx context.Context)
- func (puo *PkgUpdateOne) Mutation() *PkgMutation
- func (puo *PkgUpdateOne) Save(ctx context.Context) (*Pkg, error)
- func (puo *PkgUpdateOne) SaveX(ctx context.Context) *Pkg
- func (puo *PkgUpdateOne) Select(field string, fields ...string) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetCategory(s string) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetName(s string) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetNillableCategory(s *string) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetNillableName(s *string) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetNillableRepository(s *string) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetNillableTargetID(u *uuid.UUID) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetNillableVersion(s *string) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetPackageFields(pc *parser.PackageCommon) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetRepository(s string) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetTarget(t *Target) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetTargetID(u uuid.UUID) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetVersion(s string) *PkgUpdateOne
- func (puo *PkgUpdateOne) Where(ps ...predicate.Pkg) *PkgUpdateOne
- type Pkgs
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Target
- type TargetClient
- func (c *TargetClient) Create() *TargetCreate
- func (c *TargetClient) CreateBulk(builders ...*TargetCreate) *TargetCreateBulk
- func (c *TargetClient) Delete() *TargetDelete
- func (c *TargetClient) DeleteOne(t *Target) *TargetDeleteOne
- func (c *TargetClient) DeleteOneID(id uuid.UUID) *TargetDeleteOne
- func (c *TargetClient) Get(ctx context.Context, id uuid.UUID) (*Target, error)
- func (c *TargetClient) GetX(ctx context.Context, id uuid.UUID) *Target
- func (c *TargetClient) Hooks() []Hook
- func (c *TargetClient) Intercept(interceptors ...Interceptor)
- func (c *TargetClient) Interceptors() []Interceptor
- func (c *TargetClient) MapCreateBulk(slice any, setFunc func(*TargetCreate, int)) *TargetCreateBulk
- func (c *TargetClient) Query() *TargetQuery
- func (c *TargetClient) QueryPackages(t *Target) *PkgQuery
- func (c *TargetClient) Update() *TargetUpdate
- func (c *TargetClient) UpdateOne(t *Target) *TargetUpdateOne
- func (c *TargetClient) UpdateOneID(id uuid.UUID) *TargetUpdateOne
- func (c *TargetClient) Use(hooks ...Hook)
- type TargetCreate
- func (tc *TargetCreate) AddPackageIDs(ids ...uuid.UUID) *TargetCreate
- func (tc *TargetCreate) AddPackages(p ...*Pkg) *TargetCreate
- func (tc *TargetCreate) Exec(ctx context.Context) error
- func (tc *TargetCreate) ExecX(ctx context.Context)
- func (tc *TargetCreate) Mutation() *TargetMutation
- func (tc *TargetCreate) Save(ctx context.Context) (*Target, error)
- func (tc *TargetCreate) SaveX(ctx context.Context) *Target
- func (tc *TargetCreate) SetID(u uuid.UUID) *TargetCreate
- func (tc *TargetCreate) SetName(s string) *TargetCreate
- func (tc *TargetCreate) SetNillableID(u *uuid.UUID) *TargetCreate
- type TargetCreateBulk
- type TargetDelete
- type TargetDeleteOne
- type TargetEdges
- type TargetGroupBy
- func (tgb *TargetGroupBy) Aggregate(fns ...AggregateFunc) *TargetGroupBy
- func (s *TargetGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *TargetGroupBy) BoolX(ctx context.Context) bool
- func (s *TargetGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *TargetGroupBy) BoolsX(ctx context.Context) []bool
- func (s *TargetGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *TargetGroupBy) Float64X(ctx context.Context) float64
- func (s *TargetGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *TargetGroupBy) Float64sX(ctx context.Context) []float64
- func (s *TargetGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *TargetGroupBy) IntX(ctx context.Context) int
- func (s *TargetGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *TargetGroupBy) IntsX(ctx context.Context) []int
- func (tgb *TargetGroupBy) Scan(ctx context.Context, v any) error
- func (s *TargetGroupBy) ScanX(ctx context.Context, v any)
- func (s *TargetGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *TargetGroupBy) StringX(ctx context.Context) string
- func (s *TargetGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *TargetGroupBy) StringsX(ctx context.Context) []string
- type TargetMutation
- func (m *TargetMutation) AddField(name string, value ent.Value) error
- func (m *TargetMutation) AddPackageIDs(ids ...uuid.UUID)
- func (m *TargetMutation) AddedEdges() []string
- func (m *TargetMutation) AddedField(name string) (ent.Value, bool)
- func (m *TargetMutation) AddedFields() []string
- func (m *TargetMutation) AddedIDs(name string) []ent.Value
- func (m *TargetMutation) ClearEdge(name string) error
- func (m *TargetMutation) ClearField(name string) error
- func (m *TargetMutation) ClearPackages()
- func (m *TargetMutation) ClearedEdges() []string
- func (m *TargetMutation) ClearedFields() []string
- func (m TargetMutation) Client() *Client
- func (m *TargetMutation) EdgeCleared(name string) bool
- func (m *TargetMutation) Field(name string) (ent.Value, bool)
- func (m *TargetMutation) FieldCleared(name string) bool
- func (m *TargetMutation) Fields() []string
- func (m *TargetMutation) ID() (id uuid.UUID, exists bool)
- func (m *TargetMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *TargetMutation) Name() (r string, exists bool)
- func (m *TargetMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TargetMutation) OldName(ctx context.Context) (v string, err error)
- func (m *TargetMutation) Op() Op
- func (m *TargetMutation) PackagesCleared() bool
- func (m *TargetMutation) PackagesIDs() (ids []uuid.UUID)
- func (m *TargetMutation) RemovePackageIDs(ids ...uuid.UUID)
- func (m *TargetMutation) RemovedEdges() []string
- func (m *TargetMutation) RemovedIDs(name string) []ent.Value
- func (m *TargetMutation) RemovedPackagesIDs() (ids []uuid.UUID)
- func (m *TargetMutation) ResetEdge(name string) error
- func (m *TargetMutation) ResetField(name string) error
- func (m *TargetMutation) ResetName()
- func (m *TargetMutation) ResetPackages()
- func (m *TargetMutation) SetField(name string, value ent.Value) error
- func (m *TargetMutation) SetID(id uuid.UUID)
- func (m *TargetMutation) SetName(s string)
- func (m *TargetMutation) SetOp(op Op)
- func (m TargetMutation) Tx() (*Tx, error)
- func (m *TargetMutation) Type() string
- func (m *TargetMutation) Where(ps ...predicate.Target)
- func (m *TargetMutation) WhereP(ps ...func(*sql.Selector))
- type TargetQuery
- func (tq *TargetQuery) Aggregate(fns ...AggregateFunc) *TargetSelect
- func (tq *TargetQuery) All(ctx context.Context) ([]*Target, error)
- func (tq *TargetQuery) AllX(ctx context.Context) []*Target
- func (tq *TargetQuery) Clone() *TargetQuery
- func (tq *TargetQuery) Count(ctx context.Context) (int, error)
- func (tq *TargetQuery) CountX(ctx context.Context) int
- func (tq *TargetQuery) Exist(ctx context.Context) (bool, error)
- func (tq *TargetQuery) ExistX(ctx context.Context) bool
- func (tq *TargetQuery) First(ctx context.Context) (*Target, error)
- func (tq *TargetQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (tq *TargetQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (tq *TargetQuery) FirstX(ctx context.Context) *Target
- func (tq *TargetQuery) GroupBy(field string, fields ...string) *TargetGroupBy
- func (tq *TargetQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (tq *TargetQuery) IDsX(ctx context.Context) []uuid.UUID
- func (tq *TargetQuery) Limit(limit int) *TargetQuery
- func (tq *TargetQuery) Offset(offset int) *TargetQuery
- func (tq *TargetQuery) Only(ctx context.Context) (*Target, error)
- func (tq *TargetQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (tq *TargetQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (tq *TargetQuery) OnlyX(ctx context.Context) *Target
- func (tq *TargetQuery) Order(o ...target.OrderOption) *TargetQuery
- func (tq *TargetQuery) QueryPackages() *PkgQuery
- func (tq *TargetQuery) Select(fields ...string) *TargetSelect
- func (tq *TargetQuery) Unique(unique bool) *TargetQuery
- func (tq *TargetQuery) Where(ps ...predicate.Target) *TargetQuery
- func (tq *TargetQuery) WithPackages(opts ...func(*PkgQuery)) *TargetQuery
- type TargetSelect
- func (ts *TargetSelect) Aggregate(fns ...AggregateFunc) *TargetSelect
- func (s *TargetSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *TargetSelect) BoolX(ctx context.Context) bool
- func (s *TargetSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *TargetSelect) BoolsX(ctx context.Context) []bool
- func (s *TargetSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *TargetSelect) Float64X(ctx context.Context) float64
- func (s *TargetSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *TargetSelect) Float64sX(ctx context.Context) []float64
- func (s *TargetSelect) Int(ctx context.Context) (_ int, err error)
- func (s *TargetSelect) IntX(ctx context.Context) int
- func (s *TargetSelect) Ints(ctx context.Context) ([]int, error)
- func (s *TargetSelect) IntsX(ctx context.Context) []int
- func (ts *TargetSelect) Scan(ctx context.Context, v any) error
- func (s *TargetSelect) ScanX(ctx context.Context, v any)
- func (s *TargetSelect) String(ctx context.Context) (_ string, err error)
- func (s *TargetSelect) StringX(ctx context.Context) string
- func (s *TargetSelect) Strings(ctx context.Context) ([]string, error)
- func (s *TargetSelect) StringsX(ctx context.Context) []string
- type TargetUpdate
- func (tu *TargetUpdate) AddPackageIDs(ids ...uuid.UUID) *TargetUpdate
- func (tu *TargetUpdate) AddPackages(p ...*Pkg) *TargetUpdate
- func (tu *TargetUpdate) ClearPackages() *TargetUpdate
- func (tu *TargetUpdate) Exec(ctx context.Context) error
- func (tu *TargetUpdate) ExecX(ctx context.Context)
- func (tu *TargetUpdate) Mutation() *TargetMutation
- func (tu *TargetUpdate) RemovePackageIDs(ids ...uuid.UUID) *TargetUpdate
- func (tu *TargetUpdate) RemovePackages(p ...*Pkg) *TargetUpdate
- func (tu *TargetUpdate) Save(ctx context.Context) (int, error)
- func (tu *TargetUpdate) SaveX(ctx context.Context) int
- func (tu *TargetUpdate) SetName(s string) *TargetUpdate
- func (tu *TargetUpdate) SetNillableName(s *string) *TargetUpdate
- func (tu *TargetUpdate) Where(ps ...predicate.Target) *TargetUpdate
- type TargetUpdateOne
- func (tuo *TargetUpdateOne) AddPackageIDs(ids ...uuid.UUID) *TargetUpdateOne
- func (tuo *TargetUpdateOne) AddPackages(p ...*Pkg) *TargetUpdateOne
- func (tuo *TargetUpdateOne) ClearPackages() *TargetUpdateOne
- func (tuo *TargetUpdateOne) Exec(ctx context.Context) error
- func (tuo *TargetUpdateOne) ExecX(ctx context.Context)
- func (tuo *TargetUpdateOne) Mutation() *TargetMutation
- func (tuo *TargetUpdateOne) RemovePackageIDs(ids ...uuid.UUID) *TargetUpdateOne
- func (tuo *TargetUpdateOne) RemovePackages(p ...*Pkg) *TargetUpdateOne
- func (tuo *TargetUpdateOne) Save(ctx context.Context) (*Target, error)
- func (tuo *TargetUpdateOne) SaveX(ctx context.Context) *Target
- func (tuo *TargetUpdateOne) Select(field string, fields ...string) *TargetUpdateOne
- func (tuo *TargetUpdateOne) SetName(s string) *TargetUpdateOne
- func (tuo *TargetUpdateOne) SetNillableName(s *string) *TargetUpdateOne
- func (tuo *TargetUpdateOne) Where(ps ...predicate.Target) *TargetUpdateOne
- type Targets
- 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. TypePkg = "Pkg" TypeTarget = "Target" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Pkg is the client for interacting with the Pkg builders. Pkg *PkgClient // Target is the client for interacting with the Target builders. Target *TargetClient // 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(). Pkg. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type 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 Pkg ¶
type Pkg struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // Repository holds the value of the "repository" field. Repository string `json:"repository,omitempty"` // Category holds the value of the "category" field. Category string `json:"category,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Version holds the value of the "version" field. Version string `json:"version,omitempty"` // Gentoo specific fields shared between the index and metadata.tar files PackageFields *parser.PackageCommon `json:"package_fields,omitempty"` // TargetID holds the value of the "target_id" field. TargetID uuid.UUID `json:"target_id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the PkgQuery when eager-loading is set. Edges PkgEdges `json:"edges"` // contains filtered or unexported fields }
Pkg is the model entity for the Pkg schema.
func (*Pkg) QueryTarget ¶
func (pk *Pkg) QueryTarget() *TargetQuery
QueryTarget queries the "target" edge of the Pkg entity.
func (*Pkg) Unwrap ¶
Unwrap unwraps the Pkg 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 (*Pkg) Update ¶
func (pk *Pkg) Update() *PkgUpdateOne
Update returns a builder for updating this Pkg. Note that you need to call Pkg.Unwrap() before calling this method if this Pkg was returned from a transaction, and the transaction was committed or rolled back.
type PkgClient ¶
type PkgClient struct {
// contains filtered or unexported fields
}
PkgClient is a client for the Pkg schema.
func NewPkgClient ¶
func NewPkgClient(c config) *PkgClient
NewPkgClient returns a client for the Pkg from the given config.
func (*PkgClient) CreateBulk ¶
func (c *PkgClient) CreateBulk(builders ...*PkgCreate) *PkgCreateBulk
CreateBulk returns a builder for creating a bulk of Pkg entities.
func (*PkgClient) DeleteOne ¶
func (c *PkgClient) DeleteOne(pk *Pkg) *PkgDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*PkgClient) DeleteOneID ¶
func (c *PkgClient) DeleteOneID(id uuid.UUID) *PkgDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*PkgClient) Intercept ¶
func (c *PkgClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `pkg.Intercept(f(g(h())))`.
func (*PkgClient) Interceptors ¶
func (c *PkgClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*PkgClient) MapCreateBulk ¶
func (c *PkgClient) MapCreateBulk(slice any, setFunc func(*PkgCreate, int)) *PkgCreateBulk
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 (*PkgClient) QueryTarget ¶
func (c *PkgClient) QueryTarget(pk *Pkg) *TargetQuery
QueryTarget queries the target edge of a Pkg.
func (*PkgClient) UpdateOne ¶
func (c *PkgClient) UpdateOne(pk *Pkg) *PkgUpdateOne
UpdateOne returns an update builder for the given entity.
func (*PkgClient) UpdateOneID ¶
func (c *PkgClient) UpdateOneID(id uuid.UUID) *PkgUpdateOne
UpdateOneID returns an update builder for the given id.
type PkgCreate ¶
type PkgCreate struct {
// contains filtered or unexported fields
}
PkgCreate is the builder for creating a Pkg entity.
func (*PkgCreate) Mutation ¶
func (pc *PkgCreate) Mutation() *PkgMutation
Mutation returns the PkgMutation object of the builder.
func (*PkgCreate) SetCategory ¶
SetCategory sets the "category" field.
func (*PkgCreate) SetNillableID ¶
SetNillableID sets the "id" field if the given value is not nil.
func (*PkgCreate) SetPackageFields ¶
func (pc *PkgCreate) SetPackageFields(value *parser.PackageCommon) *PkgCreate
SetPackageFields sets the "package_fields" field.
func (*PkgCreate) SetRepository ¶
SetRepository sets the "repository" field.
func (*PkgCreate) SetTargetID ¶
SetTargetID sets the "target_id" field.
func (*PkgCreate) SetVersion ¶
SetVersion sets the "version" field.
type PkgCreateBulk ¶
type PkgCreateBulk struct {
// contains filtered or unexported fields
}
PkgCreateBulk is the builder for creating many Pkg entities in bulk.
func (*PkgCreateBulk) Exec ¶
func (pcb *PkgCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PkgCreateBulk) ExecX ¶
func (pcb *PkgCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type PkgDelete ¶
type PkgDelete struct {
// contains filtered or unexported fields
}
PkgDelete is the builder for deleting a Pkg entity.
func (*PkgDelete) Exec ¶
Exec executes the deletion query and returns how many vertices were deleted.
type PkgDeleteOne ¶
type PkgDeleteOne struct {
// contains filtered or unexported fields
}
PkgDeleteOne is the builder for deleting a single Pkg entity.
func (*PkgDeleteOne) Exec ¶
func (pdo *PkgDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*PkgDeleteOne) ExecX ¶
func (pdo *PkgDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PkgDeleteOne) Where ¶
func (pdo *PkgDeleteOne) Where(ps ...predicate.Pkg) *PkgDeleteOne
Where appends a list predicates to the PkgDelete builder.
type PkgEdges ¶
type PkgEdges struct { // Target holds the value of the target edge. Target *Target `json:"target,omitempty"` // contains filtered or unexported fields }
PkgEdges holds the relations/edges for other nodes in the graph.
func (PkgEdges) TargetOrErr ¶
TargetOrErr returns the Target value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type PkgGroupBy ¶
type PkgGroupBy struct {
// contains filtered or unexported fields
}
PkgGroupBy is the group-by builder for Pkg entities.
func (*PkgGroupBy) Aggregate ¶
func (pgb *PkgGroupBy) Aggregate(fns ...AggregateFunc) *PkgGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*PkgGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PkgGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PkgGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PkgGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PkgGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PkgGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PkgGroupBy) Scan ¶
func (pgb *PkgGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PkgGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PkgMutation ¶
type PkgMutation struct {
// contains filtered or unexported fields
}
PkgMutation represents an operation that mutates the Pkg nodes in the graph.
func (*PkgMutation) AddField ¶
func (m *PkgMutation) 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 (*PkgMutation) AddedEdges ¶
func (m *PkgMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*PkgMutation) AddedField ¶
func (m *PkgMutation) 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 (*PkgMutation) AddedFields ¶
func (m *PkgMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*PkgMutation) AddedIDs ¶
func (m *PkgMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*PkgMutation) Category ¶
func (m *PkgMutation) Category() (r string, exists bool)
Category returns the value of the "category" field in the mutation.
func (*PkgMutation) ClearEdge ¶
func (m *PkgMutation) 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 (*PkgMutation) ClearField ¶
func (m *PkgMutation) 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 (*PkgMutation) ClearTarget ¶
func (m *PkgMutation) ClearTarget()
ClearTarget clears the "target" edge to the Target entity.
func (*PkgMutation) ClearedEdges ¶
func (m *PkgMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*PkgMutation) ClearedFields ¶
func (m *PkgMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (PkgMutation) Client ¶
func (m PkgMutation) 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 (*PkgMutation) EdgeCleared ¶
func (m *PkgMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*PkgMutation) Field ¶
func (m *PkgMutation) 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 (*PkgMutation) FieldCleared ¶
func (m *PkgMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*PkgMutation) Fields ¶
func (m *PkgMutation) 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 (*PkgMutation) ID ¶
func (m *PkgMutation) ID() (id uuid.UUID, 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 (*PkgMutation) IDs ¶
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 (*PkgMutation) Name ¶
func (m *PkgMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*PkgMutation) OldCategory ¶
func (m *PkgMutation) OldCategory(ctx context.Context) (v string, err error)
OldCategory returns the old "category" field's value of the Pkg entity. If the Pkg 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 (*PkgMutation) 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 (*PkgMutation) OldName ¶
func (m *PkgMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Pkg entity. If the Pkg 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 (*PkgMutation) OldPackageFields ¶
func (m *PkgMutation) OldPackageFields(ctx context.Context) (v *parser.PackageCommon, err error)
OldPackageFields returns the old "package_fields" field's value of the Pkg entity. If the Pkg 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 (*PkgMutation) OldRepository ¶
func (m *PkgMutation) OldRepository(ctx context.Context) (v string, err error)
OldRepository returns the old "repository" field's value of the Pkg entity. If the Pkg 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 (*PkgMutation) OldTargetID ¶
OldTargetID returns the old "target_id" field's value of the Pkg entity. If the Pkg 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 (*PkgMutation) OldVersion ¶
func (m *PkgMutation) OldVersion(ctx context.Context) (v string, err error)
OldVersion returns the old "version" field's value of the Pkg entity. If the Pkg 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 (*PkgMutation) PackageFields ¶
func (m *PkgMutation) PackageFields() (r *parser.PackageCommon, exists bool)
PackageFields returns the value of the "package_fields" field in the mutation.
func (*PkgMutation) RemovedEdges ¶
func (m *PkgMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*PkgMutation) RemovedIDs ¶
func (m *PkgMutation) 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 (*PkgMutation) Repository ¶
func (m *PkgMutation) Repository() (r string, exists bool)
Repository returns the value of the "repository" field in the mutation.
func (*PkgMutation) ResetCategory ¶
func (m *PkgMutation) ResetCategory()
ResetCategory resets all changes to the "category" field.
func (*PkgMutation) ResetEdge ¶
func (m *PkgMutation) 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 (*PkgMutation) ResetField ¶
func (m *PkgMutation) 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 (*PkgMutation) ResetName ¶
func (m *PkgMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*PkgMutation) ResetPackageFields ¶
func (m *PkgMutation) ResetPackageFields()
ResetPackageFields resets all changes to the "package_fields" field.
func (*PkgMutation) ResetRepository ¶
func (m *PkgMutation) ResetRepository()
ResetRepository resets all changes to the "repository" field.
func (*PkgMutation) ResetTarget ¶
func (m *PkgMutation) ResetTarget()
ResetTarget resets all changes to the "target" edge.
func (*PkgMutation) ResetTargetID ¶
func (m *PkgMutation) ResetTargetID()
ResetTargetID resets all changes to the "target_id" field.
func (*PkgMutation) ResetVersion ¶
func (m *PkgMutation) ResetVersion()
ResetVersion resets all changes to the "version" field.
func (*PkgMutation) SetCategory ¶
func (m *PkgMutation) SetCategory(s string)
SetCategory sets the "category" field.
func (*PkgMutation) SetField ¶
func (m *PkgMutation) 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 (*PkgMutation) SetID ¶
func (m *PkgMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Pkg entities.
func (*PkgMutation) SetName ¶
func (m *PkgMutation) SetName(s string)
SetName sets the "name" field.
func (*PkgMutation) SetOp ¶
func (m *PkgMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*PkgMutation) SetPackageFields ¶
func (m *PkgMutation) SetPackageFields(pc *parser.PackageCommon)
SetPackageFields sets the "package_fields" field.
func (*PkgMutation) SetRepository ¶
func (m *PkgMutation) SetRepository(s string)
SetRepository sets the "repository" field.
func (*PkgMutation) SetTargetID ¶
func (m *PkgMutation) SetTargetID(u uuid.UUID)
SetTargetID sets the "target_id" field.
func (*PkgMutation) SetVersion ¶
func (m *PkgMutation) SetVersion(s string)
SetVersion sets the "version" field.
func (*PkgMutation) TargetCleared ¶
func (m *PkgMutation) TargetCleared() bool
TargetCleared reports if the "target" edge to the Target entity was cleared.
func (*PkgMutation) TargetID ¶
func (m *PkgMutation) TargetID() (r uuid.UUID, exists bool)
TargetID returns the value of the "target_id" field in the mutation.
func (*PkgMutation) TargetIDs ¶
func (m *PkgMutation) TargetIDs() (ids []uuid.UUID)
TargetIDs returns the "target" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TargetID instead. It exists only for internal usage by the builders.
func (PkgMutation) Tx ¶
func (m PkgMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*PkgMutation) Type ¶
func (m *PkgMutation) Type() string
Type returns the node type of this mutation (Pkg).
func (*PkgMutation) Version ¶
func (m *PkgMutation) Version() (r string, exists bool)
Version returns the value of the "version" field in the mutation.
func (*PkgMutation) Where ¶
func (m *PkgMutation) Where(ps ...predicate.Pkg)
Where appends a list predicates to the PkgMutation builder.
func (*PkgMutation) WhereP ¶
func (m *PkgMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the PkgMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type PkgQuery ¶
type PkgQuery struct {
// contains filtered or unexported fields
}
PkgQuery is the builder for querying Pkg entities.
func (*PkgQuery) Aggregate ¶
func (pq *PkgQuery) Aggregate(fns ...AggregateFunc) *PkgSelect
Aggregate returns a PkgSelect configured with the given aggregations.
func (*PkgQuery) Clone ¶
Clone returns a duplicate of the PkgQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*PkgQuery) First ¶
First returns the first Pkg entity from the query. Returns a *NotFoundError when no Pkg was found.
func (*PkgQuery) FirstID ¶
FirstID returns the first Pkg ID from the query. Returns a *NotFoundError when no Pkg ID was found.
func (*PkgQuery) GroupBy ¶
func (pq *PkgQuery) GroupBy(field string, fields ...string) *PkgGroupBy
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 { Repository string `json:"repository,omitempty"` Count int `json:"count,omitempty"` } client.Pkg.Query(). GroupBy(pkg.FieldRepository). Aggregate(ent.Count()). Scan(ctx, &v)
func (*PkgQuery) Only ¶
Only returns a single Pkg entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Pkg entity is found. Returns a *NotFoundError when no Pkg entities are found.
func (*PkgQuery) OnlyID ¶
OnlyID is like Only, but returns the only Pkg ID in the query. Returns a *NotSingularError when more than one Pkg ID is found. Returns a *NotFoundError when no entities are found.
func (*PkgQuery) Order ¶
func (pq *PkgQuery) Order(o ...pkg.OrderOption) *PkgQuery
Order specifies how the records should be ordered.
func (*PkgQuery) QueryTarget ¶
func (pq *PkgQuery) QueryTarget() *TargetQuery
QueryTarget chains the current query on the "target" edge.
func (*PkgQuery) Select ¶
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 { Repository string `json:"repository,omitempty"` } client.Pkg.Query(). Select(pkg.FieldRepository). Scan(ctx, &v)
func (*PkgQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*PkgQuery) WithTarget ¶
func (pq *PkgQuery) WithTarget(opts ...func(*TargetQuery)) *PkgQuery
WithTarget tells the query-builder to eager-load the nodes that are connected to the "target" edge. The optional arguments are used to configure the query builder of the edge.
type PkgSelect ¶
type PkgSelect struct { *PkgQuery // contains filtered or unexported fields }
PkgSelect is the builder for selecting fields of Pkg entities.
func (*PkgSelect) Aggregate ¶
func (ps *PkgSelect) Aggregate(fns ...AggregateFunc) *PkgSelect
Aggregate adds the given aggregation functions to the selector query.
func (*PkgSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PkgSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PkgSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PkgSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PkgSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PkgSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PkgSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PkgUpdate ¶
type PkgUpdate struct {
// contains filtered or unexported fields
}
PkgUpdate is the builder for updating Pkg entities.
func (*PkgUpdate) ClearTarget ¶
ClearTarget clears the "target" edge to the Target entity.
func (*PkgUpdate) Mutation ¶
func (pu *PkgUpdate) Mutation() *PkgMutation
Mutation returns the PkgMutation object of the builder.
func (*PkgUpdate) Save ¶
Save executes the query and returns the number of nodes affected by the update operation.
func (*PkgUpdate) SetCategory ¶
SetCategory sets the "category" field.
func (*PkgUpdate) SetNillableCategory ¶
SetNillableCategory sets the "category" field if the given value is not nil.
func (*PkgUpdate) SetNillableName ¶
SetNillableName sets the "name" field if the given value is not nil.
func (*PkgUpdate) SetNillableRepository ¶
SetNillableRepository sets the "repository" field if the given value is not nil.
func (*PkgUpdate) SetNillableTargetID ¶
SetNillableTargetID sets the "target_id" field if the given value is not nil.
func (*PkgUpdate) SetNillableVersion ¶
SetNillableVersion sets the "version" field if the given value is not nil.
func (*PkgUpdate) SetPackageFields ¶
func (pu *PkgUpdate) SetPackageFields(pc *parser.PackageCommon) *PkgUpdate
SetPackageFields sets the "package_fields" field.
func (*PkgUpdate) SetRepository ¶
SetRepository sets the "repository" field.
func (*PkgUpdate) SetTargetID ¶
SetTargetID sets the "target_id" field.
func (*PkgUpdate) SetVersion ¶
SetVersion sets the "version" field.
type PkgUpdateOne ¶
type PkgUpdateOne struct {
// contains filtered or unexported fields
}
PkgUpdateOne is the builder for updating a single Pkg entity.
func (*PkgUpdateOne) ClearTarget ¶
func (puo *PkgUpdateOne) ClearTarget() *PkgUpdateOne
ClearTarget clears the "target" edge to the Target entity.
func (*PkgUpdateOne) Exec ¶
func (puo *PkgUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*PkgUpdateOne) ExecX ¶
func (puo *PkgUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PkgUpdateOne) Mutation ¶
func (puo *PkgUpdateOne) Mutation() *PkgMutation
Mutation returns the PkgMutation object of the builder.
func (*PkgUpdateOne) Save ¶
func (puo *PkgUpdateOne) Save(ctx context.Context) (*Pkg, error)
Save executes the query and returns the updated Pkg entity.
func (*PkgUpdateOne) SaveX ¶
func (puo *PkgUpdateOne) SaveX(ctx context.Context) *Pkg
SaveX is like Save, but panics if an error occurs.
func (*PkgUpdateOne) Select ¶
func (puo *PkgUpdateOne) Select(field string, fields ...string) *PkgUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*PkgUpdateOne) SetCategory ¶
func (puo *PkgUpdateOne) SetCategory(s string) *PkgUpdateOne
SetCategory sets the "category" field.
func (*PkgUpdateOne) SetName ¶
func (puo *PkgUpdateOne) SetName(s string) *PkgUpdateOne
SetName sets the "name" field.
func (*PkgUpdateOne) SetNillableCategory ¶
func (puo *PkgUpdateOne) SetNillableCategory(s *string) *PkgUpdateOne
SetNillableCategory sets the "category" field if the given value is not nil.
func (*PkgUpdateOne) SetNillableName ¶
func (puo *PkgUpdateOne) SetNillableName(s *string) *PkgUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*PkgUpdateOne) SetNillableRepository ¶
func (puo *PkgUpdateOne) SetNillableRepository(s *string) *PkgUpdateOne
SetNillableRepository sets the "repository" field if the given value is not nil.
func (*PkgUpdateOne) SetNillableTargetID ¶
func (puo *PkgUpdateOne) SetNillableTargetID(u *uuid.UUID) *PkgUpdateOne
SetNillableTargetID sets the "target_id" field if the given value is not nil.
func (*PkgUpdateOne) SetNillableVersion ¶
func (puo *PkgUpdateOne) SetNillableVersion(s *string) *PkgUpdateOne
SetNillableVersion sets the "version" field if the given value is not nil.
func (*PkgUpdateOne) SetPackageFields ¶
func (puo *PkgUpdateOne) SetPackageFields(pc *parser.PackageCommon) *PkgUpdateOne
SetPackageFields sets the "package_fields" field.
func (*PkgUpdateOne) SetRepository ¶
func (puo *PkgUpdateOne) SetRepository(s string) *PkgUpdateOne
SetRepository sets the "repository" field.
func (*PkgUpdateOne) SetTarget ¶
func (puo *PkgUpdateOne) SetTarget(t *Target) *PkgUpdateOne
SetTarget sets the "target" edge to the Target entity.
func (*PkgUpdateOne) SetTargetID ¶
func (puo *PkgUpdateOne) SetTargetID(u uuid.UUID) *PkgUpdateOne
SetTargetID sets the "target_id" field.
func (*PkgUpdateOne) SetVersion ¶
func (puo *PkgUpdateOne) SetVersion(s string) *PkgUpdateOne
SetVersion sets the "version" field.
func (*PkgUpdateOne) Where ¶
func (puo *PkgUpdateOne) Where(ps ...predicate.Pkg) *PkgUpdateOne
Where appends a list predicates to the PkgUpdate builder.
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 Target ¶
type Target struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the TargetQuery when eager-loading is set. Edges TargetEdges `json:"edges"` // contains filtered or unexported fields }
Target is the model entity for the Target schema.
func (*Target) QueryPackages ¶
QueryPackages queries the "packages" edge of the Target entity.
func (*Target) Unwrap ¶
Unwrap unwraps the Target 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 (*Target) Update ¶
func (t *Target) Update() *TargetUpdateOne
Update returns a builder for updating this Target. Note that you need to call Target.Unwrap() before calling this method if this Target was returned from a transaction, and the transaction was committed or rolled back.
type TargetClient ¶
type TargetClient struct {
// contains filtered or unexported fields
}
TargetClient is a client for the Target schema.
func NewTargetClient ¶
func NewTargetClient(c config) *TargetClient
NewTargetClient returns a client for the Target from the given config.
func (*TargetClient) Create ¶
func (c *TargetClient) Create() *TargetCreate
Create returns a builder for creating a Target entity.
func (*TargetClient) CreateBulk ¶
func (c *TargetClient) CreateBulk(builders ...*TargetCreate) *TargetCreateBulk
CreateBulk returns a builder for creating a bulk of Target entities.
func (*TargetClient) Delete ¶
func (c *TargetClient) Delete() *TargetDelete
Delete returns a delete builder for Target.
func (*TargetClient) DeleteOne ¶
func (c *TargetClient) DeleteOne(t *Target) *TargetDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*TargetClient) DeleteOneID ¶
func (c *TargetClient) DeleteOneID(id uuid.UUID) *TargetDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*TargetClient) Intercept ¶
func (c *TargetClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `target.Intercept(f(g(h())))`.
func (*TargetClient) Interceptors ¶
func (c *TargetClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*TargetClient) MapCreateBulk ¶
func (c *TargetClient) MapCreateBulk(slice any, setFunc func(*TargetCreate, int)) *TargetCreateBulk
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 (*TargetClient) Query ¶
func (c *TargetClient) Query() *TargetQuery
Query returns a query builder for Target.
func (*TargetClient) QueryPackages ¶
func (c *TargetClient) QueryPackages(t *Target) *PkgQuery
QueryPackages queries the packages edge of a Target.
func (*TargetClient) Update ¶
func (c *TargetClient) Update() *TargetUpdate
Update returns an update builder for Target.
func (*TargetClient) UpdateOne ¶
func (c *TargetClient) UpdateOne(t *Target) *TargetUpdateOne
UpdateOne returns an update builder for the given entity.
func (*TargetClient) UpdateOneID ¶
func (c *TargetClient) UpdateOneID(id uuid.UUID) *TargetUpdateOne
UpdateOneID returns an update builder for the given id.
func (*TargetClient) Use ¶
func (c *TargetClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `target.Hooks(f(g(h())))`.
type TargetCreate ¶
type TargetCreate struct {
// contains filtered or unexported fields
}
TargetCreate is the builder for creating a Target entity.
func (*TargetCreate) AddPackageIDs ¶
func (tc *TargetCreate) AddPackageIDs(ids ...uuid.UUID) *TargetCreate
AddPackageIDs adds the "packages" edge to the Pkg entity by IDs.
func (*TargetCreate) AddPackages ¶
func (tc *TargetCreate) AddPackages(p ...*Pkg) *TargetCreate
AddPackages adds the "packages" edges to the Pkg entity.
func (*TargetCreate) Exec ¶
func (tc *TargetCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*TargetCreate) ExecX ¶
func (tc *TargetCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TargetCreate) Mutation ¶
func (tc *TargetCreate) Mutation() *TargetMutation
Mutation returns the TargetMutation object of the builder.
func (*TargetCreate) Save ¶
func (tc *TargetCreate) Save(ctx context.Context) (*Target, error)
Save creates the Target in the database.
func (*TargetCreate) SaveX ¶
func (tc *TargetCreate) SaveX(ctx context.Context) *Target
SaveX calls Save and panics if Save returns an error.
func (*TargetCreate) SetID ¶
func (tc *TargetCreate) SetID(u uuid.UUID) *TargetCreate
SetID sets the "id" field.
func (*TargetCreate) SetName ¶
func (tc *TargetCreate) SetName(s string) *TargetCreate
SetName sets the "name" field.
func (*TargetCreate) SetNillableID ¶
func (tc *TargetCreate) SetNillableID(u *uuid.UUID) *TargetCreate
SetNillableID sets the "id" field if the given value is not nil.
type TargetCreateBulk ¶
type TargetCreateBulk struct {
// contains filtered or unexported fields
}
TargetCreateBulk is the builder for creating many Target entities in bulk.
func (*TargetCreateBulk) Exec ¶
func (tcb *TargetCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TargetCreateBulk) ExecX ¶
func (tcb *TargetCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type TargetDelete ¶
type TargetDelete struct {
// contains filtered or unexported fields
}
TargetDelete is the builder for deleting a Target entity.
func (*TargetDelete) Exec ¶
func (td *TargetDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*TargetDelete) ExecX ¶
func (td *TargetDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*TargetDelete) Where ¶
func (td *TargetDelete) Where(ps ...predicate.Target) *TargetDelete
Where appends a list predicates to the TargetDelete builder.
type TargetDeleteOne ¶
type TargetDeleteOne struct {
// contains filtered or unexported fields
}
TargetDeleteOne is the builder for deleting a single Target entity.
func (*TargetDeleteOne) Exec ¶
func (tdo *TargetDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*TargetDeleteOne) ExecX ¶
func (tdo *TargetDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TargetDeleteOne) Where ¶
func (tdo *TargetDeleteOne) Where(ps ...predicate.Target) *TargetDeleteOne
Where appends a list predicates to the TargetDelete builder.
type TargetEdges ¶
type TargetEdges struct { // Packages holds the value of the packages edge. Packages []*Pkg `json:"packages,omitempty"` // contains filtered or unexported fields }
TargetEdges holds the relations/edges for other nodes in the graph.
func (TargetEdges) PackagesOrErr ¶
func (e TargetEdges) PackagesOrErr() ([]*Pkg, error)
PackagesOrErr returns the Packages value or an error if the edge was not loaded in eager-loading.
type TargetGroupBy ¶
type TargetGroupBy struct {
// contains filtered or unexported fields
}
TargetGroupBy is the group-by builder for Target entities.
func (*TargetGroupBy) Aggregate ¶
func (tgb *TargetGroupBy) Aggregate(fns ...AggregateFunc) *TargetGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TargetGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TargetGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TargetGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TargetGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TargetGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TargetGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TargetGroupBy) Scan ¶
func (tgb *TargetGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TargetGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TargetMutation ¶
type TargetMutation struct {
// contains filtered or unexported fields
}
TargetMutation represents an operation that mutates the Target nodes in the graph.
func (*TargetMutation) AddField ¶
func (m *TargetMutation) 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 (*TargetMutation) AddPackageIDs ¶
func (m *TargetMutation) AddPackageIDs(ids ...uuid.UUID)
AddPackageIDs adds the "packages" edge to the Pkg entity by ids.
func (*TargetMutation) AddedEdges ¶
func (m *TargetMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*TargetMutation) AddedField ¶
func (m *TargetMutation) 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 (*TargetMutation) AddedFields ¶
func (m *TargetMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*TargetMutation) AddedIDs ¶
func (m *TargetMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*TargetMutation) ClearEdge ¶
func (m *TargetMutation) 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 (*TargetMutation) ClearField ¶
func (m *TargetMutation) 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 (*TargetMutation) ClearPackages ¶
func (m *TargetMutation) ClearPackages()
ClearPackages clears the "packages" edge to the Pkg entity.
func (*TargetMutation) ClearedEdges ¶
func (m *TargetMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*TargetMutation) ClearedFields ¶
func (m *TargetMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (TargetMutation) Client ¶
func (m TargetMutation) 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 (*TargetMutation) EdgeCleared ¶
func (m *TargetMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*TargetMutation) Field ¶
func (m *TargetMutation) 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 (*TargetMutation) FieldCleared ¶
func (m *TargetMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*TargetMutation) Fields ¶
func (m *TargetMutation) 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 (*TargetMutation) ID ¶
func (m *TargetMutation) ID() (id uuid.UUID, 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 (*TargetMutation) IDs ¶
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 (*TargetMutation) Name ¶
func (m *TargetMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*TargetMutation) 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 (*TargetMutation) OldName ¶
func (m *TargetMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Target entity. If the Target 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 (*TargetMutation) PackagesCleared ¶
func (m *TargetMutation) PackagesCleared() bool
PackagesCleared reports if the "packages" edge to the Pkg entity was cleared.
func (*TargetMutation) PackagesIDs ¶
func (m *TargetMutation) PackagesIDs() (ids []uuid.UUID)
PackagesIDs returns the "packages" edge IDs in the mutation.
func (*TargetMutation) RemovePackageIDs ¶
func (m *TargetMutation) RemovePackageIDs(ids ...uuid.UUID)
RemovePackageIDs removes the "packages" edge to the Pkg entity by IDs.
func (*TargetMutation) RemovedEdges ¶
func (m *TargetMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*TargetMutation) RemovedIDs ¶
func (m *TargetMutation) 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 (*TargetMutation) RemovedPackagesIDs ¶
func (m *TargetMutation) RemovedPackagesIDs() (ids []uuid.UUID)
RemovedPackages returns the removed IDs of the "packages" edge to the Pkg entity.
func (*TargetMutation) ResetEdge ¶
func (m *TargetMutation) 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 (*TargetMutation) ResetField ¶
func (m *TargetMutation) 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 (*TargetMutation) ResetName ¶
func (m *TargetMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*TargetMutation) ResetPackages ¶
func (m *TargetMutation) ResetPackages()
ResetPackages resets all changes to the "packages" edge.
func (*TargetMutation) SetField ¶
func (m *TargetMutation) 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 (*TargetMutation) SetID ¶
func (m *TargetMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Target entities.
func (*TargetMutation) SetName ¶
func (m *TargetMutation) SetName(s string)
SetName sets the "name" field.
func (*TargetMutation) SetOp ¶
func (m *TargetMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (TargetMutation) Tx ¶
func (m TargetMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*TargetMutation) Type ¶
func (m *TargetMutation) Type() string
Type returns the node type of this mutation (Target).
func (*TargetMutation) Where ¶
func (m *TargetMutation) Where(ps ...predicate.Target)
Where appends a list predicates to the TargetMutation builder.
func (*TargetMutation) WhereP ¶
func (m *TargetMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the TargetMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type TargetQuery ¶
type TargetQuery struct {
// contains filtered or unexported fields
}
TargetQuery is the builder for querying Target entities.
func (*TargetQuery) Aggregate ¶
func (tq *TargetQuery) Aggregate(fns ...AggregateFunc) *TargetSelect
Aggregate returns a TargetSelect configured with the given aggregations.
func (*TargetQuery) All ¶
func (tq *TargetQuery) All(ctx context.Context) ([]*Target, error)
All executes the query and returns a list of Targets.
func (*TargetQuery) AllX ¶
func (tq *TargetQuery) AllX(ctx context.Context) []*Target
AllX is like All, but panics if an error occurs.
func (*TargetQuery) Clone ¶
func (tq *TargetQuery) Clone() *TargetQuery
Clone returns a duplicate of the TargetQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*TargetQuery) Count ¶
func (tq *TargetQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*TargetQuery) CountX ¶
func (tq *TargetQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*TargetQuery) Exist ¶
func (tq *TargetQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*TargetQuery) ExistX ¶
func (tq *TargetQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*TargetQuery) First ¶
func (tq *TargetQuery) First(ctx context.Context) (*Target, error)
First returns the first Target entity from the query. Returns a *NotFoundError when no Target was found.
func (*TargetQuery) FirstID ¶
FirstID returns the first Target ID from the query. Returns a *NotFoundError when no Target ID was found.
func (*TargetQuery) FirstIDX ¶
func (tq *TargetQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*TargetQuery) FirstX ¶
func (tq *TargetQuery) FirstX(ctx context.Context) *Target
FirstX is like First, but panics if an error occurs.
func (*TargetQuery) GroupBy ¶
func (tq *TargetQuery) GroupBy(field string, fields ...string) *TargetGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Target.Query(). GroupBy(target.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*TargetQuery) IDsX ¶
func (tq *TargetQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*TargetQuery) Limit ¶
func (tq *TargetQuery) Limit(limit int) *TargetQuery
Limit the number of records to be returned by this query.
func (*TargetQuery) Offset ¶
func (tq *TargetQuery) Offset(offset int) *TargetQuery
Offset to start from.
func (*TargetQuery) Only ¶
func (tq *TargetQuery) Only(ctx context.Context) (*Target, error)
Only returns a single Target entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Target entity is found. Returns a *NotFoundError when no Target entities are found.
func (*TargetQuery) OnlyID ¶
OnlyID is like Only, but returns the only Target ID in the query. Returns a *NotSingularError when more than one Target ID is found. Returns a *NotFoundError when no entities are found.
func (*TargetQuery) OnlyIDX ¶
func (tq *TargetQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*TargetQuery) OnlyX ¶
func (tq *TargetQuery) OnlyX(ctx context.Context) *Target
OnlyX is like Only, but panics if an error occurs.
func (*TargetQuery) Order ¶
func (tq *TargetQuery) Order(o ...target.OrderOption) *TargetQuery
Order specifies how the records should be ordered.
func (*TargetQuery) QueryPackages ¶
func (tq *TargetQuery) QueryPackages() *PkgQuery
QueryPackages chains the current query on the "packages" edge.
func (*TargetQuery) Select ¶
func (tq *TargetQuery) Select(fields ...string) *TargetSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.Target.Query(). Select(target.FieldName). Scan(ctx, &v)
func (*TargetQuery) Unique ¶
func (tq *TargetQuery) Unique(unique bool) *TargetQuery
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 (*TargetQuery) Where ¶
func (tq *TargetQuery) Where(ps ...predicate.Target) *TargetQuery
Where adds a new predicate for the TargetQuery builder.
func (*TargetQuery) WithPackages ¶
func (tq *TargetQuery) WithPackages(opts ...func(*PkgQuery)) *TargetQuery
WithPackages tells the query-builder to eager-load the nodes that are connected to the "packages" edge. The optional arguments are used to configure the query builder of the edge.
type TargetSelect ¶
type TargetSelect struct { *TargetQuery // contains filtered or unexported fields }
TargetSelect is the builder for selecting fields of Target entities.
func (*TargetSelect) Aggregate ¶
func (ts *TargetSelect) Aggregate(fns ...AggregateFunc) *TargetSelect
Aggregate adds the given aggregation functions to the selector query.
func (*TargetSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TargetSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TargetSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TargetSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TargetSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TargetSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TargetSelect) Scan ¶
func (ts *TargetSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TargetSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TargetUpdate ¶
type TargetUpdate struct {
// contains filtered or unexported fields
}
TargetUpdate is the builder for updating Target entities.
func (*TargetUpdate) AddPackageIDs ¶
func (tu *TargetUpdate) AddPackageIDs(ids ...uuid.UUID) *TargetUpdate
AddPackageIDs adds the "packages" edge to the Pkg entity by IDs.
func (*TargetUpdate) AddPackages ¶
func (tu *TargetUpdate) AddPackages(p ...*Pkg) *TargetUpdate
AddPackages adds the "packages" edges to the Pkg entity.
func (*TargetUpdate) ClearPackages ¶
func (tu *TargetUpdate) ClearPackages() *TargetUpdate
ClearPackages clears all "packages" edges to the Pkg entity.
func (*TargetUpdate) Exec ¶
func (tu *TargetUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*TargetUpdate) ExecX ¶
func (tu *TargetUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TargetUpdate) Mutation ¶
func (tu *TargetUpdate) Mutation() *TargetMutation
Mutation returns the TargetMutation object of the builder.
func (*TargetUpdate) RemovePackageIDs ¶
func (tu *TargetUpdate) RemovePackageIDs(ids ...uuid.UUID) *TargetUpdate
RemovePackageIDs removes the "packages" edge to Pkg entities by IDs.
func (*TargetUpdate) RemovePackages ¶
func (tu *TargetUpdate) RemovePackages(p ...*Pkg) *TargetUpdate
RemovePackages removes "packages" edges to Pkg entities.
func (*TargetUpdate) Save ¶
func (tu *TargetUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*TargetUpdate) SaveX ¶
func (tu *TargetUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*TargetUpdate) SetName ¶
func (tu *TargetUpdate) SetName(s string) *TargetUpdate
SetName sets the "name" field.
func (*TargetUpdate) SetNillableName ¶
func (tu *TargetUpdate) SetNillableName(s *string) *TargetUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*TargetUpdate) Where ¶
func (tu *TargetUpdate) Where(ps ...predicate.Target) *TargetUpdate
Where appends a list predicates to the TargetUpdate builder.
type TargetUpdateOne ¶
type TargetUpdateOne struct {
// contains filtered or unexported fields
}
TargetUpdateOne is the builder for updating a single Target entity.
func (*TargetUpdateOne) AddPackageIDs ¶
func (tuo *TargetUpdateOne) AddPackageIDs(ids ...uuid.UUID) *TargetUpdateOne
AddPackageIDs adds the "packages" edge to the Pkg entity by IDs.
func (*TargetUpdateOne) AddPackages ¶
func (tuo *TargetUpdateOne) AddPackages(p ...*Pkg) *TargetUpdateOne
AddPackages adds the "packages" edges to the Pkg entity.
func (*TargetUpdateOne) ClearPackages ¶
func (tuo *TargetUpdateOne) ClearPackages() *TargetUpdateOne
ClearPackages clears all "packages" edges to the Pkg entity.
func (*TargetUpdateOne) Exec ¶
func (tuo *TargetUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*TargetUpdateOne) ExecX ¶
func (tuo *TargetUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TargetUpdateOne) Mutation ¶
func (tuo *TargetUpdateOne) Mutation() *TargetMutation
Mutation returns the TargetMutation object of the builder.
func (*TargetUpdateOne) RemovePackageIDs ¶
func (tuo *TargetUpdateOne) RemovePackageIDs(ids ...uuid.UUID) *TargetUpdateOne
RemovePackageIDs removes the "packages" edge to Pkg entities by IDs.
func (*TargetUpdateOne) RemovePackages ¶
func (tuo *TargetUpdateOne) RemovePackages(p ...*Pkg) *TargetUpdateOne
RemovePackages removes "packages" edges to Pkg entities.
func (*TargetUpdateOne) Save ¶
func (tuo *TargetUpdateOne) Save(ctx context.Context) (*Target, error)
Save executes the query and returns the updated Target entity.
func (*TargetUpdateOne) SaveX ¶
func (tuo *TargetUpdateOne) SaveX(ctx context.Context) *Target
SaveX is like Save, but panics if an error occurs.
func (*TargetUpdateOne) Select ¶
func (tuo *TargetUpdateOne) Select(field string, fields ...string) *TargetUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*TargetUpdateOne) SetName ¶
func (tuo *TargetUpdateOne) SetName(s string) *TargetUpdateOne
SetName sets the "name" field.
func (*TargetUpdateOne) SetNillableName ¶
func (tuo *TargetUpdateOne) SetNillableName(s *string) *TargetUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*TargetUpdateOne) Where ¶
func (tuo *TargetUpdateOne) Where(ps ...predicate.Target) *TargetUpdateOne
Where appends a list predicates to the TargetUpdate builder.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Pkg is the client for interacting with the Pkg builders. Pkg *PkgClient // Target is the client for interacting with the Target builders. Target *TargetClient // 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.