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 Location
- type LocationClient
- func (c *LocationClient) Create() *LocationCreate
- func (c *LocationClient) CreateBulk(builders ...*LocationCreate) *LocationCreateBulk
- func (c *LocationClient) Delete() *LocationDelete
- func (c *LocationClient) DeleteOne(l *Location) *LocationDeleteOne
- func (c *LocationClient) DeleteOneID(id int) *LocationDeleteOne
- func (c *LocationClient) Get(ctx context.Context, id int) (*Location, error)
- func (c *LocationClient) GetX(ctx context.Context, id int) *Location
- func (c *LocationClient) Hooks() []Hook
- func (c *LocationClient) Intercept(interceptors ...Interceptor)
- func (c *LocationClient) Interceptors() []Interceptor
- func (c *LocationClient) MapCreateBulk(slice any, setFunc func(*LocationCreate, int)) *LocationCreateBulk
- func (c *LocationClient) Query() *LocationQuery
- func (c *LocationClient) QueryPackages(l *Location) *PkgQuery
- func (c *LocationClient) Update() *LocationUpdate
- func (c *LocationClient) UpdateOne(l *Location) *LocationUpdateOne
- func (c *LocationClient) UpdateOneID(id int) *LocationUpdateOne
- func (c *LocationClient) Use(hooks ...Hook)
- type LocationCreate
- func (lc *LocationCreate) AddPackageIDs(ids ...int) *LocationCreate
- func (lc *LocationCreate) AddPackages(p ...*Pkg) *LocationCreate
- func (lc *LocationCreate) Exec(ctx context.Context) error
- func (lc *LocationCreate) ExecX(ctx context.Context)
- func (lc *LocationCreate) Mutation() *LocationMutation
- func (lc *LocationCreate) Save(ctx context.Context) (*Location, error)
- func (lc *LocationCreate) SaveX(ctx context.Context) *Location
- func (lc *LocationCreate) SetConfig(tc types.LocationConfig) *LocationCreate
- func (lc *LocationCreate) SetCreatedAt(t time.Time) *LocationCreate
- func (lc *LocationCreate) SetDescription(s string) *LocationCreate
- func (lc *LocationCreate) SetName(s string) *LocationCreate
- func (lc *LocationCreate) SetNillableCreatedAt(t *time.Time) *LocationCreate
- func (lc *LocationCreate) SetPurpose(tp types.LocationPurpose) *LocationCreate
- func (lc *LocationCreate) SetSource(ts types.LocationSource) *LocationCreate
- func (lc *LocationCreate) SetUUID(u uuid.UUID) *LocationCreate
- type LocationCreateBulk
- type LocationDelete
- type LocationDeleteOne
- type LocationEdges
- type LocationGroupBy
- func (lgb *LocationGroupBy) Aggregate(fns ...AggregateFunc) *LocationGroupBy
- func (s *LocationGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *LocationGroupBy) BoolX(ctx context.Context) bool
- func (s *LocationGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *LocationGroupBy) BoolsX(ctx context.Context) []bool
- func (s *LocationGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *LocationGroupBy) Float64X(ctx context.Context) float64
- func (s *LocationGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *LocationGroupBy) Float64sX(ctx context.Context) []float64
- func (s *LocationGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *LocationGroupBy) IntX(ctx context.Context) int
- func (s *LocationGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *LocationGroupBy) IntsX(ctx context.Context) []int
- func (lgb *LocationGroupBy) Scan(ctx context.Context, v any) error
- func (s *LocationGroupBy) ScanX(ctx context.Context, v any)
- func (s *LocationGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *LocationGroupBy) StringX(ctx context.Context) string
- func (s *LocationGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *LocationGroupBy) StringsX(ctx context.Context) []string
- type LocationMutation
- func (m *LocationMutation) AddField(name string, value ent.Value) error
- func (m *LocationMutation) AddPackageIDs(ids ...int)
- func (m *LocationMutation) AddedEdges() []string
- func (m *LocationMutation) AddedField(name string) (ent.Value, bool)
- func (m *LocationMutation) AddedFields() []string
- func (m *LocationMutation) AddedIDs(name string) []ent.Value
- func (m *LocationMutation) ClearEdge(name string) error
- func (m *LocationMutation) ClearField(name string) error
- func (m *LocationMutation) ClearPackages()
- func (m *LocationMutation) ClearedEdges() []string
- func (m *LocationMutation) ClearedFields() []string
- func (m LocationMutation) Client() *Client
- func (m *LocationMutation) Config() (r types.LocationConfig, exists bool)
- func (m *LocationMutation) CreatedAt() (r time.Time, exists bool)
- func (m *LocationMutation) Description() (r string, exists bool)
- func (m *LocationMutation) EdgeCleared(name string) bool
- func (m *LocationMutation) Field(name string) (ent.Value, bool)
- func (m *LocationMutation) FieldCleared(name string) bool
- func (m *LocationMutation) Fields() []string
- func (m *LocationMutation) ID() (id int, exists bool)
- func (m *LocationMutation) IDs(ctx context.Context) ([]int, error)
- func (m *LocationMutation) Name() (r string, exists bool)
- func (m *LocationMutation) OldConfig(ctx context.Context) (v types.LocationConfig, err error)
- func (m *LocationMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *LocationMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *LocationMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *LocationMutation) OldName(ctx context.Context) (v string, err error)
- func (m *LocationMutation) OldPurpose(ctx context.Context) (v types.LocationPurpose, err error)
- func (m *LocationMutation) OldSource(ctx context.Context) (v types.LocationSource, err error)
- func (m *LocationMutation) OldUUID(ctx context.Context) (v uuid.UUID, err error)
- func (m *LocationMutation) Op() Op
- func (m *LocationMutation) PackagesCleared() bool
- func (m *LocationMutation) PackagesIDs() (ids []int)
- func (m *LocationMutation) Purpose() (r types.LocationPurpose, exists bool)
- func (m *LocationMutation) RemovePackageIDs(ids ...int)
- func (m *LocationMutation) RemovedEdges() []string
- func (m *LocationMutation) RemovedIDs(name string) []ent.Value
- func (m *LocationMutation) RemovedPackagesIDs() (ids []int)
- func (m *LocationMutation) ResetConfig()
- func (m *LocationMutation) ResetCreatedAt()
- func (m *LocationMutation) ResetDescription()
- func (m *LocationMutation) ResetEdge(name string) error
- func (m *LocationMutation) ResetField(name string) error
- func (m *LocationMutation) ResetName()
- func (m *LocationMutation) ResetPackages()
- func (m *LocationMutation) ResetPurpose()
- func (m *LocationMutation) ResetSource()
- func (m *LocationMutation) ResetUUID()
- func (m *LocationMutation) SetConfig(tc types.LocationConfig)
- func (m *LocationMutation) SetCreatedAt(t time.Time)
- func (m *LocationMutation) SetDescription(s string)
- func (m *LocationMutation) SetField(name string, value ent.Value) error
- func (m *LocationMutation) SetName(s string)
- func (m *LocationMutation) SetOp(op Op)
- func (m *LocationMutation) SetPurpose(tp types.LocationPurpose)
- func (m *LocationMutation) SetSource(ts types.LocationSource)
- func (m *LocationMutation) SetUUID(u uuid.UUID)
- func (m *LocationMutation) Source() (r types.LocationSource, exists bool)
- func (m LocationMutation) Tx() (*Tx, error)
- func (m *LocationMutation) Type() string
- func (m *LocationMutation) UUID() (r uuid.UUID, exists bool)
- func (m *LocationMutation) Where(ps ...predicate.Location)
- func (m *LocationMutation) WhereP(ps ...func(*sql.Selector))
- type LocationQuery
- func (lq *LocationQuery) Aggregate(fns ...AggregateFunc) *LocationSelect
- func (lq *LocationQuery) All(ctx context.Context) ([]*Location, error)
- func (lq *LocationQuery) AllX(ctx context.Context) []*Location
- func (lq *LocationQuery) Clone() *LocationQuery
- func (lq *LocationQuery) Count(ctx context.Context) (int, error)
- func (lq *LocationQuery) CountX(ctx context.Context) int
- func (lq *LocationQuery) Exist(ctx context.Context) (bool, error)
- func (lq *LocationQuery) ExistX(ctx context.Context) bool
- func (lq *LocationQuery) First(ctx context.Context) (*Location, error)
- func (lq *LocationQuery) FirstID(ctx context.Context) (id int, err error)
- func (lq *LocationQuery) FirstIDX(ctx context.Context) int
- func (lq *LocationQuery) FirstX(ctx context.Context) *Location
- func (lq *LocationQuery) GroupBy(field string, fields ...string) *LocationGroupBy
- func (lq *LocationQuery) IDs(ctx context.Context) (ids []int, err error)
- func (lq *LocationQuery) IDsX(ctx context.Context) []int
- func (lq *LocationQuery) Limit(limit int) *LocationQuery
- func (lq *LocationQuery) Offset(offset int) *LocationQuery
- func (lq *LocationQuery) Only(ctx context.Context) (*Location, error)
- func (lq *LocationQuery) OnlyID(ctx context.Context) (id int, err error)
- func (lq *LocationQuery) OnlyIDX(ctx context.Context) int
- func (lq *LocationQuery) OnlyX(ctx context.Context) *Location
- func (lq *LocationQuery) Order(o ...location.OrderOption) *LocationQuery
- func (lq *LocationQuery) QueryPackages() *PkgQuery
- func (lq *LocationQuery) Select(fields ...string) *LocationSelect
- func (lq *LocationQuery) Unique(unique bool) *LocationQuery
- func (lq *LocationQuery) Where(ps ...predicate.Location) *LocationQuery
- func (lq *LocationQuery) WithPackages(opts ...func(*PkgQuery)) *LocationQuery
- type LocationSelect
- func (ls *LocationSelect) Aggregate(fns ...AggregateFunc) *LocationSelect
- func (s *LocationSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *LocationSelect) BoolX(ctx context.Context) bool
- func (s *LocationSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *LocationSelect) BoolsX(ctx context.Context) []bool
- func (s *LocationSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *LocationSelect) Float64X(ctx context.Context) float64
- func (s *LocationSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *LocationSelect) Float64sX(ctx context.Context) []float64
- func (s *LocationSelect) Int(ctx context.Context) (_ int, err error)
- func (s *LocationSelect) IntX(ctx context.Context) int
- func (s *LocationSelect) Ints(ctx context.Context) ([]int, error)
- func (s *LocationSelect) IntsX(ctx context.Context) []int
- func (ls *LocationSelect) Scan(ctx context.Context, v any) error
- func (s *LocationSelect) ScanX(ctx context.Context, v any)
- func (s *LocationSelect) String(ctx context.Context) (_ string, err error)
- func (s *LocationSelect) StringX(ctx context.Context) string
- func (s *LocationSelect) Strings(ctx context.Context) ([]string, error)
- func (s *LocationSelect) StringsX(ctx context.Context) []string
- type LocationUpdate
- func (lu *LocationUpdate) AddPackageIDs(ids ...int) *LocationUpdate
- func (lu *LocationUpdate) AddPackages(p ...*Pkg) *LocationUpdate
- func (lu *LocationUpdate) ClearPackages() *LocationUpdate
- func (lu *LocationUpdate) Exec(ctx context.Context) error
- func (lu *LocationUpdate) ExecX(ctx context.Context)
- func (lu *LocationUpdate) Mutation() *LocationMutation
- func (lu *LocationUpdate) RemovePackageIDs(ids ...int) *LocationUpdate
- func (lu *LocationUpdate) RemovePackages(p ...*Pkg) *LocationUpdate
- func (lu *LocationUpdate) Save(ctx context.Context) (int, error)
- func (lu *LocationUpdate) SaveX(ctx context.Context) int
- func (lu *LocationUpdate) SetConfig(tc types.LocationConfig) *LocationUpdate
- func (lu *LocationUpdate) SetDescription(s string) *LocationUpdate
- func (lu *LocationUpdate) SetName(s string) *LocationUpdate
- func (lu *LocationUpdate) SetNillableConfig(tc *types.LocationConfig) *LocationUpdate
- func (lu *LocationUpdate) SetNillableDescription(s *string) *LocationUpdate
- func (lu *LocationUpdate) SetNillableName(s *string) *LocationUpdate
- func (lu *LocationUpdate) SetNillablePurpose(tp *types.LocationPurpose) *LocationUpdate
- func (lu *LocationUpdate) SetNillableSource(ts *types.LocationSource) *LocationUpdate
- func (lu *LocationUpdate) SetNillableUUID(u *uuid.UUID) *LocationUpdate
- func (lu *LocationUpdate) SetPurpose(tp types.LocationPurpose) *LocationUpdate
- func (lu *LocationUpdate) SetSource(ts types.LocationSource) *LocationUpdate
- func (lu *LocationUpdate) SetUUID(u uuid.UUID) *LocationUpdate
- func (lu *LocationUpdate) Where(ps ...predicate.Location) *LocationUpdate
- type LocationUpdateOne
- func (luo *LocationUpdateOne) AddPackageIDs(ids ...int) *LocationUpdateOne
- func (luo *LocationUpdateOne) AddPackages(p ...*Pkg) *LocationUpdateOne
- func (luo *LocationUpdateOne) ClearPackages() *LocationUpdateOne
- func (luo *LocationUpdateOne) Exec(ctx context.Context) error
- func (luo *LocationUpdateOne) ExecX(ctx context.Context)
- func (luo *LocationUpdateOne) Mutation() *LocationMutation
- func (luo *LocationUpdateOne) RemovePackageIDs(ids ...int) *LocationUpdateOne
- func (luo *LocationUpdateOne) RemovePackages(p ...*Pkg) *LocationUpdateOne
- func (luo *LocationUpdateOne) Save(ctx context.Context) (*Location, error)
- func (luo *LocationUpdateOne) SaveX(ctx context.Context) *Location
- func (luo *LocationUpdateOne) Select(field string, fields ...string) *LocationUpdateOne
- func (luo *LocationUpdateOne) SetConfig(tc types.LocationConfig) *LocationUpdateOne
- func (luo *LocationUpdateOne) SetDescription(s string) *LocationUpdateOne
- func (luo *LocationUpdateOne) SetName(s string) *LocationUpdateOne
- func (luo *LocationUpdateOne) SetNillableConfig(tc *types.LocationConfig) *LocationUpdateOne
- func (luo *LocationUpdateOne) SetNillableDescription(s *string) *LocationUpdateOne
- func (luo *LocationUpdateOne) SetNillableName(s *string) *LocationUpdateOne
- func (luo *LocationUpdateOne) SetNillablePurpose(tp *types.LocationPurpose) *LocationUpdateOne
- func (luo *LocationUpdateOne) SetNillableSource(ts *types.LocationSource) *LocationUpdateOne
- func (luo *LocationUpdateOne) SetNillableUUID(u *uuid.UUID) *LocationUpdateOne
- func (luo *LocationUpdateOne) SetPurpose(tp types.LocationPurpose) *LocationUpdateOne
- func (luo *LocationUpdateOne) SetSource(ts types.LocationSource) *LocationUpdateOne
- func (luo *LocationUpdateOne) SetUUID(u uuid.UUID) *LocationUpdateOne
- func (luo *LocationUpdateOne) Where(ps ...predicate.Location) *LocationUpdateOne
- type Locations
- 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 int) *PkgDeleteOne
- func (c *PkgClient) Get(ctx context.Context, id int) (*Pkg, error)
- func (c *PkgClient) GetX(ctx context.Context, id int) *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) QueryLocation(pk *Pkg) *LocationQuery
- func (c *PkgClient) Update() *PkgUpdate
- func (c *PkgClient) UpdateOne(pk *Pkg) *PkgUpdateOne
- func (c *PkgClient) UpdateOneID(id int) *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) SetAipID(u uuid.UUID) *PkgCreate
- func (pc *PkgCreate) SetCreatedAt(t time.Time) *PkgCreate
- func (pc *PkgCreate) SetLocation(l *Location) *PkgCreate
- func (pc *PkgCreate) SetLocationID(i int) *PkgCreate
- func (pc *PkgCreate) SetName(s string) *PkgCreate
- func (pc *PkgCreate) SetNillableCreatedAt(t *time.Time) *PkgCreate
- func (pc *PkgCreate) SetNillableLocationID(i *int) *PkgCreate
- func (pc *PkgCreate) SetObjectKey(u uuid.UUID) *PkgCreate
- func (pc *PkgCreate) SetStatus(ts types.PackageStatus) *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) AipID() (r uuid.UUID, exists bool)
- func (m *PkgMutation) ClearEdge(name string) error
- func (m *PkgMutation) ClearField(name string) error
- func (m *PkgMutation) ClearLocation()
- func (m *PkgMutation) ClearLocationID()
- func (m *PkgMutation) ClearedEdges() []string
- func (m *PkgMutation) ClearedFields() []string
- func (m PkgMutation) Client() *Client
- func (m *PkgMutation) CreatedAt() (r time.Time, exists bool)
- 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 int, exists bool)
- func (m *PkgMutation) IDs(ctx context.Context) ([]int, error)
- func (m *PkgMutation) LocationCleared() bool
- func (m *PkgMutation) LocationID() (r int, exists bool)
- func (m *PkgMutation) LocationIDCleared() bool
- func (m *PkgMutation) LocationIDs() (ids []int)
- func (m *PkgMutation) Name() (r string, exists bool)
- func (m *PkgMutation) ObjectKey() (r uuid.UUID, exists bool)
- func (m *PkgMutation) OldAipID(ctx context.Context) (v uuid.UUID, err error)
- func (m *PkgMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *PkgMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *PkgMutation) OldLocationID(ctx context.Context) (v int, err error)
- func (m *PkgMutation) OldName(ctx context.Context) (v string, err error)
- func (m *PkgMutation) OldObjectKey(ctx context.Context) (v uuid.UUID, err error)
- func (m *PkgMutation) OldStatus(ctx context.Context) (v types.PackageStatus, err error)
- func (m *PkgMutation) Op() Op
- func (m *PkgMutation) RemovedEdges() []string
- func (m *PkgMutation) RemovedIDs(name string) []ent.Value
- func (m *PkgMutation) ResetAipID()
- func (m *PkgMutation) ResetCreatedAt()
- func (m *PkgMutation) ResetEdge(name string) error
- func (m *PkgMutation) ResetField(name string) error
- func (m *PkgMutation) ResetLocation()
- func (m *PkgMutation) ResetLocationID()
- func (m *PkgMutation) ResetName()
- func (m *PkgMutation) ResetObjectKey()
- func (m *PkgMutation) ResetStatus()
- func (m *PkgMutation) SetAipID(u uuid.UUID)
- func (m *PkgMutation) SetCreatedAt(t time.Time)
- func (m *PkgMutation) SetField(name string, value ent.Value) error
- func (m *PkgMutation) SetLocationID(i int)
- func (m *PkgMutation) SetName(s string)
- func (m *PkgMutation) SetObjectKey(u uuid.UUID)
- func (m *PkgMutation) SetOp(op Op)
- func (m *PkgMutation) SetStatus(ts types.PackageStatus)
- func (m *PkgMutation) Status() (r types.PackageStatus, exists bool)
- func (m PkgMutation) Tx() (*Tx, error)
- func (m *PkgMutation) Type() string
- 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 int, err error)
- func (pq *PkgQuery) FirstIDX(ctx context.Context) int
- 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 []int, err error)
- func (pq *PkgQuery) IDsX(ctx context.Context) []int
- 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 int, err error)
- func (pq *PkgQuery) OnlyIDX(ctx context.Context) int
- func (pq *PkgQuery) OnlyX(ctx context.Context) *Pkg
- func (pq *PkgQuery) Order(o ...pkg.OrderOption) *PkgQuery
- func (pq *PkgQuery) QueryLocation() *LocationQuery
- 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) WithLocation(opts ...func(*LocationQuery)) *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) ClearLocation() *PkgUpdate
- func (pu *PkgUpdate) ClearLocationID() *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) SetAipID(u uuid.UUID) *PkgUpdate
- func (pu *PkgUpdate) SetLocation(l *Location) *PkgUpdate
- func (pu *PkgUpdate) SetLocationID(i int) *PkgUpdate
- func (pu *PkgUpdate) SetName(s string) *PkgUpdate
- func (pu *PkgUpdate) SetNillableAipID(u *uuid.UUID) *PkgUpdate
- func (pu *PkgUpdate) SetNillableLocationID(i *int) *PkgUpdate
- func (pu *PkgUpdate) SetNillableName(s *string) *PkgUpdate
- func (pu *PkgUpdate) SetNillableObjectKey(u *uuid.UUID) *PkgUpdate
- func (pu *PkgUpdate) SetNillableStatus(ts *types.PackageStatus) *PkgUpdate
- func (pu *PkgUpdate) SetObjectKey(u uuid.UUID) *PkgUpdate
- func (pu *PkgUpdate) SetStatus(ts types.PackageStatus) *PkgUpdate
- func (pu *PkgUpdate) Where(ps ...predicate.Pkg) *PkgUpdate
- type PkgUpdateOne
- func (puo *PkgUpdateOne) ClearLocation() *PkgUpdateOne
- func (puo *PkgUpdateOne) ClearLocationID() *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) SetAipID(u uuid.UUID) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetLocation(l *Location) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetLocationID(i int) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetName(s string) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetNillableAipID(u *uuid.UUID) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetNillableLocationID(i *int) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetNillableName(s *string) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetNillableObjectKey(u *uuid.UUID) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetNillableStatus(ts *types.PackageStatus) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetObjectKey(u uuid.UUID) *PkgUpdateOne
- func (puo *PkgUpdateOne) SetStatus(ts types.PackageStatus) *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 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. TypeLocation = "Location" TypePkg = "Pkg" )
Variables ¶
var ErrTxStarted = errors.New("db: 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(db.As(db.Sum(field1), "sum_field1"), (db.As(db.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 // Location is the client for interacting with the Location builders. Location *LocationClient // Pkg is the client for interacting with the Pkg builders. Pkg *PkgClient // 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(). Location. 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 Location ¶
type Location struct { // ID of the ent. ID int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Description holds the value of the "description" field. Description string `json:"description,omitempty"` // Source holds the value of the "source" field. Source types.LocationSource `json:"source,omitempty"` // Purpose holds the value of the "purpose" field. Purpose types.LocationPurpose `json:"purpose,omitempty"` // UUID holds the value of the "uuid" field. UUID uuid.UUID `json:"uuid,omitempty"` // Config holds the value of the "config" field. Config types.LocationConfig `json:"config,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the LocationQuery when eager-loading is set. Edges LocationEdges `json:"edges"` // contains filtered or unexported fields }
Location is the model entity for the Location schema.
func (*Location) QueryPackages ¶
QueryPackages queries the "packages" edge of the Location entity.
func (*Location) Unwrap ¶
Unwrap unwraps the Location 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 (*Location) Update ¶
func (l *Location) Update() *LocationUpdateOne
Update returns a builder for updating this Location. Note that you need to call Location.Unwrap() before calling this method if this Location was returned from a transaction, and the transaction was committed or rolled back.
type LocationClient ¶
type LocationClient struct {
// contains filtered or unexported fields
}
LocationClient is a client for the Location schema.
func NewLocationClient ¶
func NewLocationClient(c config) *LocationClient
NewLocationClient returns a client for the Location from the given config.
func (*LocationClient) Create ¶
func (c *LocationClient) Create() *LocationCreate
Create returns a builder for creating a Location entity.
func (*LocationClient) CreateBulk ¶
func (c *LocationClient) CreateBulk(builders ...*LocationCreate) *LocationCreateBulk
CreateBulk returns a builder for creating a bulk of Location entities.
func (*LocationClient) Delete ¶
func (c *LocationClient) Delete() *LocationDelete
Delete returns a delete builder for Location.
func (*LocationClient) DeleteOne ¶
func (c *LocationClient) DeleteOne(l *Location) *LocationDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*LocationClient) DeleteOneID ¶
func (c *LocationClient) DeleteOneID(id int) *LocationDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*LocationClient) GetX ¶
func (c *LocationClient) GetX(ctx context.Context, id int) *Location
GetX is like Get, but panics if an error occurs.
func (*LocationClient) Hooks ¶
func (c *LocationClient) Hooks() []Hook
Hooks returns the client hooks.
func (*LocationClient) Intercept ¶
func (c *LocationClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `location.Intercept(f(g(h())))`.
func (*LocationClient) Interceptors ¶
func (c *LocationClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*LocationClient) MapCreateBulk ¶
func (c *LocationClient) MapCreateBulk(slice any, setFunc func(*LocationCreate, int)) *LocationCreateBulk
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 (*LocationClient) Query ¶
func (c *LocationClient) Query() *LocationQuery
Query returns a query builder for Location.
func (*LocationClient) QueryPackages ¶
func (c *LocationClient) QueryPackages(l *Location) *PkgQuery
QueryPackages queries the packages edge of a Location.
func (*LocationClient) Update ¶
func (c *LocationClient) Update() *LocationUpdate
Update returns an update builder for Location.
func (*LocationClient) UpdateOne ¶
func (c *LocationClient) UpdateOne(l *Location) *LocationUpdateOne
UpdateOne returns an update builder for the given entity.
func (*LocationClient) UpdateOneID ¶
func (c *LocationClient) UpdateOneID(id int) *LocationUpdateOne
UpdateOneID returns an update builder for the given id.
func (*LocationClient) Use ¶
func (c *LocationClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `location.Hooks(f(g(h())))`.
type LocationCreate ¶
type LocationCreate struct {
// contains filtered or unexported fields
}
LocationCreate is the builder for creating a Location entity.
func (*LocationCreate) AddPackageIDs ¶
func (lc *LocationCreate) AddPackageIDs(ids ...int) *LocationCreate
AddPackageIDs adds the "packages" edge to the Pkg entity by IDs.
func (*LocationCreate) AddPackages ¶
func (lc *LocationCreate) AddPackages(p ...*Pkg) *LocationCreate
AddPackages adds the "packages" edges to the Pkg entity.
func (*LocationCreate) Exec ¶
func (lc *LocationCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*LocationCreate) ExecX ¶
func (lc *LocationCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LocationCreate) Mutation ¶
func (lc *LocationCreate) Mutation() *LocationMutation
Mutation returns the LocationMutation object of the builder.
func (*LocationCreate) Save ¶
func (lc *LocationCreate) Save(ctx context.Context) (*Location, error)
Save creates the Location in the database.
func (*LocationCreate) SaveX ¶
func (lc *LocationCreate) SaveX(ctx context.Context) *Location
SaveX calls Save and panics if Save returns an error.
func (*LocationCreate) SetConfig ¶
func (lc *LocationCreate) SetConfig(tc types.LocationConfig) *LocationCreate
SetConfig sets the "config" field.
func (*LocationCreate) SetCreatedAt ¶
func (lc *LocationCreate) SetCreatedAt(t time.Time) *LocationCreate
SetCreatedAt sets the "created_at" field.
func (*LocationCreate) SetDescription ¶
func (lc *LocationCreate) SetDescription(s string) *LocationCreate
SetDescription sets the "description" field.
func (*LocationCreate) SetName ¶
func (lc *LocationCreate) SetName(s string) *LocationCreate
SetName sets the "name" field.
func (*LocationCreate) SetNillableCreatedAt ¶
func (lc *LocationCreate) SetNillableCreatedAt(t *time.Time) *LocationCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*LocationCreate) SetPurpose ¶
func (lc *LocationCreate) SetPurpose(tp types.LocationPurpose) *LocationCreate
SetPurpose sets the "purpose" field.
func (*LocationCreate) SetSource ¶
func (lc *LocationCreate) SetSource(ts types.LocationSource) *LocationCreate
SetSource sets the "source" field.
func (*LocationCreate) SetUUID ¶
func (lc *LocationCreate) SetUUID(u uuid.UUID) *LocationCreate
SetUUID sets the "uuid" field.
type LocationCreateBulk ¶
type LocationCreateBulk struct {
// contains filtered or unexported fields
}
LocationCreateBulk is the builder for creating many Location entities in bulk.
func (*LocationCreateBulk) Exec ¶
func (lcb *LocationCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*LocationCreateBulk) ExecX ¶
func (lcb *LocationCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type LocationDelete ¶
type LocationDelete struct {
// contains filtered or unexported fields
}
LocationDelete is the builder for deleting a Location entity.
func (*LocationDelete) Exec ¶
func (ld *LocationDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*LocationDelete) ExecX ¶
func (ld *LocationDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*LocationDelete) Where ¶
func (ld *LocationDelete) Where(ps ...predicate.Location) *LocationDelete
Where appends a list predicates to the LocationDelete builder.
type LocationDeleteOne ¶
type LocationDeleteOne struct {
// contains filtered or unexported fields
}
LocationDeleteOne is the builder for deleting a single Location entity.
func (*LocationDeleteOne) Exec ¶
func (ldo *LocationDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*LocationDeleteOne) ExecX ¶
func (ldo *LocationDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LocationDeleteOne) Where ¶
func (ldo *LocationDeleteOne) Where(ps ...predicate.Location) *LocationDeleteOne
Where appends a list predicates to the LocationDelete builder.
type LocationEdges ¶
type LocationEdges struct { // Packages holds the value of the packages edge. Packages []*Pkg `json:"packages,omitempty"` // contains filtered or unexported fields }
LocationEdges holds the relations/edges for other nodes in the graph.
func (LocationEdges) PackagesOrErr ¶
func (e LocationEdges) PackagesOrErr() ([]*Pkg, error)
PackagesOrErr returns the Packages value or an error if the edge was not loaded in eager-loading.
type LocationGroupBy ¶
type LocationGroupBy struct {
// contains filtered or unexported fields
}
LocationGroupBy is the group-by builder for Location entities.
func (*LocationGroupBy) Aggregate ¶
func (lgb *LocationGroupBy) Aggregate(fns ...AggregateFunc) *LocationGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*LocationGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*LocationGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*LocationGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*LocationGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*LocationGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*LocationGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*LocationGroupBy) Scan ¶
func (lgb *LocationGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*LocationGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type LocationMutation ¶
type LocationMutation struct {
// contains filtered or unexported fields
}
LocationMutation represents an operation that mutates the Location nodes in the graph.
func (*LocationMutation) AddField ¶
func (m *LocationMutation) 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 (*LocationMutation) AddPackageIDs ¶
func (m *LocationMutation) AddPackageIDs(ids ...int)
AddPackageIDs adds the "packages" edge to the Pkg entity by ids.
func (*LocationMutation) AddedEdges ¶
func (m *LocationMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*LocationMutation) AddedField ¶
func (m *LocationMutation) 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 (*LocationMutation) AddedFields ¶
func (m *LocationMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*LocationMutation) AddedIDs ¶
func (m *LocationMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*LocationMutation) ClearEdge ¶
func (m *LocationMutation) 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 (*LocationMutation) ClearField ¶
func (m *LocationMutation) 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 (*LocationMutation) ClearPackages ¶
func (m *LocationMutation) ClearPackages()
ClearPackages clears the "packages" edge to the Pkg entity.
func (*LocationMutation) ClearedEdges ¶
func (m *LocationMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*LocationMutation) ClearedFields ¶
func (m *LocationMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (LocationMutation) Client ¶
func (m LocationMutation) 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 (*LocationMutation) Config ¶
func (m *LocationMutation) Config() (r types.LocationConfig, exists bool)
Config returns the value of the "config" field in the mutation.
func (*LocationMutation) CreatedAt ¶
func (m *LocationMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*LocationMutation) Description ¶
func (m *LocationMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*LocationMutation) EdgeCleared ¶
func (m *LocationMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*LocationMutation) Field ¶
func (m *LocationMutation) 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 (*LocationMutation) FieldCleared ¶
func (m *LocationMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*LocationMutation) Fields ¶
func (m *LocationMutation) 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 (*LocationMutation) ID ¶
func (m *LocationMutation) 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 (*LocationMutation) IDs ¶
func (m *LocationMutation) 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 (*LocationMutation) Name ¶
func (m *LocationMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*LocationMutation) OldConfig ¶
func (m *LocationMutation) OldConfig(ctx context.Context) (v types.LocationConfig, err error)
OldConfig returns the old "config" field's value of the Location entity. If the Location 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 (*LocationMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Location entity. If the Location 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 (*LocationMutation) OldDescription ¶
func (m *LocationMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Location entity. If the Location 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 (*LocationMutation) 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 (*LocationMutation) OldName ¶
func (m *LocationMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Location entity. If the Location 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 (*LocationMutation) OldPurpose ¶
func (m *LocationMutation) OldPurpose(ctx context.Context) (v types.LocationPurpose, err error)
OldPurpose returns the old "purpose" field's value of the Location entity. If the Location 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 (*LocationMutation) OldSource ¶
func (m *LocationMutation) OldSource(ctx context.Context) (v types.LocationSource, err error)
OldSource returns the old "source" field's value of the Location entity. If the Location 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 (*LocationMutation) OldUUID ¶
OldUUID returns the old "uuid" field's value of the Location entity. If the Location 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 (*LocationMutation) PackagesCleared ¶
func (m *LocationMutation) PackagesCleared() bool
PackagesCleared reports if the "packages" edge to the Pkg entity was cleared.
func (*LocationMutation) PackagesIDs ¶
func (m *LocationMutation) PackagesIDs() (ids []int)
PackagesIDs returns the "packages" edge IDs in the mutation.
func (*LocationMutation) Purpose ¶
func (m *LocationMutation) Purpose() (r types.LocationPurpose, exists bool)
Purpose returns the value of the "purpose" field in the mutation.
func (*LocationMutation) RemovePackageIDs ¶
func (m *LocationMutation) RemovePackageIDs(ids ...int)
RemovePackageIDs removes the "packages" edge to the Pkg entity by IDs.
func (*LocationMutation) RemovedEdges ¶
func (m *LocationMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*LocationMutation) RemovedIDs ¶
func (m *LocationMutation) 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 (*LocationMutation) RemovedPackagesIDs ¶
func (m *LocationMutation) RemovedPackagesIDs() (ids []int)
RemovedPackages returns the removed IDs of the "packages" edge to the Pkg entity.
func (*LocationMutation) ResetConfig ¶
func (m *LocationMutation) ResetConfig()
ResetConfig resets all changes to the "config" field.
func (*LocationMutation) ResetCreatedAt ¶
func (m *LocationMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*LocationMutation) ResetDescription ¶
func (m *LocationMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*LocationMutation) ResetEdge ¶
func (m *LocationMutation) 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 (*LocationMutation) ResetField ¶
func (m *LocationMutation) 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 (*LocationMutation) ResetName ¶
func (m *LocationMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*LocationMutation) ResetPackages ¶
func (m *LocationMutation) ResetPackages()
ResetPackages resets all changes to the "packages" edge.
func (*LocationMutation) ResetPurpose ¶
func (m *LocationMutation) ResetPurpose()
ResetPurpose resets all changes to the "purpose" field.
func (*LocationMutation) ResetSource ¶
func (m *LocationMutation) ResetSource()
ResetSource resets all changes to the "source" field.
func (*LocationMutation) ResetUUID ¶
func (m *LocationMutation) ResetUUID()
ResetUUID resets all changes to the "uuid" field.
func (*LocationMutation) SetConfig ¶
func (m *LocationMutation) SetConfig(tc types.LocationConfig)
SetConfig sets the "config" field.
func (*LocationMutation) SetCreatedAt ¶
func (m *LocationMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*LocationMutation) SetDescription ¶
func (m *LocationMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*LocationMutation) SetField ¶
func (m *LocationMutation) 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 (*LocationMutation) SetName ¶
func (m *LocationMutation) SetName(s string)
SetName sets the "name" field.
func (*LocationMutation) SetOp ¶
func (m *LocationMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*LocationMutation) SetPurpose ¶
func (m *LocationMutation) SetPurpose(tp types.LocationPurpose)
SetPurpose sets the "purpose" field.
func (*LocationMutation) SetSource ¶
func (m *LocationMutation) SetSource(ts types.LocationSource)
SetSource sets the "source" field.
func (*LocationMutation) SetUUID ¶
func (m *LocationMutation) SetUUID(u uuid.UUID)
SetUUID sets the "uuid" field.
func (*LocationMutation) Source ¶
func (m *LocationMutation) Source() (r types.LocationSource, exists bool)
Source returns the value of the "source" field in the mutation.
func (LocationMutation) Tx ¶
func (m LocationMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*LocationMutation) Type ¶
func (m *LocationMutation) Type() string
Type returns the node type of this mutation (Location).
func (*LocationMutation) UUID ¶
func (m *LocationMutation) UUID() (r uuid.UUID, exists bool)
UUID returns the value of the "uuid" field in the mutation.
func (*LocationMutation) Where ¶
func (m *LocationMutation) Where(ps ...predicate.Location)
Where appends a list predicates to the LocationMutation builder.
func (*LocationMutation) WhereP ¶
func (m *LocationMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the LocationMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type LocationQuery ¶
type LocationQuery struct {
// contains filtered or unexported fields
}
LocationQuery is the builder for querying Location entities.
func (*LocationQuery) Aggregate ¶
func (lq *LocationQuery) Aggregate(fns ...AggregateFunc) *LocationSelect
Aggregate returns a LocationSelect configured with the given aggregations.
func (*LocationQuery) All ¶
func (lq *LocationQuery) All(ctx context.Context) ([]*Location, error)
All executes the query and returns a list of Locations.
func (*LocationQuery) AllX ¶
func (lq *LocationQuery) AllX(ctx context.Context) []*Location
AllX is like All, but panics if an error occurs.
func (*LocationQuery) Clone ¶
func (lq *LocationQuery) Clone() *LocationQuery
Clone returns a duplicate of the LocationQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*LocationQuery) Count ¶
func (lq *LocationQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*LocationQuery) CountX ¶
func (lq *LocationQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*LocationQuery) Exist ¶
func (lq *LocationQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*LocationQuery) ExistX ¶
func (lq *LocationQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*LocationQuery) First ¶
func (lq *LocationQuery) First(ctx context.Context) (*Location, error)
First returns the first Location entity from the query. Returns a *NotFoundError when no Location was found.
func (*LocationQuery) FirstID ¶
func (lq *LocationQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Location ID from the query. Returns a *NotFoundError when no Location ID was found.
func (*LocationQuery) FirstIDX ¶
func (lq *LocationQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*LocationQuery) FirstX ¶
func (lq *LocationQuery) FirstX(ctx context.Context) *Location
FirstX is like First, but panics if an error occurs.
func (*LocationQuery) GroupBy ¶
func (lq *LocationQuery) GroupBy(field string, fields ...string) *LocationGroupBy
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.Location.Query(). GroupBy(location.FieldName). Aggregate(db.Count()). Scan(ctx, &v)
func (*LocationQuery) IDs ¶
func (lq *LocationQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Location IDs.
func (*LocationQuery) IDsX ¶
func (lq *LocationQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*LocationQuery) Limit ¶
func (lq *LocationQuery) Limit(limit int) *LocationQuery
Limit the number of records to be returned by this query.
func (*LocationQuery) Offset ¶
func (lq *LocationQuery) Offset(offset int) *LocationQuery
Offset to start from.
func (*LocationQuery) Only ¶
func (lq *LocationQuery) Only(ctx context.Context) (*Location, error)
Only returns a single Location entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Location entity is found. Returns a *NotFoundError when no Location entities are found.
func (*LocationQuery) OnlyID ¶
func (lq *LocationQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Location ID in the query. Returns a *NotSingularError when more than one Location ID is found. Returns a *NotFoundError when no entities are found.
func (*LocationQuery) OnlyIDX ¶
func (lq *LocationQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*LocationQuery) OnlyX ¶
func (lq *LocationQuery) OnlyX(ctx context.Context) *Location
OnlyX is like Only, but panics if an error occurs.
func (*LocationQuery) Order ¶
func (lq *LocationQuery) Order(o ...location.OrderOption) *LocationQuery
Order specifies how the records should be ordered.
func (*LocationQuery) QueryPackages ¶
func (lq *LocationQuery) QueryPackages() *PkgQuery
QueryPackages chains the current query on the "packages" edge.
func (*LocationQuery) Select ¶
func (lq *LocationQuery) Select(fields ...string) *LocationSelect
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.Location.Query(). Select(location.FieldName). Scan(ctx, &v)
func (*LocationQuery) Unique ¶
func (lq *LocationQuery) Unique(unique bool) *LocationQuery
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 (*LocationQuery) Where ¶
func (lq *LocationQuery) Where(ps ...predicate.Location) *LocationQuery
Where adds a new predicate for the LocationQuery builder.
func (*LocationQuery) WithPackages ¶
func (lq *LocationQuery) WithPackages(opts ...func(*PkgQuery)) *LocationQuery
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 LocationSelect ¶
type LocationSelect struct { *LocationQuery // contains filtered or unexported fields }
LocationSelect is the builder for selecting fields of Location entities.
func (*LocationSelect) Aggregate ¶
func (ls *LocationSelect) Aggregate(fns ...AggregateFunc) *LocationSelect
Aggregate adds the given aggregation functions to the selector query.
func (*LocationSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*LocationSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*LocationSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*LocationSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*LocationSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*LocationSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*LocationSelect) Scan ¶
func (ls *LocationSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*LocationSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type LocationUpdate ¶
type LocationUpdate struct {
// contains filtered or unexported fields
}
LocationUpdate is the builder for updating Location entities.
func (*LocationUpdate) AddPackageIDs ¶
func (lu *LocationUpdate) AddPackageIDs(ids ...int) *LocationUpdate
AddPackageIDs adds the "packages" edge to the Pkg entity by IDs.
func (*LocationUpdate) AddPackages ¶
func (lu *LocationUpdate) AddPackages(p ...*Pkg) *LocationUpdate
AddPackages adds the "packages" edges to the Pkg entity.
func (*LocationUpdate) ClearPackages ¶
func (lu *LocationUpdate) ClearPackages() *LocationUpdate
ClearPackages clears all "packages" edges to the Pkg entity.
func (*LocationUpdate) Exec ¶
func (lu *LocationUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*LocationUpdate) ExecX ¶
func (lu *LocationUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LocationUpdate) Mutation ¶
func (lu *LocationUpdate) Mutation() *LocationMutation
Mutation returns the LocationMutation object of the builder.
func (*LocationUpdate) RemovePackageIDs ¶
func (lu *LocationUpdate) RemovePackageIDs(ids ...int) *LocationUpdate
RemovePackageIDs removes the "packages" edge to Pkg entities by IDs.
func (*LocationUpdate) RemovePackages ¶
func (lu *LocationUpdate) RemovePackages(p ...*Pkg) *LocationUpdate
RemovePackages removes "packages" edges to Pkg entities.
func (*LocationUpdate) Save ¶
func (lu *LocationUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*LocationUpdate) SaveX ¶
func (lu *LocationUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*LocationUpdate) SetConfig ¶
func (lu *LocationUpdate) SetConfig(tc types.LocationConfig) *LocationUpdate
SetConfig sets the "config" field.
func (*LocationUpdate) SetDescription ¶
func (lu *LocationUpdate) SetDescription(s string) *LocationUpdate
SetDescription sets the "description" field.
func (*LocationUpdate) SetName ¶
func (lu *LocationUpdate) SetName(s string) *LocationUpdate
SetName sets the "name" field.
func (*LocationUpdate) SetNillableConfig ¶
func (lu *LocationUpdate) SetNillableConfig(tc *types.LocationConfig) *LocationUpdate
SetNillableConfig sets the "config" field if the given value is not nil.
func (*LocationUpdate) SetNillableDescription ¶
func (lu *LocationUpdate) SetNillableDescription(s *string) *LocationUpdate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*LocationUpdate) SetNillableName ¶
func (lu *LocationUpdate) SetNillableName(s *string) *LocationUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*LocationUpdate) SetNillablePurpose ¶
func (lu *LocationUpdate) SetNillablePurpose(tp *types.LocationPurpose) *LocationUpdate
SetNillablePurpose sets the "purpose" field if the given value is not nil.
func (*LocationUpdate) SetNillableSource ¶
func (lu *LocationUpdate) SetNillableSource(ts *types.LocationSource) *LocationUpdate
SetNillableSource sets the "source" field if the given value is not nil.
func (*LocationUpdate) SetNillableUUID ¶
func (lu *LocationUpdate) SetNillableUUID(u *uuid.UUID) *LocationUpdate
SetNillableUUID sets the "uuid" field if the given value is not nil.
func (*LocationUpdate) SetPurpose ¶
func (lu *LocationUpdate) SetPurpose(tp types.LocationPurpose) *LocationUpdate
SetPurpose sets the "purpose" field.
func (*LocationUpdate) SetSource ¶
func (lu *LocationUpdate) SetSource(ts types.LocationSource) *LocationUpdate
SetSource sets the "source" field.
func (*LocationUpdate) SetUUID ¶
func (lu *LocationUpdate) SetUUID(u uuid.UUID) *LocationUpdate
SetUUID sets the "uuid" field.
func (*LocationUpdate) Where ¶
func (lu *LocationUpdate) Where(ps ...predicate.Location) *LocationUpdate
Where appends a list predicates to the LocationUpdate builder.
type LocationUpdateOne ¶
type LocationUpdateOne struct {
// contains filtered or unexported fields
}
LocationUpdateOne is the builder for updating a single Location entity.
func (*LocationUpdateOne) AddPackageIDs ¶
func (luo *LocationUpdateOne) AddPackageIDs(ids ...int) *LocationUpdateOne
AddPackageIDs adds the "packages" edge to the Pkg entity by IDs.
func (*LocationUpdateOne) AddPackages ¶
func (luo *LocationUpdateOne) AddPackages(p ...*Pkg) *LocationUpdateOne
AddPackages adds the "packages" edges to the Pkg entity.
func (*LocationUpdateOne) ClearPackages ¶
func (luo *LocationUpdateOne) ClearPackages() *LocationUpdateOne
ClearPackages clears all "packages" edges to the Pkg entity.
func (*LocationUpdateOne) Exec ¶
func (luo *LocationUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*LocationUpdateOne) ExecX ¶
func (luo *LocationUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LocationUpdateOne) Mutation ¶
func (luo *LocationUpdateOne) Mutation() *LocationMutation
Mutation returns the LocationMutation object of the builder.
func (*LocationUpdateOne) RemovePackageIDs ¶
func (luo *LocationUpdateOne) RemovePackageIDs(ids ...int) *LocationUpdateOne
RemovePackageIDs removes the "packages" edge to Pkg entities by IDs.
func (*LocationUpdateOne) RemovePackages ¶
func (luo *LocationUpdateOne) RemovePackages(p ...*Pkg) *LocationUpdateOne
RemovePackages removes "packages" edges to Pkg entities.
func (*LocationUpdateOne) Save ¶
func (luo *LocationUpdateOne) Save(ctx context.Context) (*Location, error)
Save executes the query and returns the updated Location entity.
func (*LocationUpdateOne) SaveX ¶
func (luo *LocationUpdateOne) SaveX(ctx context.Context) *Location
SaveX is like Save, but panics if an error occurs.
func (*LocationUpdateOne) Select ¶
func (luo *LocationUpdateOne) Select(field string, fields ...string) *LocationUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*LocationUpdateOne) SetConfig ¶
func (luo *LocationUpdateOne) SetConfig(tc types.LocationConfig) *LocationUpdateOne
SetConfig sets the "config" field.
func (*LocationUpdateOne) SetDescription ¶
func (luo *LocationUpdateOne) SetDescription(s string) *LocationUpdateOne
SetDescription sets the "description" field.
func (*LocationUpdateOne) SetName ¶
func (luo *LocationUpdateOne) SetName(s string) *LocationUpdateOne
SetName sets the "name" field.
func (*LocationUpdateOne) SetNillableConfig ¶
func (luo *LocationUpdateOne) SetNillableConfig(tc *types.LocationConfig) *LocationUpdateOne
SetNillableConfig sets the "config" field if the given value is not nil.
func (*LocationUpdateOne) SetNillableDescription ¶
func (luo *LocationUpdateOne) SetNillableDescription(s *string) *LocationUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*LocationUpdateOne) SetNillableName ¶
func (luo *LocationUpdateOne) SetNillableName(s *string) *LocationUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*LocationUpdateOne) SetNillablePurpose ¶
func (luo *LocationUpdateOne) SetNillablePurpose(tp *types.LocationPurpose) *LocationUpdateOne
SetNillablePurpose sets the "purpose" field if the given value is not nil.
func (*LocationUpdateOne) SetNillableSource ¶
func (luo *LocationUpdateOne) SetNillableSource(ts *types.LocationSource) *LocationUpdateOne
SetNillableSource sets the "source" field if the given value is not nil.
func (*LocationUpdateOne) SetNillableUUID ¶
func (luo *LocationUpdateOne) SetNillableUUID(u *uuid.UUID) *LocationUpdateOne
SetNillableUUID sets the "uuid" field if the given value is not nil.
func (*LocationUpdateOne) SetPurpose ¶
func (luo *LocationUpdateOne) SetPurpose(tp types.LocationPurpose) *LocationUpdateOne
SetPurpose sets the "purpose" field.
func (*LocationUpdateOne) SetSource ¶
func (luo *LocationUpdateOne) SetSource(ts types.LocationSource) *LocationUpdateOne
SetSource sets the "source" field.
func (*LocationUpdateOne) SetUUID ¶
func (luo *LocationUpdateOne) SetUUID(u uuid.UUID) *LocationUpdateOne
SetUUID sets the "uuid" field.
func (*LocationUpdateOne) Where ¶
func (luo *LocationUpdateOne) Where(ps ...predicate.Location) *LocationUpdateOne
Where appends a list predicates to the LocationUpdate builder.
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 int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // AipID holds the value of the "aip_id" field. AipID uuid.UUID `json:"aip_id,omitempty"` // LocationID holds the value of the "location_id" field. LocationID int `json:"location_id,omitempty"` // Status holds the value of the "status" field. Status types.PackageStatus `json:"status,omitempty"` // ObjectKey holds the value of the "object_key" field. ObjectKey uuid.UUID `json:"object_key,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,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) QueryLocation ¶
func (pk *Pkg) QueryLocation() *LocationQuery
QueryLocation queries the "location" 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 int) *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) QueryLocation ¶
func (c *PkgClient) QueryLocation(pk *Pkg) *LocationQuery
QueryLocation queries the location 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 int) *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) SetCreatedAt ¶
SetCreatedAt sets the "created_at" field.
func (*PkgCreate) SetLocation ¶
SetLocation sets the "location" edge to the Location entity.
func (*PkgCreate) SetLocationID ¶
SetLocationID sets the "location_id" field.
func (*PkgCreate) SetNillableCreatedAt ¶
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*PkgCreate) SetNillableLocationID ¶
SetNillableLocationID sets the "location_id" field if the given value is not nil.
func (*PkgCreate) SetObjectKey ¶
SetObjectKey sets the "object_key" 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 { // Location holds the value of the location edge. Location *Location `json:"location,omitempty"` // contains filtered or unexported fields }
PkgEdges holds the relations/edges for other nodes in the graph.
func (PkgEdges) LocationOrErr ¶
LocationOrErr returns the Location 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) AipID ¶
func (m *PkgMutation) AipID() (r uuid.UUID, exists bool)
AipID returns the value of the "aip_id" 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) ClearLocation ¶
func (m *PkgMutation) ClearLocation()
ClearLocation clears the "location" edge to the Location entity.
func (*PkgMutation) ClearLocationID ¶
func (m *PkgMutation) ClearLocationID()
ClearLocationID clears the value of the "location_id" field.
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) CreatedAt ¶
func (m *PkgMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
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 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 (*PkgMutation) IDs ¶
func (m *PkgMutation) 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 (*PkgMutation) LocationCleared ¶
func (m *PkgMutation) LocationCleared() bool
LocationCleared reports if the "location" edge to the Location entity was cleared.
func (*PkgMutation) LocationID ¶
func (m *PkgMutation) LocationID() (r int, exists bool)
LocationID returns the value of the "location_id" field in the mutation.
func (*PkgMutation) LocationIDCleared ¶
func (m *PkgMutation) LocationIDCleared() bool
LocationIDCleared returns if the "location_id" field was cleared in this mutation.
func (*PkgMutation) LocationIDs ¶
func (m *PkgMutation) LocationIDs() (ids []int)
LocationIDs returns the "location" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use LocationID instead. It exists only for internal usage by the builders.
func (*PkgMutation) Name ¶
func (m *PkgMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*PkgMutation) ObjectKey ¶
func (m *PkgMutation) ObjectKey() (r uuid.UUID, exists bool)
ObjectKey returns the value of the "object_key" field in the mutation.
func (*PkgMutation) OldAipID ¶
OldAipID returns the old "aip_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) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" 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) OldLocationID ¶
func (m *PkgMutation) OldLocationID(ctx context.Context) (v int, err error)
OldLocationID returns the old "location_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) 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) OldObjectKey ¶
OldObjectKey returns the old "object_key" 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) OldStatus ¶
func (m *PkgMutation) OldStatus(ctx context.Context) (v types.PackageStatus, err error)
OldStatus returns the old "status" 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) 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) ResetAipID ¶
func (m *PkgMutation) ResetAipID()
ResetAipID resets all changes to the "aip_id" field.
func (*PkgMutation) ResetCreatedAt ¶
func (m *PkgMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" 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) ResetLocation ¶
func (m *PkgMutation) ResetLocation()
ResetLocation resets all changes to the "location" edge.
func (*PkgMutation) ResetLocationID ¶
func (m *PkgMutation) ResetLocationID()
ResetLocationID resets all changes to the "location_id" field.
func (*PkgMutation) ResetName ¶
func (m *PkgMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*PkgMutation) ResetObjectKey ¶
func (m *PkgMutation) ResetObjectKey()
ResetObjectKey resets all changes to the "object_key" field.
func (*PkgMutation) ResetStatus ¶
func (m *PkgMutation) ResetStatus()
ResetStatus resets all changes to the "status" field.
func (*PkgMutation) SetAipID ¶
func (m *PkgMutation) SetAipID(u uuid.UUID)
SetAipID sets the "aip_id" field.
func (*PkgMutation) SetCreatedAt ¶
func (m *PkgMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" 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) SetLocationID ¶
func (m *PkgMutation) SetLocationID(i int)
SetLocationID sets the "location_id" field.
func (*PkgMutation) SetName ¶
func (m *PkgMutation) SetName(s string)
SetName sets the "name" field.
func (*PkgMutation) SetObjectKey ¶
func (m *PkgMutation) SetObjectKey(u uuid.UUID)
SetObjectKey sets the "object_key" field.
func (*PkgMutation) SetOp ¶
func (m *PkgMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*PkgMutation) SetStatus ¶
func (m *PkgMutation) SetStatus(ts types.PackageStatus)
SetStatus sets the "status" field.
func (*PkgMutation) Status ¶
func (m *PkgMutation) Status() (r types.PackageStatus, exists bool)
Status returns the value of the "status" field in the mutation.
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) 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 { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Pkg.Query(). GroupBy(pkg.FieldName). Aggregate(db.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) QueryLocation ¶
func (pq *PkgQuery) QueryLocation() *LocationQuery
QueryLocation chains the current query on the "location" 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 { Name string `json:"name,omitempty"` } client.Pkg.Query(). Select(pkg.FieldName). 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) WithLocation ¶
func (pq *PkgQuery) WithLocation(opts ...func(*LocationQuery)) *PkgQuery
WithLocation tells the query-builder to eager-load the nodes that are connected to the "location" 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) ClearLocation ¶
ClearLocation clears the "location" edge to the Location entity.
func (*PkgUpdate) ClearLocationID ¶
ClearLocationID clears the value of the "location_id" field.
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) SetLocation ¶
SetLocation sets the "location" edge to the Location entity.
func (*PkgUpdate) SetLocationID ¶
SetLocationID sets the "location_id" field.
func (*PkgUpdate) SetNillableAipID ¶
SetNillableAipID sets the "aip_id" field if the given value is not nil.
func (*PkgUpdate) SetNillableLocationID ¶
SetNillableLocationID sets the "location_id" 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) SetNillableObjectKey ¶
SetNillableObjectKey sets the "object_key" field if the given value is not nil.
func (*PkgUpdate) SetNillableStatus ¶
func (pu *PkgUpdate) SetNillableStatus(ts *types.PackageStatus) *PkgUpdate
SetNillableStatus sets the "status" field if the given value is not nil.
func (*PkgUpdate) SetObjectKey ¶
SetObjectKey sets the "object_key" field.
type PkgUpdateOne ¶
type PkgUpdateOne struct {
// contains filtered or unexported fields
}
PkgUpdateOne is the builder for updating a single Pkg entity.
func (*PkgUpdateOne) ClearLocation ¶
func (puo *PkgUpdateOne) ClearLocation() *PkgUpdateOne
ClearLocation clears the "location" edge to the Location entity.
func (*PkgUpdateOne) ClearLocationID ¶
func (puo *PkgUpdateOne) ClearLocationID() *PkgUpdateOne
ClearLocationID clears the value of the "location_id" field.
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) SetAipID ¶
func (puo *PkgUpdateOne) SetAipID(u uuid.UUID) *PkgUpdateOne
SetAipID sets the "aip_id" field.
func (*PkgUpdateOne) SetLocation ¶
func (puo *PkgUpdateOne) SetLocation(l *Location) *PkgUpdateOne
SetLocation sets the "location" edge to the Location entity.
func (*PkgUpdateOne) SetLocationID ¶
func (puo *PkgUpdateOne) SetLocationID(i int) *PkgUpdateOne
SetLocationID sets the "location_id" field.
func (*PkgUpdateOne) SetName ¶
func (puo *PkgUpdateOne) SetName(s string) *PkgUpdateOne
SetName sets the "name" field.
func (*PkgUpdateOne) SetNillableAipID ¶
func (puo *PkgUpdateOne) SetNillableAipID(u *uuid.UUID) *PkgUpdateOne
SetNillableAipID sets the "aip_id" field if the given value is not nil.
func (*PkgUpdateOne) SetNillableLocationID ¶
func (puo *PkgUpdateOne) SetNillableLocationID(i *int) *PkgUpdateOne
SetNillableLocationID sets the "location_id" 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) SetNillableObjectKey ¶
func (puo *PkgUpdateOne) SetNillableObjectKey(u *uuid.UUID) *PkgUpdateOne
SetNillableObjectKey sets the "object_key" field if the given value is not nil.
func (*PkgUpdateOne) SetNillableStatus ¶
func (puo *PkgUpdateOne) SetNillableStatus(ts *types.PackageStatus) *PkgUpdateOne
SetNillableStatus sets the "status" field if the given value is not nil.
func (*PkgUpdateOne) SetObjectKey ¶
func (puo *PkgUpdateOne) SetObjectKey(u uuid.UUID) *PkgUpdateOne
SetObjectKey sets the "object_key" field.
func (*PkgUpdateOne) SetStatus ¶
func (puo *PkgUpdateOne) SetStatus(ts types.PackageStatus) *PkgUpdateOne
SetStatus sets the "status" 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 TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Location is the client for interacting with the Location builders. Location *LocationClient // Pkg is the client for interacting with the Pkg builders. Pkg *PkgClient // 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.