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 LatestVersion
- func (lv *LatestVersion) QueryResource() *ResourceQuery
- func (lv *LatestVersion) QueryVersion() *VersionQuery
- func (lv *LatestVersion) String() string
- func (lv *LatestVersion) Unwrap() *LatestVersion
- func (lv *LatestVersion) Update() *LatestVersionUpdateOne
- func (lv *LatestVersion) Value(name string) (ent.Value, error)
- type LatestVersionClient
- func (c *LatestVersionClient) Create() *LatestVersionCreate
- func (c *LatestVersionClient) CreateBulk(builders ...*LatestVersionCreate) *LatestVersionCreateBulk
- func (c *LatestVersionClient) Delete() *LatestVersionDelete
- func (c *LatestVersionClient) DeleteOne(lv *LatestVersion) *LatestVersionDeleteOne
- func (c *LatestVersionClient) DeleteOneID(id int) *LatestVersionDeleteOne
- func (c *LatestVersionClient) Get(ctx context.Context, id int) (*LatestVersion, error)
- func (c *LatestVersionClient) GetX(ctx context.Context, id int) *LatestVersion
- func (c *LatestVersionClient) Hooks() []Hook
- func (c *LatestVersionClient) Intercept(interceptors ...Interceptor)
- func (c *LatestVersionClient) Interceptors() []Interceptor
- func (c *LatestVersionClient) MapCreateBulk(slice any, setFunc func(*LatestVersionCreate, int)) *LatestVersionCreateBulk
- func (c *LatestVersionClient) Query() *LatestVersionQuery
- func (c *LatestVersionClient) QueryResource(lv *LatestVersion) *ResourceQuery
- func (c *LatestVersionClient) QueryVersion(lv *LatestVersion) *VersionQuery
- func (c *LatestVersionClient) Update() *LatestVersionUpdate
- func (c *LatestVersionClient) UpdateOne(lv *LatestVersion) *LatestVersionUpdateOne
- func (c *LatestVersionClient) UpdateOneID(id int) *LatestVersionUpdateOne
- func (c *LatestVersionClient) Use(hooks ...Hook)
- type LatestVersionCreate
- func (lvc *LatestVersionCreate) Exec(ctx context.Context) error
- func (lvc *LatestVersionCreate) ExecX(ctx context.Context)
- func (lvc *LatestVersionCreate) Mutation() *LatestVersionMutation
- func (lvc *LatestVersionCreate) OnConflict(opts ...sql.ConflictOption) *LatestVersionUpsertOne
- func (lvc *LatestVersionCreate) OnConflictColumns(columns ...string) *LatestVersionUpsertOne
- func (lvc *LatestVersionCreate) Save(ctx context.Context) (*LatestVersion, error)
- func (lvc *LatestVersionCreate) SaveX(ctx context.Context) *LatestVersion
- func (lvc *LatestVersionCreate) SetChannel(l latestversion.Channel) *LatestVersionCreate
- func (lvc *LatestVersionCreate) SetNillableChannel(l *latestversion.Channel) *LatestVersionCreate
- func (lvc *LatestVersionCreate) SetNillableUpdatedAt(t *time.Time) *LatestVersionCreate
- func (lvc *LatestVersionCreate) SetResource(r *Resource) *LatestVersionCreate
- func (lvc *LatestVersionCreate) SetResourceID(id string) *LatestVersionCreate
- func (lvc *LatestVersionCreate) SetUpdatedAt(t time.Time) *LatestVersionCreate
- func (lvc *LatestVersionCreate) SetVersion(v *Version) *LatestVersionCreate
- func (lvc *LatestVersionCreate) SetVersionID(id int) *LatestVersionCreate
- type LatestVersionCreateBulk
- func (lvcb *LatestVersionCreateBulk) Exec(ctx context.Context) error
- func (lvcb *LatestVersionCreateBulk) ExecX(ctx context.Context)
- func (lvcb *LatestVersionCreateBulk) OnConflict(opts ...sql.ConflictOption) *LatestVersionUpsertBulk
- func (lvcb *LatestVersionCreateBulk) OnConflictColumns(columns ...string) *LatestVersionUpsertBulk
- func (lvcb *LatestVersionCreateBulk) Save(ctx context.Context) ([]*LatestVersion, error)
- func (lvcb *LatestVersionCreateBulk) SaveX(ctx context.Context) []*LatestVersion
- type LatestVersionDelete
- type LatestVersionDeleteOne
- type LatestVersionEdges
- type LatestVersionGroupBy
- func (lvgb *LatestVersionGroupBy) Aggregate(fns ...AggregateFunc) *LatestVersionGroupBy
- func (s *LatestVersionGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *LatestVersionGroupBy) BoolX(ctx context.Context) bool
- func (s *LatestVersionGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *LatestVersionGroupBy) BoolsX(ctx context.Context) []bool
- func (s *LatestVersionGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *LatestVersionGroupBy) Float64X(ctx context.Context) float64
- func (s *LatestVersionGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *LatestVersionGroupBy) Float64sX(ctx context.Context) []float64
- func (s *LatestVersionGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *LatestVersionGroupBy) IntX(ctx context.Context) int
- func (s *LatestVersionGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *LatestVersionGroupBy) IntsX(ctx context.Context) []int
- func (lvgb *LatestVersionGroupBy) Scan(ctx context.Context, v any) error
- func (s *LatestVersionGroupBy) ScanX(ctx context.Context, v any)
- func (s *LatestVersionGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *LatestVersionGroupBy) StringX(ctx context.Context) string
- func (s *LatestVersionGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *LatestVersionGroupBy) StringsX(ctx context.Context) []string
- type LatestVersionMutation
- func (m *LatestVersionMutation) AddField(name string, value ent.Value) error
- func (m *LatestVersionMutation) AddedEdges() []string
- func (m *LatestVersionMutation) AddedField(name string) (ent.Value, bool)
- func (m *LatestVersionMutation) AddedFields() []string
- func (m *LatestVersionMutation) AddedIDs(name string) []ent.Value
- func (m *LatestVersionMutation) Channel() (r latestversion.Channel, exists bool)
- func (m *LatestVersionMutation) ClearEdge(name string) error
- func (m *LatestVersionMutation) ClearField(name string) error
- func (m *LatestVersionMutation) ClearResource()
- func (m *LatestVersionMutation) ClearVersion()
- func (m *LatestVersionMutation) ClearedEdges() []string
- func (m *LatestVersionMutation) ClearedFields() []string
- func (m LatestVersionMutation) Client() *Client
- func (m *LatestVersionMutation) EdgeCleared(name string) bool
- func (m *LatestVersionMutation) Field(name string) (ent.Value, bool)
- func (m *LatestVersionMutation) FieldCleared(name string) bool
- func (m *LatestVersionMutation) Fields() []string
- func (m *LatestVersionMutation) ID() (id int, exists bool)
- func (m *LatestVersionMutation) IDs(ctx context.Context) ([]int, error)
- func (m *LatestVersionMutation) OldChannel(ctx context.Context) (v latestversion.Channel, err error)
- func (m *LatestVersionMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *LatestVersionMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *LatestVersionMutation) Op() Op
- func (m *LatestVersionMutation) RemovedEdges() []string
- func (m *LatestVersionMutation) RemovedIDs(name string) []ent.Value
- func (m *LatestVersionMutation) ResetChannel()
- func (m *LatestVersionMutation) ResetEdge(name string) error
- func (m *LatestVersionMutation) ResetField(name string) error
- func (m *LatestVersionMutation) ResetResource()
- func (m *LatestVersionMutation) ResetUpdatedAt()
- func (m *LatestVersionMutation) ResetVersion()
- func (m *LatestVersionMutation) ResourceCleared() bool
- func (m *LatestVersionMutation) ResourceID() (id string, exists bool)
- func (m *LatestVersionMutation) ResourceIDs() (ids []string)
- func (m *LatestVersionMutation) SetChannel(l latestversion.Channel)
- func (m *LatestVersionMutation) SetField(name string, value ent.Value) error
- func (m *LatestVersionMutation) SetOp(op Op)
- func (m *LatestVersionMutation) SetResourceID(id string)
- func (m *LatestVersionMutation) SetUpdatedAt(t time.Time)
- func (m *LatestVersionMutation) SetVersionID(id int)
- func (m LatestVersionMutation) Tx() (*Tx, error)
- func (m *LatestVersionMutation) Type() string
- func (m *LatestVersionMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *LatestVersionMutation) VersionCleared() bool
- func (m *LatestVersionMutation) VersionID() (id int, exists bool)
- func (m *LatestVersionMutation) VersionIDs() (ids []int)
- func (m *LatestVersionMutation) Where(ps ...predicate.LatestVersion)
- func (m *LatestVersionMutation) WhereP(ps ...func(*sql.Selector))
- type LatestVersionQuery
- func (lvq *LatestVersionQuery) Aggregate(fns ...AggregateFunc) *LatestVersionSelect
- func (lvq *LatestVersionQuery) All(ctx context.Context) ([]*LatestVersion, error)
- func (lvq *LatestVersionQuery) AllX(ctx context.Context) []*LatestVersion
- func (lvq *LatestVersionQuery) Clone() *LatestVersionQuery
- func (lvq *LatestVersionQuery) Count(ctx context.Context) (int, error)
- func (lvq *LatestVersionQuery) CountX(ctx context.Context) int
- func (lvq *LatestVersionQuery) Exist(ctx context.Context) (bool, error)
- func (lvq *LatestVersionQuery) ExistX(ctx context.Context) bool
- func (lvq *LatestVersionQuery) First(ctx context.Context) (*LatestVersion, error)
- func (lvq *LatestVersionQuery) FirstID(ctx context.Context) (id int, err error)
- func (lvq *LatestVersionQuery) FirstIDX(ctx context.Context) int
- func (lvq *LatestVersionQuery) FirstX(ctx context.Context) *LatestVersion
- func (lvq *LatestVersionQuery) GroupBy(field string, fields ...string) *LatestVersionGroupBy
- func (lvq *LatestVersionQuery) IDs(ctx context.Context) (ids []int, err error)
- func (lvq *LatestVersionQuery) IDsX(ctx context.Context) []int
- func (lvq *LatestVersionQuery) Limit(limit int) *LatestVersionQuery
- func (lvq *LatestVersionQuery) Offset(offset int) *LatestVersionQuery
- func (lvq *LatestVersionQuery) Only(ctx context.Context) (*LatestVersion, error)
- func (lvq *LatestVersionQuery) OnlyID(ctx context.Context) (id int, err error)
- func (lvq *LatestVersionQuery) OnlyIDX(ctx context.Context) int
- func (lvq *LatestVersionQuery) OnlyX(ctx context.Context) *LatestVersion
- func (lvq *LatestVersionQuery) Order(o ...latestversion.OrderOption) *LatestVersionQuery
- func (lvq *LatestVersionQuery) QueryResource() *ResourceQuery
- func (lvq *LatestVersionQuery) QueryVersion() *VersionQuery
- func (lvq *LatestVersionQuery) Select(fields ...string) *LatestVersionSelect
- func (lvq *LatestVersionQuery) Unique(unique bool) *LatestVersionQuery
- func (lvq *LatestVersionQuery) Where(ps ...predicate.LatestVersion) *LatestVersionQuery
- func (lvq *LatestVersionQuery) WithResource(opts ...func(*ResourceQuery)) *LatestVersionQuery
- func (lvq *LatestVersionQuery) WithVersion(opts ...func(*VersionQuery)) *LatestVersionQuery
- type LatestVersionSelect
- func (lvs *LatestVersionSelect) Aggregate(fns ...AggregateFunc) *LatestVersionSelect
- func (s *LatestVersionSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *LatestVersionSelect) BoolX(ctx context.Context) bool
- func (s *LatestVersionSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *LatestVersionSelect) BoolsX(ctx context.Context) []bool
- func (s *LatestVersionSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *LatestVersionSelect) Float64X(ctx context.Context) float64
- func (s *LatestVersionSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *LatestVersionSelect) Float64sX(ctx context.Context) []float64
- func (s *LatestVersionSelect) Int(ctx context.Context) (_ int, err error)
- func (s *LatestVersionSelect) IntX(ctx context.Context) int
- func (s *LatestVersionSelect) Ints(ctx context.Context) ([]int, error)
- func (s *LatestVersionSelect) IntsX(ctx context.Context) []int
- func (lvs *LatestVersionSelect) Scan(ctx context.Context, v any) error
- func (s *LatestVersionSelect) ScanX(ctx context.Context, v any)
- func (s *LatestVersionSelect) String(ctx context.Context) (_ string, err error)
- func (s *LatestVersionSelect) StringX(ctx context.Context) string
- func (s *LatestVersionSelect) Strings(ctx context.Context) ([]string, error)
- func (s *LatestVersionSelect) StringsX(ctx context.Context) []string
- type LatestVersionUpdate
- func (lvu *LatestVersionUpdate) ClearResource() *LatestVersionUpdate
- func (lvu *LatestVersionUpdate) ClearVersion() *LatestVersionUpdate
- func (lvu *LatestVersionUpdate) Exec(ctx context.Context) error
- func (lvu *LatestVersionUpdate) ExecX(ctx context.Context)
- func (lvu *LatestVersionUpdate) Mutation() *LatestVersionMutation
- func (lvu *LatestVersionUpdate) Save(ctx context.Context) (int, error)
- func (lvu *LatestVersionUpdate) SaveX(ctx context.Context) int
- func (lvu *LatestVersionUpdate) SetChannel(l latestversion.Channel) *LatestVersionUpdate
- func (lvu *LatestVersionUpdate) SetNillableChannel(l *latestversion.Channel) *LatestVersionUpdate
- func (lvu *LatestVersionUpdate) SetResource(r *Resource) *LatestVersionUpdate
- func (lvu *LatestVersionUpdate) SetResourceID(id string) *LatestVersionUpdate
- func (lvu *LatestVersionUpdate) SetUpdatedAt(t time.Time) *LatestVersionUpdate
- func (lvu *LatestVersionUpdate) SetVersion(v *Version) *LatestVersionUpdate
- func (lvu *LatestVersionUpdate) SetVersionID(id int) *LatestVersionUpdate
- func (lvu *LatestVersionUpdate) Where(ps ...predicate.LatestVersion) *LatestVersionUpdate
- type LatestVersionUpdateOne
- func (lvuo *LatestVersionUpdateOne) ClearResource() *LatestVersionUpdateOne
- func (lvuo *LatestVersionUpdateOne) ClearVersion() *LatestVersionUpdateOne
- func (lvuo *LatestVersionUpdateOne) Exec(ctx context.Context) error
- func (lvuo *LatestVersionUpdateOne) ExecX(ctx context.Context)
- func (lvuo *LatestVersionUpdateOne) Mutation() *LatestVersionMutation
- func (lvuo *LatestVersionUpdateOne) Save(ctx context.Context) (*LatestVersion, error)
- func (lvuo *LatestVersionUpdateOne) SaveX(ctx context.Context) *LatestVersion
- func (lvuo *LatestVersionUpdateOne) Select(field string, fields ...string) *LatestVersionUpdateOne
- func (lvuo *LatestVersionUpdateOne) SetChannel(l latestversion.Channel) *LatestVersionUpdateOne
- func (lvuo *LatestVersionUpdateOne) SetNillableChannel(l *latestversion.Channel) *LatestVersionUpdateOne
- func (lvuo *LatestVersionUpdateOne) SetResource(r *Resource) *LatestVersionUpdateOne
- func (lvuo *LatestVersionUpdateOne) SetResourceID(id string) *LatestVersionUpdateOne
- func (lvuo *LatestVersionUpdateOne) SetUpdatedAt(t time.Time) *LatestVersionUpdateOne
- func (lvuo *LatestVersionUpdateOne) SetVersion(v *Version) *LatestVersionUpdateOne
- func (lvuo *LatestVersionUpdateOne) SetVersionID(id int) *LatestVersionUpdateOne
- func (lvuo *LatestVersionUpdateOne) Where(ps ...predicate.LatestVersion) *LatestVersionUpdateOne
- type LatestVersionUpsert
- type LatestVersionUpsertBulk
- func (u *LatestVersionUpsertBulk) DoNothing() *LatestVersionUpsertBulk
- func (u *LatestVersionUpsertBulk) Exec(ctx context.Context) error
- func (u *LatestVersionUpsertBulk) ExecX(ctx context.Context)
- func (u *LatestVersionUpsertBulk) Ignore() *LatestVersionUpsertBulk
- func (u *LatestVersionUpsertBulk) SetChannel(v latestversion.Channel) *LatestVersionUpsertBulk
- func (u *LatestVersionUpsertBulk) SetUpdatedAt(v time.Time) *LatestVersionUpsertBulk
- func (u *LatestVersionUpsertBulk) Update(set func(*LatestVersionUpsert)) *LatestVersionUpsertBulk
- func (u *LatestVersionUpsertBulk) UpdateChannel() *LatestVersionUpsertBulk
- func (u *LatestVersionUpsertBulk) UpdateNewValues() *LatestVersionUpsertBulk
- func (u *LatestVersionUpsertBulk) UpdateUpdatedAt() *LatestVersionUpsertBulk
- type LatestVersionUpsertOne
- func (u *LatestVersionUpsertOne) DoNothing() *LatestVersionUpsertOne
- func (u *LatestVersionUpsertOne) Exec(ctx context.Context) error
- func (u *LatestVersionUpsertOne) ExecX(ctx context.Context)
- func (u *LatestVersionUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *LatestVersionUpsertOne) IDX(ctx context.Context) int
- func (u *LatestVersionUpsertOne) Ignore() *LatestVersionUpsertOne
- func (u *LatestVersionUpsertOne) SetChannel(v latestversion.Channel) *LatestVersionUpsertOne
- func (u *LatestVersionUpsertOne) SetUpdatedAt(v time.Time) *LatestVersionUpsertOne
- func (u *LatestVersionUpsertOne) Update(set func(*LatestVersionUpsert)) *LatestVersionUpsertOne
- func (u *LatestVersionUpsertOne) UpdateChannel() *LatestVersionUpsertOne
- func (u *LatestVersionUpsertOne) UpdateNewValues() *LatestVersionUpsertOne
- func (u *LatestVersionUpsertOne) UpdateUpdatedAt() *LatestVersionUpsertOne
- type LatestVersions
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type Resource
- type ResourceClient
- func (c *ResourceClient) Create() *ResourceCreate
- func (c *ResourceClient) CreateBulk(builders ...*ResourceCreate) *ResourceCreateBulk
- func (c *ResourceClient) Delete() *ResourceDelete
- func (c *ResourceClient) DeleteOne(r *Resource) *ResourceDeleteOne
- func (c *ResourceClient) DeleteOneID(id string) *ResourceDeleteOne
- func (c *ResourceClient) Get(ctx context.Context, id string) (*Resource, error)
- func (c *ResourceClient) GetX(ctx context.Context, id string) *Resource
- func (c *ResourceClient) Hooks() []Hook
- func (c *ResourceClient) Intercept(interceptors ...Interceptor)
- func (c *ResourceClient) Interceptors() []Interceptor
- func (c *ResourceClient) MapCreateBulk(slice any, setFunc func(*ResourceCreate, int)) *ResourceCreateBulk
- func (c *ResourceClient) Query() *ResourceQuery
- func (c *ResourceClient) QueryLatestVersions(r *Resource) *LatestVersionQuery
- func (c *ResourceClient) QueryVersions(r *Resource) *VersionQuery
- func (c *ResourceClient) Update() *ResourceUpdate
- func (c *ResourceClient) UpdateOne(r *Resource) *ResourceUpdateOne
- func (c *ResourceClient) UpdateOneID(id string) *ResourceUpdateOne
- func (c *ResourceClient) Use(hooks ...Hook)
- type ResourceCreate
- func (rc *ResourceCreate) AddLatestVersionIDs(ids ...int) *ResourceCreate
- func (rc *ResourceCreate) AddLatestVersions(l ...*LatestVersion) *ResourceCreate
- func (rc *ResourceCreate) AddVersionIDs(ids ...int) *ResourceCreate
- func (rc *ResourceCreate) AddVersions(v ...*Version) *ResourceCreate
- func (rc *ResourceCreate) Exec(ctx context.Context) error
- func (rc *ResourceCreate) ExecX(ctx context.Context)
- func (rc *ResourceCreate) Mutation() *ResourceMutation
- func (rc *ResourceCreate) OnConflict(opts ...sql.ConflictOption) *ResourceUpsertOne
- func (rc *ResourceCreate) OnConflictColumns(columns ...string) *ResourceUpsertOne
- func (rc *ResourceCreate) Save(ctx context.Context) (*Resource, error)
- func (rc *ResourceCreate) SaveX(ctx context.Context) *Resource
- func (rc *ResourceCreate) SetCreatedAt(t time.Time) *ResourceCreate
- func (rc *ResourceCreate) SetDescription(s string) *ResourceCreate
- func (rc *ResourceCreate) SetID(s string) *ResourceCreate
- func (rc *ResourceCreate) SetName(s string) *ResourceCreate
- func (rc *ResourceCreate) SetNillableCreatedAt(t *time.Time) *ResourceCreate
- type ResourceCreateBulk
- func (rcb *ResourceCreateBulk) Exec(ctx context.Context) error
- func (rcb *ResourceCreateBulk) ExecX(ctx context.Context)
- func (rcb *ResourceCreateBulk) OnConflict(opts ...sql.ConflictOption) *ResourceUpsertBulk
- func (rcb *ResourceCreateBulk) OnConflictColumns(columns ...string) *ResourceUpsertBulk
- func (rcb *ResourceCreateBulk) Save(ctx context.Context) ([]*Resource, error)
- func (rcb *ResourceCreateBulk) SaveX(ctx context.Context) []*Resource
- type ResourceDelete
- type ResourceDeleteOne
- type ResourceEdges
- type ResourceGroupBy
- func (rgb *ResourceGroupBy) Aggregate(fns ...AggregateFunc) *ResourceGroupBy
- func (s *ResourceGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ResourceGroupBy) BoolX(ctx context.Context) bool
- func (s *ResourceGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ResourceGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ResourceGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ResourceGroupBy) Float64X(ctx context.Context) float64
- func (s *ResourceGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ResourceGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ResourceGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ResourceGroupBy) IntX(ctx context.Context) int
- func (s *ResourceGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ResourceGroupBy) IntsX(ctx context.Context) []int
- func (rgb *ResourceGroupBy) Scan(ctx context.Context, v any) error
- func (s *ResourceGroupBy) ScanX(ctx context.Context, v any)
- func (s *ResourceGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ResourceGroupBy) StringX(ctx context.Context) string
- func (s *ResourceGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ResourceGroupBy) StringsX(ctx context.Context) []string
- type ResourceMutation
- func (m *ResourceMutation) AddField(name string, value ent.Value) error
- func (m *ResourceMutation) AddLatestVersionIDs(ids ...int)
- func (m *ResourceMutation) AddVersionIDs(ids ...int)
- func (m *ResourceMutation) AddedEdges() []string
- func (m *ResourceMutation) AddedField(name string) (ent.Value, bool)
- func (m *ResourceMutation) AddedFields() []string
- func (m *ResourceMutation) AddedIDs(name string) []ent.Value
- func (m *ResourceMutation) ClearEdge(name string) error
- func (m *ResourceMutation) ClearField(name string) error
- func (m *ResourceMutation) ClearLatestVersions()
- func (m *ResourceMutation) ClearVersions()
- func (m *ResourceMutation) ClearedEdges() []string
- func (m *ResourceMutation) ClearedFields() []string
- func (m ResourceMutation) Client() *Client
- func (m *ResourceMutation) CreatedAt() (r time.Time, exists bool)
- func (m *ResourceMutation) Description() (r string, exists bool)
- func (m *ResourceMutation) EdgeCleared(name string) bool
- func (m *ResourceMutation) Field(name string) (ent.Value, bool)
- func (m *ResourceMutation) FieldCleared(name string) bool
- func (m *ResourceMutation) Fields() []string
- func (m *ResourceMutation) ID() (id string, exists bool)
- func (m *ResourceMutation) IDs(ctx context.Context) ([]string, error)
- func (m *ResourceMutation) LatestVersionsCleared() bool
- func (m *ResourceMutation) LatestVersionsIDs() (ids []int)
- func (m *ResourceMutation) Name() (r string, exists bool)
- func (m *ResourceMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ResourceMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *ResourceMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ResourceMutation) OldName(ctx context.Context) (v string, err error)
- func (m *ResourceMutation) Op() Op
- func (m *ResourceMutation) RemoveLatestVersionIDs(ids ...int)
- func (m *ResourceMutation) RemoveVersionIDs(ids ...int)
- func (m *ResourceMutation) RemovedEdges() []string
- func (m *ResourceMutation) RemovedIDs(name string) []ent.Value
- func (m *ResourceMutation) RemovedLatestVersionsIDs() (ids []int)
- func (m *ResourceMutation) RemovedVersionsIDs() (ids []int)
- func (m *ResourceMutation) ResetCreatedAt()
- func (m *ResourceMutation) ResetDescription()
- func (m *ResourceMutation) ResetEdge(name string) error
- func (m *ResourceMutation) ResetField(name string) error
- func (m *ResourceMutation) ResetLatestVersions()
- func (m *ResourceMutation) ResetName()
- func (m *ResourceMutation) ResetVersions()
- func (m *ResourceMutation) SetCreatedAt(t time.Time)
- func (m *ResourceMutation) SetDescription(s string)
- func (m *ResourceMutation) SetField(name string, value ent.Value) error
- func (m *ResourceMutation) SetID(id string)
- func (m *ResourceMutation) SetName(s string)
- func (m *ResourceMutation) SetOp(op Op)
- func (m ResourceMutation) Tx() (*Tx, error)
- func (m *ResourceMutation) Type() string
- func (m *ResourceMutation) VersionsCleared() bool
- func (m *ResourceMutation) VersionsIDs() (ids []int)
- func (m *ResourceMutation) Where(ps ...predicate.Resource)
- func (m *ResourceMutation) WhereP(ps ...func(*sql.Selector))
- type ResourceQuery
- func (rq *ResourceQuery) Aggregate(fns ...AggregateFunc) *ResourceSelect
- func (rq *ResourceQuery) All(ctx context.Context) ([]*Resource, error)
- func (rq *ResourceQuery) AllX(ctx context.Context) []*Resource
- func (rq *ResourceQuery) Clone() *ResourceQuery
- func (rq *ResourceQuery) Count(ctx context.Context) (int, error)
- func (rq *ResourceQuery) CountX(ctx context.Context) int
- func (rq *ResourceQuery) Exist(ctx context.Context) (bool, error)
- func (rq *ResourceQuery) ExistX(ctx context.Context) bool
- func (rq *ResourceQuery) First(ctx context.Context) (*Resource, error)
- func (rq *ResourceQuery) FirstID(ctx context.Context) (id string, err error)
- func (rq *ResourceQuery) FirstIDX(ctx context.Context) string
- func (rq *ResourceQuery) FirstX(ctx context.Context) *Resource
- func (rq *ResourceQuery) GroupBy(field string, fields ...string) *ResourceGroupBy
- func (rq *ResourceQuery) IDs(ctx context.Context) (ids []string, err error)
- func (rq *ResourceQuery) IDsX(ctx context.Context) []string
- func (rq *ResourceQuery) Limit(limit int) *ResourceQuery
- func (rq *ResourceQuery) Offset(offset int) *ResourceQuery
- func (rq *ResourceQuery) Only(ctx context.Context) (*Resource, error)
- func (rq *ResourceQuery) OnlyID(ctx context.Context) (id string, err error)
- func (rq *ResourceQuery) OnlyIDX(ctx context.Context) string
- func (rq *ResourceQuery) OnlyX(ctx context.Context) *Resource
- func (rq *ResourceQuery) Order(o ...resource.OrderOption) *ResourceQuery
- func (rq *ResourceQuery) QueryLatestVersions() *LatestVersionQuery
- func (rq *ResourceQuery) QueryVersions() *VersionQuery
- func (rq *ResourceQuery) Select(fields ...string) *ResourceSelect
- func (rq *ResourceQuery) Unique(unique bool) *ResourceQuery
- func (rq *ResourceQuery) Where(ps ...predicate.Resource) *ResourceQuery
- func (rq *ResourceQuery) WithLatestVersions(opts ...func(*LatestVersionQuery)) *ResourceQuery
- func (rq *ResourceQuery) WithVersions(opts ...func(*VersionQuery)) *ResourceQuery
- type ResourceSelect
- func (rs *ResourceSelect) Aggregate(fns ...AggregateFunc) *ResourceSelect
- func (s *ResourceSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ResourceSelect) BoolX(ctx context.Context) bool
- func (s *ResourceSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ResourceSelect) BoolsX(ctx context.Context) []bool
- func (s *ResourceSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ResourceSelect) Float64X(ctx context.Context) float64
- func (s *ResourceSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ResourceSelect) Float64sX(ctx context.Context) []float64
- func (s *ResourceSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ResourceSelect) IntX(ctx context.Context) int
- func (s *ResourceSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ResourceSelect) IntsX(ctx context.Context) []int
- func (rs *ResourceSelect) Scan(ctx context.Context, v any) error
- func (s *ResourceSelect) ScanX(ctx context.Context, v any)
- func (s *ResourceSelect) String(ctx context.Context) (_ string, err error)
- func (s *ResourceSelect) StringX(ctx context.Context) string
- func (s *ResourceSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ResourceSelect) StringsX(ctx context.Context) []string
- type ResourceUpdate
- func (ru *ResourceUpdate) AddLatestVersionIDs(ids ...int) *ResourceUpdate
- func (ru *ResourceUpdate) AddLatestVersions(l ...*LatestVersion) *ResourceUpdate
- func (ru *ResourceUpdate) AddVersionIDs(ids ...int) *ResourceUpdate
- func (ru *ResourceUpdate) AddVersions(v ...*Version) *ResourceUpdate
- func (ru *ResourceUpdate) ClearLatestVersions() *ResourceUpdate
- func (ru *ResourceUpdate) ClearVersions() *ResourceUpdate
- func (ru *ResourceUpdate) Exec(ctx context.Context) error
- func (ru *ResourceUpdate) ExecX(ctx context.Context)
- func (ru *ResourceUpdate) Mutation() *ResourceMutation
- func (ru *ResourceUpdate) RemoveLatestVersionIDs(ids ...int) *ResourceUpdate
- func (ru *ResourceUpdate) RemoveLatestVersions(l ...*LatestVersion) *ResourceUpdate
- func (ru *ResourceUpdate) RemoveVersionIDs(ids ...int) *ResourceUpdate
- func (ru *ResourceUpdate) RemoveVersions(v ...*Version) *ResourceUpdate
- func (ru *ResourceUpdate) Save(ctx context.Context) (int, error)
- func (ru *ResourceUpdate) SaveX(ctx context.Context) int
- func (ru *ResourceUpdate) SetCreatedAt(t time.Time) *ResourceUpdate
- func (ru *ResourceUpdate) SetDescription(s string) *ResourceUpdate
- func (ru *ResourceUpdate) SetName(s string) *ResourceUpdate
- func (ru *ResourceUpdate) SetNillableCreatedAt(t *time.Time) *ResourceUpdate
- func (ru *ResourceUpdate) SetNillableDescription(s *string) *ResourceUpdate
- func (ru *ResourceUpdate) SetNillableName(s *string) *ResourceUpdate
- func (ru *ResourceUpdate) Where(ps ...predicate.Resource) *ResourceUpdate
- type ResourceUpdateOne
- func (ruo *ResourceUpdateOne) AddLatestVersionIDs(ids ...int) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) AddLatestVersions(l ...*LatestVersion) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) AddVersionIDs(ids ...int) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) AddVersions(v ...*Version) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) ClearLatestVersions() *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) ClearVersions() *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) Exec(ctx context.Context) error
- func (ruo *ResourceUpdateOne) ExecX(ctx context.Context)
- func (ruo *ResourceUpdateOne) Mutation() *ResourceMutation
- func (ruo *ResourceUpdateOne) RemoveLatestVersionIDs(ids ...int) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) RemoveLatestVersions(l ...*LatestVersion) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) RemoveVersionIDs(ids ...int) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) RemoveVersions(v ...*Version) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) Save(ctx context.Context) (*Resource, error)
- func (ruo *ResourceUpdateOne) SaveX(ctx context.Context) *Resource
- func (ruo *ResourceUpdateOne) Select(field string, fields ...string) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) SetCreatedAt(t time.Time) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) SetDescription(s string) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) SetName(s string) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) SetNillableCreatedAt(t *time.Time) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) SetNillableDescription(s *string) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) SetNillableName(s *string) *ResourceUpdateOne
- func (ruo *ResourceUpdateOne) Where(ps ...predicate.Resource) *ResourceUpdateOne
- type ResourceUpsert
- func (u *ResourceUpsert) SetCreatedAt(v time.Time) *ResourceUpsert
- func (u *ResourceUpsert) SetDescription(v string) *ResourceUpsert
- func (u *ResourceUpsert) SetName(v string) *ResourceUpsert
- func (u *ResourceUpsert) UpdateCreatedAt() *ResourceUpsert
- func (u *ResourceUpsert) UpdateDescription() *ResourceUpsert
- func (u *ResourceUpsert) UpdateName() *ResourceUpsert
- type ResourceUpsertBulk
- func (u *ResourceUpsertBulk) DoNothing() *ResourceUpsertBulk
- func (u *ResourceUpsertBulk) Exec(ctx context.Context) error
- func (u *ResourceUpsertBulk) ExecX(ctx context.Context)
- func (u *ResourceUpsertBulk) Ignore() *ResourceUpsertBulk
- func (u *ResourceUpsertBulk) SetCreatedAt(v time.Time) *ResourceUpsertBulk
- func (u *ResourceUpsertBulk) SetDescription(v string) *ResourceUpsertBulk
- func (u *ResourceUpsertBulk) SetName(v string) *ResourceUpsertBulk
- func (u *ResourceUpsertBulk) Update(set func(*ResourceUpsert)) *ResourceUpsertBulk
- func (u *ResourceUpsertBulk) UpdateCreatedAt() *ResourceUpsertBulk
- func (u *ResourceUpsertBulk) UpdateDescription() *ResourceUpsertBulk
- func (u *ResourceUpsertBulk) UpdateName() *ResourceUpsertBulk
- func (u *ResourceUpsertBulk) UpdateNewValues() *ResourceUpsertBulk
- type ResourceUpsertOne
- func (u *ResourceUpsertOne) DoNothing() *ResourceUpsertOne
- func (u *ResourceUpsertOne) Exec(ctx context.Context) error
- func (u *ResourceUpsertOne) ExecX(ctx context.Context)
- func (u *ResourceUpsertOne) ID(ctx context.Context) (id string, err error)
- func (u *ResourceUpsertOne) IDX(ctx context.Context) string
- func (u *ResourceUpsertOne) Ignore() *ResourceUpsertOne
- func (u *ResourceUpsertOne) SetCreatedAt(v time.Time) *ResourceUpsertOne
- func (u *ResourceUpsertOne) SetDescription(v string) *ResourceUpsertOne
- func (u *ResourceUpsertOne) SetName(v string) *ResourceUpsertOne
- func (u *ResourceUpsertOne) Update(set func(*ResourceUpsert)) *ResourceUpsertOne
- func (u *ResourceUpsertOne) UpdateCreatedAt() *ResourceUpsertOne
- func (u *ResourceUpsertOne) UpdateDescription() *ResourceUpsertOne
- func (u *ResourceUpsertOne) UpdateName() *ResourceUpsertOne
- func (u *ResourceUpsertOne) UpdateNewValues() *ResourceUpsertOne
- type Resources
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Storage
- type StorageClient
- func (c *StorageClient) Create() *StorageCreate
- func (c *StorageClient) CreateBulk(builders ...*StorageCreate) *StorageCreateBulk
- func (c *StorageClient) Delete() *StorageDelete
- func (c *StorageClient) DeleteOne(s *Storage) *StorageDeleteOne
- func (c *StorageClient) DeleteOneID(id int) *StorageDeleteOne
- func (c *StorageClient) Get(ctx context.Context, id int) (*Storage, error)
- func (c *StorageClient) GetX(ctx context.Context, id int) *Storage
- func (c *StorageClient) Hooks() []Hook
- func (c *StorageClient) Intercept(interceptors ...Interceptor)
- func (c *StorageClient) Interceptors() []Interceptor
- func (c *StorageClient) MapCreateBulk(slice any, setFunc func(*StorageCreate, int)) *StorageCreateBulk
- func (c *StorageClient) Query() *StorageQuery
- func (c *StorageClient) QueryOldVersion(s *Storage) *VersionQuery
- func (c *StorageClient) QueryVersion(s *Storage) *VersionQuery
- func (c *StorageClient) Update() *StorageUpdate
- func (c *StorageClient) UpdateOne(s *Storage) *StorageUpdateOne
- func (c *StorageClient) UpdateOneID(id int) *StorageUpdateOne
- func (c *StorageClient) Use(hooks ...Hook)
- type StorageCreate
- func (sc *StorageCreate) Exec(ctx context.Context) error
- func (sc *StorageCreate) ExecX(ctx context.Context)
- func (sc *StorageCreate) Mutation() *StorageMutation
- func (sc *StorageCreate) OnConflict(opts ...sql.ConflictOption) *StorageUpsertOne
- func (sc *StorageCreate) OnConflictColumns(columns ...string) *StorageUpsertOne
- func (sc *StorageCreate) Save(ctx context.Context) (*Storage, error)
- func (sc *StorageCreate) SaveX(ctx context.Context) *Storage
- func (sc *StorageCreate) SetArch(s string) *StorageCreate
- func (sc *StorageCreate) SetCreatedAt(t time.Time) *StorageCreate
- func (sc *StorageCreate) SetFileHashes(m map[string]string) *StorageCreate
- func (sc *StorageCreate) SetNillableArch(s *string) *StorageCreate
- func (sc *StorageCreate) SetNillableCreatedAt(t *time.Time) *StorageCreate
- func (sc *StorageCreate) SetNillableOldVersionID(id *int) *StorageCreate
- func (sc *StorageCreate) SetNillableOs(s *string) *StorageCreate
- func (sc *StorageCreate) SetNillablePackagePath(s *string) *StorageCreate
- func (sc *StorageCreate) SetNillableResourcePath(s *string) *StorageCreate
- func (sc *StorageCreate) SetOldVersion(v *Version) *StorageCreate
- func (sc *StorageCreate) SetOldVersionID(id int) *StorageCreate
- func (sc *StorageCreate) SetOs(s string) *StorageCreate
- func (sc *StorageCreate) SetPackagePath(s string) *StorageCreate
- func (sc *StorageCreate) SetResourcePath(s string) *StorageCreate
- func (sc *StorageCreate) SetUpdateType(st storage.UpdateType) *StorageCreate
- func (sc *StorageCreate) SetVersion(v *Version) *StorageCreate
- func (sc *StorageCreate) SetVersionID(id int) *StorageCreate
- type StorageCreateBulk
- func (scb *StorageCreateBulk) Exec(ctx context.Context) error
- func (scb *StorageCreateBulk) ExecX(ctx context.Context)
- func (scb *StorageCreateBulk) OnConflict(opts ...sql.ConflictOption) *StorageUpsertBulk
- func (scb *StorageCreateBulk) OnConflictColumns(columns ...string) *StorageUpsertBulk
- func (scb *StorageCreateBulk) Save(ctx context.Context) ([]*Storage, error)
- func (scb *StorageCreateBulk) SaveX(ctx context.Context) []*Storage
- type StorageDelete
- type StorageDeleteOne
- type StorageEdges
- type StorageGroupBy
- func (sgb *StorageGroupBy) Aggregate(fns ...AggregateFunc) *StorageGroupBy
- func (s *StorageGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *StorageGroupBy) BoolX(ctx context.Context) bool
- func (s *StorageGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *StorageGroupBy) BoolsX(ctx context.Context) []bool
- func (s *StorageGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *StorageGroupBy) Float64X(ctx context.Context) float64
- func (s *StorageGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *StorageGroupBy) Float64sX(ctx context.Context) []float64
- func (s *StorageGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *StorageGroupBy) IntX(ctx context.Context) int
- func (s *StorageGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *StorageGroupBy) IntsX(ctx context.Context) []int
- func (sgb *StorageGroupBy) Scan(ctx context.Context, v any) error
- func (s *StorageGroupBy) ScanX(ctx context.Context, v any)
- func (s *StorageGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *StorageGroupBy) StringX(ctx context.Context) string
- func (s *StorageGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *StorageGroupBy) StringsX(ctx context.Context) []string
- type StorageMutation
- func (m *StorageMutation) AddField(name string, value ent.Value) error
- func (m *StorageMutation) AddedEdges() []string
- func (m *StorageMutation) AddedField(name string) (ent.Value, bool)
- func (m *StorageMutation) AddedFields() []string
- func (m *StorageMutation) AddedIDs(name string) []ent.Value
- func (m *StorageMutation) Arch() (r string, exists bool)
- func (m *StorageMutation) ArchCleared() bool
- func (m *StorageMutation) ClearArch()
- func (m *StorageMutation) ClearEdge(name string) error
- func (m *StorageMutation) ClearField(name string) error
- func (m *StorageMutation) ClearFileHashes()
- func (m *StorageMutation) ClearOldVersion()
- func (m *StorageMutation) ClearOs()
- func (m *StorageMutation) ClearPackagePath()
- func (m *StorageMutation) ClearResourcePath()
- func (m *StorageMutation) ClearVersion()
- func (m *StorageMutation) ClearedEdges() []string
- func (m *StorageMutation) ClearedFields() []string
- func (m StorageMutation) Client() *Client
- func (m *StorageMutation) CreatedAt() (r time.Time, exists bool)
- func (m *StorageMutation) EdgeCleared(name string) bool
- func (m *StorageMutation) Field(name string) (ent.Value, bool)
- func (m *StorageMutation) FieldCleared(name string) bool
- func (m *StorageMutation) Fields() []string
- func (m *StorageMutation) FileHashes() (r map[string]string, exists bool)
- func (m *StorageMutation) FileHashesCleared() bool
- func (m *StorageMutation) ID() (id int, exists bool)
- func (m *StorageMutation) IDs(ctx context.Context) ([]int, error)
- func (m *StorageMutation) OldArch(ctx context.Context) (v string, err error)
- func (m *StorageMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *StorageMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *StorageMutation) OldFileHashes(ctx context.Context) (v map[string]string, err error)
- func (m *StorageMutation) OldOs(ctx context.Context) (v string, err error)
- func (m *StorageMutation) OldPackagePath(ctx context.Context) (v string, err error)
- func (m *StorageMutation) OldResourcePath(ctx context.Context) (v string, err error)
- func (m *StorageMutation) OldUpdateType(ctx context.Context) (v storage.UpdateType, err error)
- func (m *StorageMutation) OldVersionCleared() bool
- func (m *StorageMutation) OldVersionID() (id int, exists bool)
- func (m *StorageMutation) OldVersionIDs() (ids []int)
- func (m *StorageMutation) Op() Op
- func (m *StorageMutation) Os() (r string, exists bool)
- func (m *StorageMutation) OsCleared() bool
- func (m *StorageMutation) PackagePath() (r string, exists bool)
- func (m *StorageMutation) PackagePathCleared() bool
- func (m *StorageMutation) RemovedEdges() []string
- func (m *StorageMutation) RemovedIDs(name string) []ent.Value
- func (m *StorageMutation) ResetArch()
- func (m *StorageMutation) ResetCreatedAt()
- func (m *StorageMutation) ResetEdge(name string) error
- func (m *StorageMutation) ResetField(name string) error
- func (m *StorageMutation) ResetFileHashes()
- func (m *StorageMutation) ResetOldVersion()
- func (m *StorageMutation) ResetOs()
- func (m *StorageMutation) ResetPackagePath()
- func (m *StorageMutation) ResetResourcePath()
- func (m *StorageMutation) ResetUpdateType()
- func (m *StorageMutation) ResetVersion()
- func (m *StorageMutation) ResourcePath() (r string, exists bool)
- func (m *StorageMutation) ResourcePathCleared() bool
- func (m *StorageMutation) SetArch(s string)
- func (m *StorageMutation) SetCreatedAt(t time.Time)
- func (m *StorageMutation) SetField(name string, value ent.Value) error
- func (m *StorageMutation) SetFileHashes(value map[string]string)
- func (m *StorageMutation) SetOldVersionID(id int)
- func (m *StorageMutation) SetOp(op Op)
- func (m *StorageMutation) SetOs(s string)
- func (m *StorageMutation) SetPackagePath(s string)
- func (m *StorageMutation) SetResourcePath(s string)
- func (m *StorageMutation) SetUpdateType(st storage.UpdateType)
- func (m *StorageMutation) SetVersionID(id int)
- func (m StorageMutation) Tx() (*Tx, error)
- func (m *StorageMutation) Type() string
- func (m *StorageMutation) UpdateType() (r storage.UpdateType, exists bool)
- func (m *StorageMutation) VersionCleared() bool
- func (m *StorageMutation) VersionID() (id int, exists bool)
- func (m *StorageMutation) VersionIDs() (ids []int)
- func (m *StorageMutation) Where(ps ...predicate.Storage)
- func (m *StorageMutation) WhereP(ps ...func(*sql.Selector))
- type StorageQuery
- func (sq *StorageQuery) Aggregate(fns ...AggregateFunc) *StorageSelect
- func (sq *StorageQuery) All(ctx context.Context) ([]*Storage, error)
- func (sq *StorageQuery) AllX(ctx context.Context) []*Storage
- func (sq *StorageQuery) Clone() *StorageQuery
- func (sq *StorageQuery) Count(ctx context.Context) (int, error)
- func (sq *StorageQuery) CountX(ctx context.Context) int
- func (sq *StorageQuery) Exist(ctx context.Context) (bool, error)
- func (sq *StorageQuery) ExistX(ctx context.Context) bool
- func (sq *StorageQuery) First(ctx context.Context) (*Storage, error)
- func (sq *StorageQuery) FirstID(ctx context.Context) (id int, err error)
- func (sq *StorageQuery) FirstIDX(ctx context.Context) int
- func (sq *StorageQuery) FirstX(ctx context.Context) *Storage
- func (sq *StorageQuery) GroupBy(field string, fields ...string) *StorageGroupBy
- func (sq *StorageQuery) IDs(ctx context.Context) (ids []int, err error)
- func (sq *StorageQuery) IDsX(ctx context.Context) []int
- func (sq *StorageQuery) Limit(limit int) *StorageQuery
- func (sq *StorageQuery) Offset(offset int) *StorageQuery
- func (sq *StorageQuery) Only(ctx context.Context) (*Storage, error)
- func (sq *StorageQuery) OnlyID(ctx context.Context) (id int, err error)
- func (sq *StorageQuery) OnlyIDX(ctx context.Context) int
- func (sq *StorageQuery) OnlyX(ctx context.Context) *Storage
- func (sq *StorageQuery) Order(o ...storage.OrderOption) *StorageQuery
- func (sq *StorageQuery) QueryOldVersion() *VersionQuery
- func (sq *StorageQuery) QueryVersion() *VersionQuery
- func (sq *StorageQuery) Select(fields ...string) *StorageSelect
- func (sq *StorageQuery) Unique(unique bool) *StorageQuery
- func (sq *StorageQuery) Where(ps ...predicate.Storage) *StorageQuery
- func (sq *StorageQuery) WithOldVersion(opts ...func(*VersionQuery)) *StorageQuery
- func (sq *StorageQuery) WithVersion(opts ...func(*VersionQuery)) *StorageQuery
- type StorageSelect
- func (ss *StorageSelect) Aggregate(fns ...AggregateFunc) *StorageSelect
- func (s *StorageSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *StorageSelect) BoolX(ctx context.Context) bool
- func (s *StorageSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *StorageSelect) BoolsX(ctx context.Context) []bool
- func (s *StorageSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *StorageSelect) Float64X(ctx context.Context) float64
- func (s *StorageSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *StorageSelect) Float64sX(ctx context.Context) []float64
- func (s *StorageSelect) Int(ctx context.Context) (_ int, err error)
- func (s *StorageSelect) IntX(ctx context.Context) int
- func (s *StorageSelect) Ints(ctx context.Context) ([]int, error)
- func (s *StorageSelect) IntsX(ctx context.Context) []int
- func (ss *StorageSelect) Scan(ctx context.Context, v any) error
- func (s *StorageSelect) ScanX(ctx context.Context, v any)
- func (s *StorageSelect) String(ctx context.Context) (_ string, err error)
- func (s *StorageSelect) StringX(ctx context.Context) string
- func (s *StorageSelect) Strings(ctx context.Context) ([]string, error)
- func (s *StorageSelect) StringsX(ctx context.Context) []string
- type StorageUpdate
- func (su *StorageUpdate) ClearArch() *StorageUpdate
- func (su *StorageUpdate) ClearFileHashes() *StorageUpdate
- func (su *StorageUpdate) ClearOldVersion() *StorageUpdate
- func (su *StorageUpdate) ClearOs() *StorageUpdate
- func (su *StorageUpdate) ClearPackagePath() *StorageUpdate
- func (su *StorageUpdate) ClearResourcePath() *StorageUpdate
- func (su *StorageUpdate) ClearVersion() *StorageUpdate
- func (su *StorageUpdate) Exec(ctx context.Context) error
- func (su *StorageUpdate) ExecX(ctx context.Context)
- func (su *StorageUpdate) Mutation() *StorageMutation
- func (su *StorageUpdate) Save(ctx context.Context) (int, error)
- func (su *StorageUpdate) SaveX(ctx context.Context) int
- func (su *StorageUpdate) SetArch(s string) *StorageUpdate
- func (su *StorageUpdate) SetCreatedAt(t time.Time) *StorageUpdate
- func (su *StorageUpdate) SetFileHashes(m map[string]string) *StorageUpdate
- func (su *StorageUpdate) SetNillableArch(s *string) *StorageUpdate
- func (su *StorageUpdate) SetNillableCreatedAt(t *time.Time) *StorageUpdate
- func (su *StorageUpdate) SetNillableOldVersionID(id *int) *StorageUpdate
- func (su *StorageUpdate) SetNillableOs(s *string) *StorageUpdate
- func (su *StorageUpdate) SetNillablePackagePath(s *string) *StorageUpdate
- func (su *StorageUpdate) SetNillableResourcePath(s *string) *StorageUpdate
- func (su *StorageUpdate) SetNillableUpdateType(st *storage.UpdateType) *StorageUpdate
- func (su *StorageUpdate) SetOldVersion(v *Version) *StorageUpdate
- func (su *StorageUpdate) SetOldVersionID(id int) *StorageUpdate
- func (su *StorageUpdate) SetOs(s string) *StorageUpdate
- func (su *StorageUpdate) SetPackagePath(s string) *StorageUpdate
- func (su *StorageUpdate) SetResourcePath(s string) *StorageUpdate
- func (su *StorageUpdate) SetUpdateType(st storage.UpdateType) *StorageUpdate
- func (su *StorageUpdate) SetVersion(v *Version) *StorageUpdate
- func (su *StorageUpdate) SetVersionID(id int) *StorageUpdate
- func (su *StorageUpdate) Where(ps ...predicate.Storage) *StorageUpdate
- type StorageUpdateOne
- func (suo *StorageUpdateOne) ClearArch() *StorageUpdateOne
- func (suo *StorageUpdateOne) ClearFileHashes() *StorageUpdateOne
- func (suo *StorageUpdateOne) ClearOldVersion() *StorageUpdateOne
- func (suo *StorageUpdateOne) ClearOs() *StorageUpdateOne
- func (suo *StorageUpdateOne) ClearPackagePath() *StorageUpdateOne
- func (suo *StorageUpdateOne) ClearResourcePath() *StorageUpdateOne
- func (suo *StorageUpdateOne) ClearVersion() *StorageUpdateOne
- func (suo *StorageUpdateOne) Exec(ctx context.Context) error
- func (suo *StorageUpdateOne) ExecX(ctx context.Context)
- func (suo *StorageUpdateOne) Mutation() *StorageMutation
- func (suo *StorageUpdateOne) Save(ctx context.Context) (*Storage, error)
- func (suo *StorageUpdateOne) SaveX(ctx context.Context) *Storage
- func (suo *StorageUpdateOne) Select(field string, fields ...string) *StorageUpdateOne
- func (suo *StorageUpdateOne) SetArch(s string) *StorageUpdateOne
- func (suo *StorageUpdateOne) SetCreatedAt(t time.Time) *StorageUpdateOne
- func (suo *StorageUpdateOne) SetFileHashes(m map[string]string) *StorageUpdateOne
- func (suo *StorageUpdateOne) SetNillableArch(s *string) *StorageUpdateOne
- func (suo *StorageUpdateOne) SetNillableCreatedAt(t *time.Time) *StorageUpdateOne
- func (suo *StorageUpdateOne) SetNillableOldVersionID(id *int) *StorageUpdateOne
- func (suo *StorageUpdateOne) SetNillableOs(s *string) *StorageUpdateOne
- func (suo *StorageUpdateOne) SetNillablePackagePath(s *string) *StorageUpdateOne
- func (suo *StorageUpdateOne) SetNillableResourcePath(s *string) *StorageUpdateOne
- func (suo *StorageUpdateOne) SetNillableUpdateType(st *storage.UpdateType) *StorageUpdateOne
- func (suo *StorageUpdateOne) SetOldVersion(v *Version) *StorageUpdateOne
- func (suo *StorageUpdateOne) SetOldVersionID(id int) *StorageUpdateOne
- func (suo *StorageUpdateOne) SetOs(s string) *StorageUpdateOne
- func (suo *StorageUpdateOne) SetPackagePath(s string) *StorageUpdateOne
- func (suo *StorageUpdateOne) SetResourcePath(s string) *StorageUpdateOne
- func (suo *StorageUpdateOne) SetUpdateType(st storage.UpdateType) *StorageUpdateOne
- func (suo *StorageUpdateOne) SetVersion(v *Version) *StorageUpdateOne
- func (suo *StorageUpdateOne) SetVersionID(id int) *StorageUpdateOne
- func (suo *StorageUpdateOne) Where(ps ...predicate.Storage) *StorageUpdateOne
- type StorageUpsert
- func (u *StorageUpsert) ClearArch() *StorageUpsert
- func (u *StorageUpsert) ClearFileHashes() *StorageUpsert
- func (u *StorageUpsert) ClearOs() *StorageUpsert
- func (u *StorageUpsert) ClearPackagePath() *StorageUpsert
- func (u *StorageUpsert) ClearResourcePath() *StorageUpsert
- func (u *StorageUpsert) SetArch(v string) *StorageUpsert
- func (u *StorageUpsert) SetCreatedAt(v time.Time) *StorageUpsert
- func (u *StorageUpsert) SetFileHashes(v map[string]string) *StorageUpsert
- func (u *StorageUpsert) SetOs(v string) *StorageUpsert
- func (u *StorageUpsert) SetPackagePath(v string) *StorageUpsert
- func (u *StorageUpsert) SetResourcePath(v string) *StorageUpsert
- func (u *StorageUpsert) SetUpdateType(v storage.UpdateType) *StorageUpsert
- func (u *StorageUpsert) UpdateArch() *StorageUpsert
- func (u *StorageUpsert) UpdateCreatedAt() *StorageUpsert
- func (u *StorageUpsert) UpdateFileHashes() *StorageUpsert
- func (u *StorageUpsert) UpdateOs() *StorageUpsert
- func (u *StorageUpsert) UpdatePackagePath() *StorageUpsert
- func (u *StorageUpsert) UpdateResourcePath() *StorageUpsert
- func (u *StorageUpsert) UpdateUpdateType() *StorageUpsert
- type StorageUpsertBulk
- func (u *StorageUpsertBulk) ClearArch() *StorageUpsertBulk
- func (u *StorageUpsertBulk) ClearFileHashes() *StorageUpsertBulk
- func (u *StorageUpsertBulk) ClearOs() *StorageUpsertBulk
- func (u *StorageUpsertBulk) ClearPackagePath() *StorageUpsertBulk
- func (u *StorageUpsertBulk) ClearResourcePath() *StorageUpsertBulk
- func (u *StorageUpsertBulk) DoNothing() *StorageUpsertBulk
- func (u *StorageUpsertBulk) Exec(ctx context.Context) error
- func (u *StorageUpsertBulk) ExecX(ctx context.Context)
- func (u *StorageUpsertBulk) Ignore() *StorageUpsertBulk
- func (u *StorageUpsertBulk) SetArch(v string) *StorageUpsertBulk
- func (u *StorageUpsertBulk) SetCreatedAt(v time.Time) *StorageUpsertBulk
- func (u *StorageUpsertBulk) SetFileHashes(v map[string]string) *StorageUpsertBulk
- func (u *StorageUpsertBulk) SetOs(v string) *StorageUpsertBulk
- func (u *StorageUpsertBulk) SetPackagePath(v string) *StorageUpsertBulk
- func (u *StorageUpsertBulk) SetResourcePath(v string) *StorageUpsertBulk
- func (u *StorageUpsertBulk) SetUpdateType(v storage.UpdateType) *StorageUpsertBulk
- func (u *StorageUpsertBulk) Update(set func(*StorageUpsert)) *StorageUpsertBulk
- func (u *StorageUpsertBulk) UpdateArch() *StorageUpsertBulk
- func (u *StorageUpsertBulk) UpdateCreatedAt() *StorageUpsertBulk
- func (u *StorageUpsertBulk) UpdateFileHashes() *StorageUpsertBulk
- func (u *StorageUpsertBulk) UpdateNewValues() *StorageUpsertBulk
- func (u *StorageUpsertBulk) UpdateOs() *StorageUpsertBulk
- func (u *StorageUpsertBulk) UpdatePackagePath() *StorageUpsertBulk
- func (u *StorageUpsertBulk) UpdateResourcePath() *StorageUpsertBulk
- func (u *StorageUpsertBulk) UpdateUpdateType() *StorageUpsertBulk
- type StorageUpsertOne
- func (u *StorageUpsertOne) ClearArch() *StorageUpsertOne
- func (u *StorageUpsertOne) ClearFileHashes() *StorageUpsertOne
- func (u *StorageUpsertOne) ClearOs() *StorageUpsertOne
- func (u *StorageUpsertOne) ClearPackagePath() *StorageUpsertOne
- func (u *StorageUpsertOne) ClearResourcePath() *StorageUpsertOne
- func (u *StorageUpsertOne) DoNothing() *StorageUpsertOne
- func (u *StorageUpsertOne) Exec(ctx context.Context) error
- func (u *StorageUpsertOne) ExecX(ctx context.Context)
- func (u *StorageUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *StorageUpsertOne) IDX(ctx context.Context) int
- func (u *StorageUpsertOne) Ignore() *StorageUpsertOne
- func (u *StorageUpsertOne) SetArch(v string) *StorageUpsertOne
- func (u *StorageUpsertOne) SetCreatedAt(v time.Time) *StorageUpsertOne
- func (u *StorageUpsertOne) SetFileHashes(v map[string]string) *StorageUpsertOne
- func (u *StorageUpsertOne) SetOs(v string) *StorageUpsertOne
- func (u *StorageUpsertOne) SetPackagePath(v string) *StorageUpsertOne
- func (u *StorageUpsertOne) SetResourcePath(v string) *StorageUpsertOne
- func (u *StorageUpsertOne) SetUpdateType(v storage.UpdateType) *StorageUpsertOne
- func (u *StorageUpsertOne) Update(set func(*StorageUpsert)) *StorageUpsertOne
- func (u *StorageUpsertOne) UpdateArch() *StorageUpsertOne
- func (u *StorageUpsertOne) UpdateCreatedAt() *StorageUpsertOne
- func (u *StorageUpsertOne) UpdateFileHashes() *StorageUpsertOne
- func (u *StorageUpsertOne) UpdateNewValues() *StorageUpsertOne
- func (u *StorageUpsertOne) UpdateOs() *StorageUpsertOne
- func (u *StorageUpsertOne) UpdatePackagePath() *StorageUpsertOne
- func (u *StorageUpsertOne) UpdateResourcePath() *StorageUpsertOne
- func (u *StorageUpsertOne) UpdateUpdateType() *StorageUpsertOne
- type Storages
- type TraverseFunc
- type Traverser
- type Tx
- type ValidationError
- type Value
- type Version
- type VersionClient
- func (c *VersionClient) Create() *VersionCreate
- func (c *VersionClient) CreateBulk(builders ...*VersionCreate) *VersionCreateBulk
- func (c *VersionClient) Delete() *VersionDelete
- func (c *VersionClient) DeleteOne(v *Version) *VersionDeleteOne
- func (c *VersionClient) DeleteOneID(id int) *VersionDeleteOne
- func (c *VersionClient) Get(ctx context.Context, id int) (*Version, error)
- func (c *VersionClient) GetX(ctx context.Context, id int) *Version
- func (c *VersionClient) Hooks() []Hook
- func (c *VersionClient) Intercept(interceptors ...Interceptor)
- func (c *VersionClient) Interceptors() []Interceptor
- func (c *VersionClient) MapCreateBulk(slice any, setFunc func(*VersionCreate, int)) *VersionCreateBulk
- func (c *VersionClient) Query() *VersionQuery
- func (c *VersionClient) QueryResource(v *Version) *ResourceQuery
- func (c *VersionClient) QueryStorages(v *Version) *StorageQuery
- func (c *VersionClient) Update() *VersionUpdate
- func (c *VersionClient) UpdateOne(v *Version) *VersionUpdateOne
- func (c *VersionClient) UpdateOneID(id int) *VersionUpdateOne
- func (c *VersionClient) Use(hooks ...Hook)
- type VersionCreate
- func (vc *VersionCreate) AddStorageIDs(ids ...int) *VersionCreate
- func (vc *VersionCreate) AddStorages(s ...*Storage) *VersionCreate
- func (vc *VersionCreate) Exec(ctx context.Context) error
- func (vc *VersionCreate) ExecX(ctx context.Context)
- func (vc *VersionCreate) Mutation() *VersionMutation
- func (vc *VersionCreate) OnConflict(opts ...sql.ConflictOption) *VersionUpsertOne
- func (vc *VersionCreate) OnConflictColumns(columns ...string) *VersionUpsertOne
- func (vc *VersionCreate) Save(ctx context.Context) (*Version, error)
- func (vc *VersionCreate) SaveX(ctx context.Context) *Version
- func (vc *VersionCreate) SetChannel(v version.Channel) *VersionCreate
- func (vc *VersionCreate) SetCreatedAt(t time.Time) *VersionCreate
- func (vc *VersionCreate) SetName(s string) *VersionCreate
- func (vc *VersionCreate) SetNillableChannel(v *version.Channel) *VersionCreate
- func (vc *VersionCreate) SetNillableCreatedAt(t *time.Time) *VersionCreate
- func (vc *VersionCreate) SetNillableResourceID(id *string) *VersionCreate
- func (vc *VersionCreate) SetNumber(u uint64) *VersionCreate
- func (vc *VersionCreate) SetResource(r *Resource) *VersionCreate
- func (vc *VersionCreate) SetResourceID(id string) *VersionCreate
- type VersionCreateBulk
- func (vcb *VersionCreateBulk) Exec(ctx context.Context) error
- func (vcb *VersionCreateBulk) ExecX(ctx context.Context)
- func (vcb *VersionCreateBulk) OnConflict(opts ...sql.ConflictOption) *VersionUpsertBulk
- func (vcb *VersionCreateBulk) OnConflictColumns(columns ...string) *VersionUpsertBulk
- func (vcb *VersionCreateBulk) Save(ctx context.Context) ([]*Version, error)
- func (vcb *VersionCreateBulk) SaveX(ctx context.Context) []*Version
- type VersionDelete
- type VersionDeleteOne
- type VersionEdges
- type VersionGroupBy
- func (vgb *VersionGroupBy) Aggregate(fns ...AggregateFunc) *VersionGroupBy
- func (s *VersionGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *VersionGroupBy) BoolX(ctx context.Context) bool
- func (s *VersionGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *VersionGroupBy) BoolsX(ctx context.Context) []bool
- func (s *VersionGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *VersionGroupBy) Float64X(ctx context.Context) float64
- func (s *VersionGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *VersionGroupBy) Float64sX(ctx context.Context) []float64
- func (s *VersionGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *VersionGroupBy) IntX(ctx context.Context) int
- func (s *VersionGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *VersionGroupBy) IntsX(ctx context.Context) []int
- func (vgb *VersionGroupBy) Scan(ctx context.Context, v any) error
- func (s *VersionGroupBy) ScanX(ctx context.Context, v any)
- func (s *VersionGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *VersionGroupBy) StringX(ctx context.Context) string
- func (s *VersionGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *VersionGroupBy) StringsX(ctx context.Context) []string
- type VersionMutation
- func (m *VersionMutation) AddField(name string, value ent.Value) error
- func (m *VersionMutation) AddNumber(u int64)
- func (m *VersionMutation) AddStorageIDs(ids ...int)
- func (m *VersionMutation) AddedEdges() []string
- func (m *VersionMutation) AddedField(name string) (ent.Value, bool)
- func (m *VersionMutation) AddedFields() []string
- func (m *VersionMutation) AddedIDs(name string) []ent.Value
- func (m *VersionMutation) AddedNumber() (r int64, exists bool)
- func (m *VersionMutation) Channel() (r version.Channel, exists bool)
- func (m *VersionMutation) ClearEdge(name string) error
- func (m *VersionMutation) ClearField(name string) error
- func (m *VersionMutation) ClearResource()
- func (m *VersionMutation) ClearStorages()
- func (m *VersionMutation) ClearedEdges() []string
- func (m *VersionMutation) ClearedFields() []string
- func (m VersionMutation) Client() *Client
- func (m *VersionMutation) CreatedAt() (r time.Time, exists bool)
- func (m *VersionMutation) EdgeCleared(name string) bool
- func (m *VersionMutation) Field(name string) (ent.Value, bool)
- func (m *VersionMutation) FieldCleared(name string) bool
- func (m *VersionMutation) Fields() []string
- func (m *VersionMutation) ID() (id int, exists bool)
- func (m *VersionMutation) IDs(ctx context.Context) ([]int, error)
- func (m *VersionMutation) Name() (r string, exists bool)
- func (m *VersionMutation) Number() (r uint64, exists bool)
- func (m *VersionMutation) OldChannel(ctx context.Context) (v version.Channel, err error)
- func (m *VersionMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *VersionMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *VersionMutation) OldName(ctx context.Context) (v string, err error)
- func (m *VersionMutation) OldNumber(ctx context.Context) (v uint64, err error)
- func (m *VersionMutation) Op() Op
- func (m *VersionMutation) RemoveStorageIDs(ids ...int)
- func (m *VersionMutation) RemovedEdges() []string
- func (m *VersionMutation) RemovedIDs(name string) []ent.Value
- func (m *VersionMutation) RemovedStoragesIDs() (ids []int)
- func (m *VersionMutation) ResetChannel()
- func (m *VersionMutation) ResetCreatedAt()
- func (m *VersionMutation) ResetEdge(name string) error
- func (m *VersionMutation) ResetField(name string) error
- func (m *VersionMutation) ResetName()
- func (m *VersionMutation) ResetNumber()
- func (m *VersionMutation) ResetResource()
- func (m *VersionMutation) ResetStorages()
- func (m *VersionMutation) ResourceCleared() bool
- func (m *VersionMutation) ResourceID() (id string, exists bool)
- func (m *VersionMutation) ResourceIDs() (ids []string)
- func (m *VersionMutation) SetChannel(v version.Channel)
- func (m *VersionMutation) SetCreatedAt(t time.Time)
- func (m *VersionMutation) SetField(name string, value ent.Value) error
- func (m *VersionMutation) SetName(s string)
- func (m *VersionMutation) SetNumber(u uint64)
- func (m *VersionMutation) SetOp(op Op)
- func (m *VersionMutation) SetResourceID(id string)
- func (m *VersionMutation) StoragesCleared() bool
- func (m *VersionMutation) StoragesIDs() (ids []int)
- func (m VersionMutation) Tx() (*Tx, error)
- func (m *VersionMutation) Type() string
- func (m *VersionMutation) Where(ps ...predicate.Version)
- func (m *VersionMutation) WhereP(ps ...func(*sql.Selector))
- type VersionQuery
- func (vq *VersionQuery) Aggregate(fns ...AggregateFunc) *VersionSelect
- func (vq *VersionQuery) All(ctx context.Context) ([]*Version, error)
- func (vq *VersionQuery) AllX(ctx context.Context) []*Version
- func (vq *VersionQuery) Clone() *VersionQuery
- func (vq *VersionQuery) Count(ctx context.Context) (int, error)
- func (vq *VersionQuery) CountX(ctx context.Context) int
- func (vq *VersionQuery) Exist(ctx context.Context) (bool, error)
- func (vq *VersionQuery) ExistX(ctx context.Context) bool
- func (vq *VersionQuery) First(ctx context.Context) (*Version, error)
- func (vq *VersionQuery) FirstID(ctx context.Context) (id int, err error)
- func (vq *VersionQuery) FirstIDX(ctx context.Context) int
- func (vq *VersionQuery) FirstX(ctx context.Context) *Version
- func (vq *VersionQuery) GroupBy(field string, fields ...string) *VersionGroupBy
- func (vq *VersionQuery) IDs(ctx context.Context) (ids []int, err error)
- func (vq *VersionQuery) IDsX(ctx context.Context) []int
- func (vq *VersionQuery) Limit(limit int) *VersionQuery
- func (vq *VersionQuery) Offset(offset int) *VersionQuery
- func (vq *VersionQuery) Only(ctx context.Context) (*Version, error)
- func (vq *VersionQuery) OnlyID(ctx context.Context) (id int, err error)
- func (vq *VersionQuery) OnlyIDX(ctx context.Context) int
- func (vq *VersionQuery) OnlyX(ctx context.Context) *Version
- func (vq *VersionQuery) Order(o ...version.OrderOption) *VersionQuery
- func (vq *VersionQuery) QueryResource() *ResourceQuery
- func (vq *VersionQuery) QueryStorages() *StorageQuery
- func (vq *VersionQuery) Select(fields ...string) *VersionSelect
- func (vq *VersionQuery) Unique(unique bool) *VersionQuery
- func (vq *VersionQuery) Where(ps ...predicate.Version) *VersionQuery
- func (vq *VersionQuery) WithResource(opts ...func(*ResourceQuery)) *VersionQuery
- func (vq *VersionQuery) WithStorages(opts ...func(*StorageQuery)) *VersionQuery
- type VersionSelect
- func (vs *VersionSelect) Aggregate(fns ...AggregateFunc) *VersionSelect
- func (s *VersionSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *VersionSelect) BoolX(ctx context.Context) bool
- func (s *VersionSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *VersionSelect) BoolsX(ctx context.Context) []bool
- func (s *VersionSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *VersionSelect) Float64X(ctx context.Context) float64
- func (s *VersionSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *VersionSelect) Float64sX(ctx context.Context) []float64
- func (s *VersionSelect) Int(ctx context.Context) (_ int, err error)
- func (s *VersionSelect) IntX(ctx context.Context) int
- func (s *VersionSelect) Ints(ctx context.Context) ([]int, error)
- func (s *VersionSelect) IntsX(ctx context.Context) []int
- func (vs *VersionSelect) Scan(ctx context.Context, v any) error
- func (s *VersionSelect) ScanX(ctx context.Context, v any)
- func (s *VersionSelect) String(ctx context.Context) (_ string, err error)
- func (s *VersionSelect) StringX(ctx context.Context) string
- func (s *VersionSelect) Strings(ctx context.Context) ([]string, error)
- func (s *VersionSelect) StringsX(ctx context.Context) []string
- type VersionUpdate
- func (vu *VersionUpdate) AddNumber(u int64) *VersionUpdate
- func (vu *VersionUpdate) AddStorageIDs(ids ...int) *VersionUpdate
- func (vu *VersionUpdate) AddStorages(s ...*Storage) *VersionUpdate
- func (vu *VersionUpdate) ClearResource() *VersionUpdate
- func (vu *VersionUpdate) ClearStorages() *VersionUpdate
- func (vu *VersionUpdate) Exec(ctx context.Context) error
- func (vu *VersionUpdate) ExecX(ctx context.Context)
- func (vu *VersionUpdate) Mutation() *VersionMutation
- func (vu *VersionUpdate) RemoveStorageIDs(ids ...int) *VersionUpdate
- func (vu *VersionUpdate) RemoveStorages(s ...*Storage) *VersionUpdate
- func (vu *VersionUpdate) Save(ctx context.Context) (int, error)
- func (vu *VersionUpdate) SaveX(ctx context.Context) int
- func (vu *VersionUpdate) SetChannel(v version.Channel) *VersionUpdate
- func (vu *VersionUpdate) SetCreatedAt(t time.Time) *VersionUpdate
- func (vu *VersionUpdate) SetName(s string) *VersionUpdate
- func (vu *VersionUpdate) SetNillableChannel(v *version.Channel) *VersionUpdate
- func (vu *VersionUpdate) SetNillableCreatedAt(t *time.Time) *VersionUpdate
- func (vu *VersionUpdate) SetNillableName(s *string) *VersionUpdate
- func (vu *VersionUpdate) SetNillableNumber(u *uint64) *VersionUpdate
- func (vu *VersionUpdate) SetNillableResourceID(id *string) *VersionUpdate
- func (vu *VersionUpdate) SetNumber(u uint64) *VersionUpdate
- func (vu *VersionUpdate) SetResource(r *Resource) *VersionUpdate
- func (vu *VersionUpdate) SetResourceID(id string) *VersionUpdate
- func (vu *VersionUpdate) Where(ps ...predicate.Version) *VersionUpdate
- type VersionUpdateOne
- func (vuo *VersionUpdateOne) AddNumber(u int64) *VersionUpdateOne
- func (vuo *VersionUpdateOne) AddStorageIDs(ids ...int) *VersionUpdateOne
- func (vuo *VersionUpdateOne) AddStorages(s ...*Storage) *VersionUpdateOne
- func (vuo *VersionUpdateOne) ClearResource() *VersionUpdateOne
- func (vuo *VersionUpdateOne) ClearStorages() *VersionUpdateOne
- func (vuo *VersionUpdateOne) Exec(ctx context.Context) error
- func (vuo *VersionUpdateOne) ExecX(ctx context.Context)
- func (vuo *VersionUpdateOne) Mutation() *VersionMutation
- func (vuo *VersionUpdateOne) RemoveStorageIDs(ids ...int) *VersionUpdateOne
- func (vuo *VersionUpdateOne) RemoveStorages(s ...*Storage) *VersionUpdateOne
- func (vuo *VersionUpdateOne) Save(ctx context.Context) (*Version, error)
- func (vuo *VersionUpdateOne) SaveX(ctx context.Context) *Version
- func (vuo *VersionUpdateOne) Select(field string, fields ...string) *VersionUpdateOne
- func (vuo *VersionUpdateOne) SetChannel(v version.Channel) *VersionUpdateOne
- func (vuo *VersionUpdateOne) SetCreatedAt(t time.Time) *VersionUpdateOne
- func (vuo *VersionUpdateOne) SetName(s string) *VersionUpdateOne
- func (vuo *VersionUpdateOne) SetNillableChannel(v *version.Channel) *VersionUpdateOne
- func (vuo *VersionUpdateOne) SetNillableCreatedAt(t *time.Time) *VersionUpdateOne
- func (vuo *VersionUpdateOne) SetNillableName(s *string) *VersionUpdateOne
- func (vuo *VersionUpdateOne) SetNillableNumber(u *uint64) *VersionUpdateOne
- func (vuo *VersionUpdateOne) SetNillableResourceID(id *string) *VersionUpdateOne
- func (vuo *VersionUpdateOne) SetNumber(u uint64) *VersionUpdateOne
- func (vuo *VersionUpdateOne) SetResource(r *Resource) *VersionUpdateOne
- func (vuo *VersionUpdateOne) SetResourceID(id string) *VersionUpdateOne
- func (vuo *VersionUpdateOne) Where(ps ...predicate.Version) *VersionUpdateOne
- type VersionUpsert
- func (u *VersionUpsert) AddNumber(v uint64) *VersionUpsert
- func (u *VersionUpsert) SetChannel(v version.Channel) *VersionUpsert
- func (u *VersionUpsert) SetCreatedAt(v time.Time) *VersionUpsert
- func (u *VersionUpsert) SetName(v string) *VersionUpsert
- func (u *VersionUpsert) SetNumber(v uint64) *VersionUpsert
- func (u *VersionUpsert) UpdateChannel() *VersionUpsert
- func (u *VersionUpsert) UpdateCreatedAt() *VersionUpsert
- func (u *VersionUpsert) UpdateName() *VersionUpsert
- func (u *VersionUpsert) UpdateNumber() *VersionUpsert
- type VersionUpsertBulk
- func (u *VersionUpsertBulk) AddNumber(v uint64) *VersionUpsertBulk
- func (u *VersionUpsertBulk) DoNothing() *VersionUpsertBulk
- func (u *VersionUpsertBulk) Exec(ctx context.Context) error
- func (u *VersionUpsertBulk) ExecX(ctx context.Context)
- func (u *VersionUpsertBulk) Ignore() *VersionUpsertBulk
- func (u *VersionUpsertBulk) SetChannel(v version.Channel) *VersionUpsertBulk
- func (u *VersionUpsertBulk) SetCreatedAt(v time.Time) *VersionUpsertBulk
- func (u *VersionUpsertBulk) SetName(v string) *VersionUpsertBulk
- func (u *VersionUpsertBulk) SetNumber(v uint64) *VersionUpsertBulk
- func (u *VersionUpsertBulk) Update(set func(*VersionUpsert)) *VersionUpsertBulk
- func (u *VersionUpsertBulk) UpdateChannel() *VersionUpsertBulk
- func (u *VersionUpsertBulk) UpdateCreatedAt() *VersionUpsertBulk
- func (u *VersionUpsertBulk) UpdateName() *VersionUpsertBulk
- func (u *VersionUpsertBulk) UpdateNewValues() *VersionUpsertBulk
- func (u *VersionUpsertBulk) UpdateNumber() *VersionUpsertBulk
- type VersionUpsertOne
- func (u *VersionUpsertOne) AddNumber(v uint64) *VersionUpsertOne
- func (u *VersionUpsertOne) DoNothing() *VersionUpsertOne
- func (u *VersionUpsertOne) Exec(ctx context.Context) error
- func (u *VersionUpsertOne) ExecX(ctx context.Context)
- func (u *VersionUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *VersionUpsertOne) IDX(ctx context.Context) int
- func (u *VersionUpsertOne) Ignore() *VersionUpsertOne
- func (u *VersionUpsertOne) SetChannel(v version.Channel) *VersionUpsertOne
- func (u *VersionUpsertOne) SetCreatedAt(v time.Time) *VersionUpsertOne
- func (u *VersionUpsertOne) SetName(v string) *VersionUpsertOne
- func (u *VersionUpsertOne) SetNumber(v uint64) *VersionUpsertOne
- func (u *VersionUpsertOne) Update(set func(*VersionUpsert)) *VersionUpsertOne
- func (u *VersionUpsertOne) UpdateChannel() *VersionUpsertOne
- func (u *VersionUpsertOne) UpdateCreatedAt() *VersionUpsertOne
- func (u *VersionUpsertOne) UpdateName() *VersionUpsertOne
- func (u *VersionUpsertOne) UpdateNewValues() *VersionUpsertOne
- func (u *VersionUpsertOne) UpdateNumber() *VersionUpsertOne
- type Versions
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeLatestVersion = "LatestVersion" TypeResource = "Resource" TypeStorage = "Storage" TypeVersion = "Version" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Client ¶
type Client struct {
// Schema is the client for creating, migrating and dropping schema.
Schema *migrate.Schema
// LatestVersion is the client for interacting with the LatestVersion builders.
LatestVersion *LatestVersionClient
// Resource is the client for interacting with the Resource builders.
Resource *ResourceClient
// Storage is the client for interacting with the Storage builders.
Storage *StorageClient
// Version is the client for interacting with the Version builders.
Version *VersionClient
// 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(). LatestVersion. 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 LatestVersion ¶ added in v0.3.0
type LatestVersion struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// Channel holds the value of the "channel" field.
Channel latestversion.Channel `json:"channel,omitempty"`
// UpdatedAt holds the value of the "updated_at" field.
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the LatestVersionQuery when eager-loading is set.
Edges LatestVersionEdges `json:"edges"`
// contains filtered or unexported fields
}
LatestVersion is the model entity for the LatestVersion schema.
func (*LatestVersion) QueryResource ¶ added in v0.3.0
func (lv *LatestVersion) QueryResource() *ResourceQuery
QueryResource queries the "resource" edge of the LatestVersion entity.
func (*LatestVersion) QueryVersion ¶ added in v0.3.0
func (lv *LatestVersion) QueryVersion() *VersionQuery
QueryVersion queries the "version" edge of the LatestVersion entity.
func (*LatestVersion) String ¶ added in v0.3.0
func (lv *LatestVersion) String() string
String implements the fmt.Stringer.
func (*LatestVersion) Unwrap ¶ added in v0.3.0
func (lv *LatestVersion) Unwrap() *LatestVersion
Unwrap unwraps the LatestVersion 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 (*LatestVersion) Update ¶ added in v0.3.0
func (lv *LatestVersion) Update() *LatestVersionUpdateOne
Update returns a builder for updating this LatestVersion. Note that you need to call LatestVersion.Unwrap() before calling this method if this LatestVersion was returned from a transaction, and the transaction was committed or rolled back.
type LatestVersionClient ¶ added in v0.3.0
type LatestVersionClient struct {
// contains filtered or unexported fields
}
LatestVersionClient is a client for the LatestVersion schema.
func NewLatestVersionClient ¶ added in v0.3.0
func NewLatestVersionClient(c config) *LatestVersionClient
NewLatestVersionClient returns a client for the LatestVersion from the given config.
func (*LatestVersionClient) Create ¶ added in v0.3.0
func (c *LatestVersionClient) Create() *LatestVersionCreate
Create returns a builder for creating a LatestVersion entity.
func (*LatestVersionClient) CreateBulk ¶ added in v0.3.0
func (c *LatestVersionClient) CreateBulk(builders ...*LatestVersionCreate) *LatestVersionCreateBulk
CreateBulk returns a builder for creating a bulk of LatestVersion entities.
func (*LatestVersionClient) Delete ¶ added in v0.3.0
func (c *LatestVersionClient) Delete() *LatestVersionDelete
Delete returns a delete builder for LatestVersion.
func (*LatestVersionClient) DeleteOne ¶ added in v0.3.0
func (c *LatestVersionClient) DeleteOne(lv *LatestVersion) *LatestVersionDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*LatestVersionClient) DeleteOneID ¶ added in v0.3.0
func (c *LatestVersionClient) DeleteOneID(id int) *LatestVersionDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*LatestVersionClient) Get ¶ added in v0.3.0
func (c *LatestVersionClient) Get(ctx context.Context, id int) (*LatestVersion, error)
Get returns a LatestVersion entity by its id.
func (*LatestVersionClient) GetX ¶ added in v0.3.0
func (c *LatestVersionClient) GetX(ctx context.Context, id int) *LatestVersion
GetX is like Get, but panics if an error occurs.
func (*LatestVersionClient) Hooks ¶ added in v0.3.0
func (c *LatestVersionClient) Hooks() []Hook
Hooks returns the client hooks.
func (*LatestVersionClient) Intercept ¶ added in v0.3.0
func (c *LatestVersionClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `latestversion.Intercept(f(g(h())))`.
func (*LatestVersionClient) Interceptors ¶ added in v0.3.0
func (c *LatestVersionClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*LatestVersionClient) MapCreateBulk ¶ added in v0.3.0
func (c *LatestVersionClient) MapCreateBulk(slice any, setFunc func(*LatestVersionCreate, int)) *LatestVersionCreateBulk
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 (*LatestVersionClient) Query ¶ added in v0.3.0
func (c *LatestVersionClient) Query() *LatestVersionQuery
Query returns a query builder for LatestVersion.
func (*LatestVersionClient) QueryResource ¶ added in v0.3.0
func (c *LatestVersionClient) QueryResource(lv *LatestVersion) *ResourceQuery
QueryResource queries the resource edge of a LatestVersion.
func (*LatestVersionClient) QueryVersion ¶ added in v0.3.0
func (c *LatestVersionClient) QueryVersion(lv *LatestVersion) *VersionQuery
QueryVersion queries the version edge of a LatestVersion.
func (*LatestVersionClient) Update ¶ added in v0.3.0
func (c *LatestVersionClient) Update() *LatestVersionUpdate
Update returns an update builder for LatestVersion.
func (*LatestVersionClient) UpdateOne ¶ added in v0.3.0
func (c *LatestVersionClient) UpdateOne(lv *LatestVersion) *LatestVersionUpdateOne
UpdateOne returns an update builder for the given entity.
func (*LatestVersionClient) UpdateOneID ¶ added in v0.3.0
func (c *LatestVersionClient) UpdateOneID(id int) *LatestVersionUpdateOne
UpdateOneID returns an update builder for the given id.
func (*LatestVersionClient) Use ¶ added in v0.3.0
func (c *LatestVersionClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `latestversion.Hooks(f(g(h())))`.
type LatestVersionCreate ¶ added in v0.3.0
type LatestVersionCreate struct {
// contains filtered or unexported fields
}
LatestVersionCreate is the builder for creating a LatestVersion entity.
func (*LatestVersionCreate) Exec ¶ added in v0.3.0
func (lvc *LatestVersionCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*LatestVersionCreate) ExecX ¶ added in v0.3.0
func (lvc *LatestVersionCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LatestVersionCreate) Mutation ¶ added in v0.3.0
func (lvc *LatestVersionCreate) Mutation() *LatestVersionMutation
Mutation returns the LatestVersionMutation object of the builder.
func (*LatestVersionCreate) OnConflict ¶ added in v0.3.0
func (lvc *LatestVersionCreate) OnConflict(opts ...sql.ConflictOption) *LatestVersionUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.LatestVersion.Create().
SetChannel(v).
OnConflict(
// Update the row with the new values
// the was proposed for insertion.
sql.ResolveWithNewValues(),
).
// Override some of the fields with custom
// update values.
Update(func(u *ent.LatestVersionUpsert) {
SetChannel(v+v).
}).
Exec(ctx)
func (*LatestVersionCreate) OnConflictColumns ¶ added in v0.3.0
func (lvc *LatestVersionCreate) OnConflictColumns(columns ...string) *LatestVersionUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.LatestVersion.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*LatestVersionCreate) Save ¶ added in v0.3.0
func (lvc *LatestVersionCreate) Save(ctx context.Context) (*LatestVersion, error)
Save creates the LatestVersion in the database.
func (*LatestVersionCreate) SaveX ¶ added in v0.3.0
func (lvc *LatestVersionCreate) SaveX(ctx context.Context) *LatestVersion
SaveX calls Save and panics if Save returns an error.
func (*LatestVersionCreate) SetChannel ¶ added in v0.3.0
func (lvc *LatestVersionCreate) SetChannel(l latestversion.Channel) *LatestVersionCreate
SetChannel sets the "channel" field.
func (*LatestVersionCreate) SetNillableChannel ¶ added in v0.3.0
func (lvc *LatestVersionCreate) SetNillableChannel(l *latestversion.Channel) *LatestVersionCreate
SetNillableChannel sets the "channel" field if the given value is not nil.
func (*LatestVersionCreate) SetNillableUpdatedAt ¶ added in v0.3.0
func (lvc *LatestVersionCreate) SetNillableUpdatedAt(t *time.Time) *LatestVersionCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*LatestVersionCreate) SetResource ¶ added in v0.3.0
func (lvc *LatestVersionCreate) SetResource(r *Resource) *LatestVersionCreate
SetResource sets the "resource" edge to the Resource entity.
func (*LatestVersionCreate) SetResourceID ¶ added in v0.3.0
func (lvc *LatestVersionCreate) SetResourceID(id string) *LatestVersionCreate
SetResourceID sets the "resource" edge to the Resource entity by ID.
func (*LatestVersionCreate) SetUpdatedAt ¶ added in v0.3.0
func (lvc *LatestVersionCreate) SetUpdatedAt(t time.Time) *LatestVersionCreate
SetUpdatedAt sets the "updated_at" field.
func (*LatestVersionCreate) SetVersion ¶ added in v0.3.0
func (lvc *LatestVersionCreate) SetVersion(v *Version) *LatestVersionCreate
SetVersion sets the "version" edge to the Version entity.
func (*LatestVersionCreate) SetVersionID ¶ added in v0.3.0
func (lvc *LatestVersionCreate) SetVersionID(id int) *LatestVersionCreate
SetVersionID sets the "version" edge to the Version entity by ID.
type LatestVersionCreateBulk ¶ added in v0.3.0
type LatestVersionCreateBulk struct {
// contains filtered or unexported fields
}
LatestVersionCreateBulk is the builder for creating many LatestVersion entities in bulk.
func (*LatestVersionCreateBulk) Exec ¶ added in v0.3.0
func (lvcb *LatestVersionCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*LatestVersionCreateBulk) ExecX ¶ added in v0.3.0
func (lvcb *LatestVersionCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LatestVersionCreateBulk) OnConflict ¶ added in v0.3.0
func (lvcb *LatestVersionCreateBulk) OnConflict(opts ...sql.ConflictOption) *LatestVersionUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.LatestVersion.CreateBulk(builders...).
OnConflict(
// Update the row with the new values
// the was proposed for insertion.
sql.ResolveWithNewValues(),
).
// Override some of the fields with custom
// update values.
Update(func(u *ent.LatestVersionUpsert) {
SetChannel(v+v).
}).
Exec(ctx)
func (*LatestVersionCreateBulk) OnConflictColumns ¶ added in v0.3.0
func (lvcb *LatestVersionCreateBulk) OnConflictColumns(columns ...string) *LatestVersionUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.LatestVersion.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*LatestVersionCreateBulk) Save ¶ added in v0.3.0
func (lvcb *LatestVersionCreateBulk) Save(ctx context.Context) ([]*LatestVersion, error)
Save creates the LatestVersion entities in the database.
func (*LatestVersionCreateBulk) SaveX ¶ added in v0.3.0
func (lvcb *LatestVersionCreateBulk) SaveX(ctx context.Context) []*LatestVersion
SaveX is like Save, but panics if an error occurs.
type LatestVersionDelete ¶ added in v0.3.0
type LatestVersionDelete struct {
// contains filtered or unexported fields
}
LatestVersionDelete is the builder for deleting a LatestVersion entity.
func (*LatestVersionDelete) Exec ¶ added in v0.3.0
func (lvd *LatestVersionDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*LatestVersionDelete) ExecX ¶ added in v0.3.0
func (lvd *LatestVersionDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*LatestVersionDelete) Where ¶ added in v0.3.0
func (lvd *LatestVersionDelete) Where(ps ...predicate.LatestVersion) *LatestVersionDelete
Where appends a list predicates to the LatestVersionDelete builder.
type LatestVersionDeleteOne ¶ added in v0.3.0
type LatestVersionDeleteOne struct {
// contains filtered or unexported fields
}
LatestVersionDeleteOne is the builder for deleting a single LatestVersion entity.
func (*LatestVersionDeleteOne) Exec ¶ added in v0.3.0
func (lvdo *LatestVersionDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*LatestVersionDeleteOne) ExecX ¶ added in v0.3.0
func (lvdo *LatestVersionDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LatestVersionDeleteOne) Where ¶ added in v0.3.0
func (lvdo *LatestVersionDeleteOne) Where(ps ...predicate.LatestVersion) *LatestVersionDeleteOne
Where appends a list predicates to the LatestVersionDelete builder.
type LatestVersionEdges ¶ added in v0.3.0
type LatestVersionEdges struct {
// Resource holds the value of the resource edge.
Resource *Resource `json:"resource,omitempty"`
// Version holds the value of the version edge.
Version *Version `json:"version,omitempty"`
// contains filtered or unexported fields
}
LatestVersionEdges holds the relations/edges for other nodes in the graph.
func (LatestVersionEdges) ResourceOrErr ¶ added in v0.3.0
func (e LatestVersionEdges) ResourceOrErr() (*Resource, error)
ResourceOrErr returns the Resource value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (LatestVersionEdges) VersionOrErr ¶ added in v0.3.0
func (e LatestVersionEdges) VersionOrErr() (*Version, error)
VersionOrErr returns the Version value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type LatestVersionGroupBy ¶ added in v0.3.0
type LatestVersionGroupBy struct {
// contains filtered or unexported fields
}
LatestVersionGroupBy is the group-by builder for LatestVersion entities.
func (*LatestVersionGroupBy) Aggregate ¶ added in v0.3.0
func (lvgb *LatestVersionGroupBy) Aggregate(fns ...AggregateFunc) *LatestVersionGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*LatestVersionGroupBy) Bool ¶ added in v0.3.0
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*LatestVersionGroupBy) BoolX ¶ added in v0.3.0
BoolX is like Bool, but panics if an error occurs.
func (*LatestVersionGroupBy) Bools ¶ added in v0.3.0
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*LatestVersionGroupBy) BoolsX ¶ added in v0.3.0
BoolsX is like Bools, but panics if an error occurs.
func (*LatestVersionGroupBy) Float64 ¶ added in v0.3.0
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*LatestVersionGroupBy) Float64X ¶ added in v0.3.0
Float64X is like Float64, but panics if an error occurs.
func (*LatestVersionGroupBy) Float64s ¶ added in v0.3.0
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*LatestVersionGroupBy) Float64sX ¶ added in v0.3.0
Float64sX is like Float64s, but panics if an error occurs.
func (*LatestVersionGroupBy) Int ¶ added in v0.3.0
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*LatestVersionGroupBy) IntX ¶ added in v0.3.0
IntX is like Int, but panics if an error occurs.
func (*LatestVersionGroupBy) Ints ¶ added in v0.3.0
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*LatestVersionGroupBy) IntsX ¶ added in v0.3.0
IntsX is like Ints, but panics if an error occurs.
func (*LatestVersionGroupBy) Scan ¶ added in v0.3.0
func (lvgb *LatestVersionGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*LatestVersionGroupBy) ScanX ¶ added in v0.3.0
ScanX is like Scan, but panics if an error occurs.
func (*LatestVersionGroupBy) String ¶ added in v0.3.0
String returns a single string from a selector. It is only allowed when selecting one field.
func (*LatestVersionGroupBy) StringX ¶ added in v0.3.0
StringX is like String, but panics if an error occurs.
type LatestVersionMutation ¶ added in v0.3.0
type LatestVersionMutation struct {
// contains filtered or unexported fields
}
LatestVersionMutation represents an operation that mutates the LatestVersion nodes in the graph.
func (*LatestVersionMutation) AddField ¶ added in v0.3.0
func (m *LatestVersionMutation) 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 (*LatestVersionMutation) AddedEdges ¶ added in v0.3.0
func (m *LatestVersionMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*LatestVersionMutation) AddedField ¶ added in v0.3.0
func (m *LatestVersionMutation) 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 (*LatestVersionMutation) AddedFields ¶ added in v0.3.0
func (m *LatestVersionMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*LatestVersionMutation) AddedIDs ¶ added in v0.3.0
func (m *LatestVersionMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*LatestVersionMutation) Channel ¶ added in v0.3.0
func (m *LatestVersionMutation) Channel() (r latestversion.Channel, exists bool)
Channel returns the value of the "channel" field in the mutation.
func (*LatestVersionMutation) ClearEdge ¶ added in v0.3.0
func (m *LatestVersionMutation) 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 (*LatestVersionMutation) ClearField ¶ added in v0.3.0
func (m *LatestVersionMutation) 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 (*LatestVersionMutation) ClearResource ¶ added in v0.3.0
func (m *LatestVersionMutation) ClearResource()
ClearResource clears the "resource" edge to the Resource entity.
func (*LatestVersionMutation) ClearVersion ¶ added in v0.3.0
func (m *LatestVersionMutation) ClearVersion()
ClearVersion clears the "version" edge to the Version entity.
func (*LatestVersionMutation) ClearedEdges ¶ added in v0.3.0
func (m *LatestVersionMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*LatestVersionMutation) ClearedFields ¶ added in v0.3.0
func (m *LatestVersionMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (LatestVersionMutation) Client ¶ added in v0.3.0
func (m LatestVersionMutation) 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 (*LatestVersionMutation) EdgeCleared ¶ added in v0.3.0
func (m *LatestVersionMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*LatestVersionMutation) Field ¶ added in v0.3.0
func (m *LatestVersionMutation) 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 (*LatestVersionMutation) FieldCleared ¶ added in v0.3.0
func (m *LatestVersionMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*LatestVersionMutation) Fields ¶ added in v0.3.0
func (m *LatestVersionMutation) 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 (*LatestVersionMutation) ID ¶ added in v0.3.0
func (m *LatestVersionMutation) 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 (*LatestVersionMutation) IDs ¶ added in v0.3.0
func (m *LatestVersionMutation) 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 (*LatestVersionMutation) OldChannel ¶ added in v0.3.0
func (m *LatestVersionMutation) OldChannel(ctx context.Context) (v latestversion.Channel, err error)
OldChannel returns the old "channel" field's value of the LatestVersion entity. If the LatestVersion 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 (*LatestVersionMutation) OldField ¶ added in v0.3.0
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 (*LatestVersionMutation) OldUpdatedAt ¶ added in v0.3.0
OldUpdatedAt returns the old "updated_at" field's value of the LatestVersion entity. If the LatestVersion 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 (*LatestVersionMutation) Op ¶ added in v0.3.0
func (m *LatestVersionMutation) Op() Op
Op returns the operation name.
func (*LatestVersionMutation) RemovedEdges ¶ added in v0.3.0
func (m *LatestVersionMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*LatestVersionMutation) RemovedIDs ¶ added in v0.3.0
func (m *LatestVersionMutation) 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 (*LatestVersionMutation) ResetChannel ¶ added in v0.3.0
func (m *LatestVersionMutation) ResetChannel()
ResetChannel resets all changes to the "channel" field.
func (*LatestVersionMutation) ResetEdge ¶ added in v0.3.0
func (m *LatestVersionMutation) 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 (*LatestVersionMutation) ResetField ¶ added in v0.3.0
func (m *LatestVersionMutation) 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 (*LatestVersionMutation) ResetResource ¶ added in v0.3.0
func (m *LatestVersionMutation) ResetResource()
ResetResource resets all changes to the "resource" edge.
func (*LatestVersionMutation) ResetUpdatedAt ¶ added in v0.3.0
func (m *LatestVersionMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*LatestVersionMutation) ResetVersion ¶ added in v0.3.0
func (m *LatestVersionMutation) ResetVersion()
ResetVersion resets all changes to the "version" edge.
func (*LatestVersionMutation) ResourceCleared ¶ added in v0.3.0
func (m *LatestVersionMutation) ResourceCleared() bool
ResourceCleared reports if the "resource" edge to the Resource entity was cleared.
func (*LatestVersionMutation) ResourceID ¶ added in v0.3.0
func (m *LatestVersionMutation) ResourceID() (id string, exists bool)
ResourceID returns the "resource" edge ID in the mutation.
func (*LatestVersionMutation) ResourceIDs ¶ added in v0.3.0
func (m *LatestVersionMutation) ResourceIDs() (ids []string)
ResourceIDs returns the "resource" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ResourceID instead. It exists only for internal usage by the builders.
func (*LatestVersionMutation) SetChannel ¶ added in v0.3.0
func (m *LatestVersionMutation) SetChannel(l latestversion.Channel)
SetChannel sets the "channel" field.
func (*LatestVersionMutation) SetField ¶ added in v0.3.0
func (m *LatestVersionMutation) 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 (*LatestVersionMutation) SetOp ¶ added in v0.3.0
func (m *LatestVersionMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*LatestVersionMutation) SetResourceID ¶ added in v0.3.0
func (m *LatestVersionMutation) SetResourceID(id string)
SetResourceID sets the "resource" edge to the Resource entity by id.
func (*LatestVersionMutation) SetUpdatedAt ¶ added in v0.3.0
func (m *LatestVersionMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*LatestVersionMutation) SetVersionID ¶ added in v0.3.0
func (m *LatestVersionMutation) SetVersionID(id int)
SetVersionID sets the "version" edge to the Version entity by id.
func (LatestVersionMutation) Tx ¶ added in v0.3.0
func (m LatestVersionMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*LatestVersionMutation) Type ¶ added in v0.3.0
func (m *LatestVersionMutation) Type() string
Type returns the node type of this mutation (LatestVersion).
func (*LatestVersionMutation) UpdatedAt ¶ added in v0.3.0
func (m *LatestVersionMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*LatestVersionMutation) VersionCleared ¶ added in v0.3.0
func (m *LatestVersionMutation) VersionCleared() bool
VersionCleared reports if the "version" edge to the Version entity was cleared.
func (*LatestVersionMutation) VersionID ¶ added in v0.3.0
func (m *LatestVersionMutation) VersionID() (id int, exists bool)
VersionID returns the "version" edge ID in the mutation.
func (*LatestVersionMutation) VersionIDs ¶ added in v0.3.0
func (m *LatestVersionMutation) VersionIDs() (ids []int)
VersionIDs returns the "version" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use VersionID instead. It exists only for internal usage by the builders.
func (*LatestVersionMutation) Where ¶ added in v0.3.0
func (m *LatestVersionMutation) Where(ps ...predicate.LatestVersion)
Where appends a list predicates to the LatestVersionMutation builder.
func (*LatestVersionMutation) WhereP ¶ added in v0.3.0
func (m *LatestVersionMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the LatestVersionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type LatestVersionQuery ¶ added in v0.3.0
type LatestVersionQuery struct {
// contains filtered or unexported fields
}
LatestVersionQuery is the builder for querying LatestVersion entities.
func (*LatestVersionQuery) Aggregate ¶ added in v0.3.0
func (lvq *LatestVersionQuery) Aggregate(fns ...AggregateFunc) *LatestVersionSelect
Aggregate returns a LatestVersionSelect configured with the given aggregations.
func (*LatestVersionQuery) All ¶ added in v0.3.0
func (lvq *LatestVersionQuery) All(ctx context.Context) ([]*LatestVersion, error)
All executes the query and returns a list of LatestVersions.
func (*LatestVersionQuery) AllX ¶ added in v0.3.0
func (lvq *LatestVersionQuery) AllX(ctx context.Context) []*LatestVersion
AllX is like All, but panics if an error occurs.
func (*LatestVersionQuery) Clone ¶ added in v0.3.0
func (lvq *LatestVersionQuery) Clone() *LatestVersionQuery
Clone returns a duplicate of the LatestVersionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*LatestVersionQuery) Count ¶ added in v0.3.0
func (lvq *LatestVersionQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*LatestVersionQuery) CountX ¶ added in v0.3.0
func (lvq *LatestVersionQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*LatestVersionQuery) Exist ¶ added in v0.3.0
func (lvq *LatestVersionQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*LatestVersionQuery) ExistX ¶ added in v0.3.0
func (lvq *LatestVersionQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*LatestVersionQuery) First ¶ added in v0.3.0
func (lvq *LatestVersionQuery) First(ctx context.Context) (*LatestVersion, error)
First returns the first LatestVersion entity from the query. Returns a *NotFoundError when no LatestVersion was found.
func (*LatestVersionQuery) FirstID ¶ added in v0.3.0
func (lvq *LatestVersionQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first LatestVersion ID from the query. Returns a *NotFoundError when no LatestVersion ID was found.
func (*LatestVersionQuery) FirstIDX ¶ added in v0.3.0
func (lvq *LatestVersionQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*LatestVersionQuery) FirstX ¶ added in v0.3.0
func (lvq *LatestVersionQuery) FirstX(ctx context.Context) *LatestVersion
FirstX is like First, but panics if an error occurs.
func (*LatestVersionQuery) GroupBy ¶ added in v0.3.0
func (lvq *LatestVersionQuery) GroupBy(field string, fields ...string) *LatestVersionGroupBy
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 {
Channel latestversion.Channel `json:"channel,omitempty"`
Count int `json:"count,omitempty"`
}
client.LatestVersion.Query().
GroupBy(latestversion.FieldChannel).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*LatestVersionQuery) IDs ¶ added in v0.3.0
func (lvq *LatestVersionQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of LatestVersion IDs.
func (*LatestVersionQuery) IDsX ¶ added in v0.3.0
func (lvq *LatestVersionQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*LatestVersionQuery) Limit ¶ added in v0.3.0
func (lvq *LatestVersionQuery) Limit(limit int) *LatestVersionQuery
Limit the number of records to be returned by this query.
func (*LatestVersionQuery) Offset ¶ added in v0.3.0
func (lvq *LatestVersionQuery) Offset(offset int) *LatestVersionQuery
Offset to start from.
func (*LatestVersionQuery) Only ¶ added in v0.3.0
func (lvq *LatestVersionQuery) Only(ctx context.Context) (*LatestVersion, error)
Only returns a single LatestVersion entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one LatestVersion entity is found. Returns a *NotFoundError when no LatestVersion entities are found.
func (*LatestVersionQuery) OnlyID ¶ added in v0.3.0
func (lvq *LatestVersionQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only LatestVersion ID in the query. Returns a *NotSingularError when more than one LatestVersion ID is found. Returns a *NotFoundError when no entities are found.
func (*LatestVersionQuery) OnlyIDX ¶ added in v0.3.0
func (lvq *LatestVersionQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*LatestVersionQuery) OnlyX ¶ added in v0.3.0
func (lvq *LatestVersionQuery) OnlyX(ctx context.Context) *LatestVersion
OnlyX is like Only, but panics if an error occurs.
func (*LatestVersionQuery) Order ¶ added in v0.3.0
func (lvq *LatestVersionQuery) Order(o ...latestversion.OrderOption) *LatestVersionQuery
Order specifies how the records should be ordered.
func (*LatestVersionQuery) QueryResource ¶ added in v0.3.0
func (lvq *LatestVersionQuery) QueryResource() *ResourceQuery
QueryResource chains the current query on the "resource" edge.
func (*LatestVersionQuery) QueryVersion ¶ added in v0.3.0
func (lvq *LatestVersionQuery) QueryVersion() *VersionQuery
QueryVersion chains the current query on the "version" edge.
func (*LatestVersionQuery) Select ¶ added in v0.3.0
func (lvq *LatestVersionQuery) Select(fields ...string) *LatestVersionSelect
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 {
Channel latestversion.Channel `json:"channel,omitempty"`
}
client.LatestVersion.Query().
Select(latestversion.FieldChannel).
Scan(ctx, &v)
func (*LatestVersionQuery) Unique ¶ added in v0.3.0
func (lvq *LatestVersionQuery) Unique(unique bool) *LatestVersionQuery
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 (*LatestVersionQuery) Where ¶ added in v0.3.0
func (lvq *LatestVersionQuery) Where(ps ...predicate.LatestVersion) *LatestVersionQuery
Where adds a new predicate for the LatestVersionQuery builder.
func (*LatestVersionQuery) WithResource ¶ added in v0.3.0
func (lvq *LatestVersionQuery) WithResource(opts ...func(*ResourceQuery)) *LatestVersionQuery
WithResource tells the query-builder to eager-load the nodes that are connected to the "resource" edge. The optional arguments are used to configure the query builder of the edge.
func (*LatestVersionQuery) WithVersion ¶ added in v0.3.0
func (lvq *LatestVersionQuery) WithVersion(opts ...func(*VersionQuery)) *LatestVersionQuery
WithVersion tells the query-builder to eager-load the nodes that are connected to the "version" edge. The optional arguments are used to configure the query builder of the edge.
type LatestVersionSelect ¶ added in v0.3.0
type LatestVersionSelect struct {
*LatestVersionQuery
// contains filtered or unexported fields
}
LatestVersionSelect is the builder for selecting fields of LatestVersion entities.
func (*LatestVersionSelect) Aggregate ¶ added in v0.3.0
func (lvs *LatestVersionSelect) Aggregate(fns ...AggregateFunc) *LatestVersionSelect
Aggregate adds the given aggregation functions to the selector query.
func (*LatestVersionSelect) Bool ¶ added in v0.3.0
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*LatestVersionSelect) BoolX ¶ added in v0.3.0
BoolX is like Bool, but panics if an error occurs.
func (*LatestVersionSelect) Bools ¶ added in v0.3.0
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*LatestVersionSelect) BoolsX ¶ added in v0.3.0
BoolsX is like Bools, but panics if an error occurs.
func (*LatestVersionSelect) Float64 ¶ added in v0.3.0
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*LatestVersionSelect) Float64X ¶ added in v0.3.0
Float64X is like Float64, but panics if an error occurs.
func (*LatestVersionSelect) Float64s ¶ added in v0.3.0
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*LatestVersionSelect) Float64sX ¶ added in v0.3.0
Float64sX is like Float64s, but panics if an error occurs.
func (*LatestVersionSelect) Int ¶ added in v0.3.0
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*LatestVersionSelect) Ints ¶ added in v0.3.0
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*LatestVersionSelect) IntsX ¶ added in v0.3.0
IntsX is like Ints, but panics if an error occurs.
func (*LatestVersionSelect) Scan ¶ added in v0.3.0
func (lvs *LatestVersionSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*LatestVersionSelect) ScanX ¶ added in v0.3.0
ScanX is like Scan, but panics if an error occurs.
func (*LatestVersionSelect) String ¶ added in v0.3.0
String returns a single string from a selector. It is only allowed when selecting one field.
func (*LatestVersionSelect) StringX ¶ added in v0.3.0
StringX is like String, but panics if an error occurs.
type LatestVersionUpdate ¶ added in v0.3.0
type LatestVersionUpdate struct {
// contains filtered or unexported fields
}
LatestVersionUpdate is the builder for updating LatestVersion entities.
func (*LatestVersionUpdate) ClearResource ¶ added in v0.3.0
func (lvu *LatestVersionUpdate) ClearResource() *LatestVersionUpdate
ClearResource clears the "resource" edge to the Resource entity.
func (*LatestVersionUpdate) ClearVersion ¶ added in v0.3.0
func (lvu *LatestVersionUpdate) ClearVersion() *LatestVersionUpdate
ClearVersion clears the "version" edge to the Version entity.
func (*LatestVersionUpdate) Exec ¶ added in v0.3.0
func (lvu *LatestVersionUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*LatestVersionUpdate) ExecX ¶ added in v0.3.0
func (lvu *LatestVersionUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LatestVersionUpdate) Mutation ¶ added in v0.3.0
func (lvu *LatestVersionUpdate) Mutation() *LatestVersionMutation
Mutation returns the LatestVersionMutation object of the builder.
func (*LatestVersionUpdate) Save ¶ added in v0.3.0
func (lvu *LatestVersionUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*LatestVersionUpdate) SaveX ¶ added in v0.3.0
func (lvu *LatestVersionUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*LatestVersionUpdate) SetChannel ¶ added in v0.3.0
func (lvu *LatestVersionUpdate) SetChannel(l latestversion.Channel) *LatestVersionUpdate
SetChannel sets the "channel" field.
func (*LatestVersionUpdate) SetNillableChannel ¶ added in v0.3.0
func (lvu *LatestVersionUpdate) SetNillableChannel(l *latestversion.Channel) *LatestVersionUpdate
SetNillableChannel sets the "channel" field if the given value is not nil.
func (*LatestVersionUpdate) SetResource ¶ added in v0.3.0
func (lvu *LatestVersionUpdate) SetResource(r *Resource) *LatestVersionUpdate
SetResource sets the "resource" edge to the Resource entity.
func (*LatestVersionUpdate) SetResourceID ¶ added in v0.3.0
func (lvu *LatestVersionUpdate) SetResourceID(id string) *LatestVersionUpdate
SetResourceID sets the "resource" edge to the Resource entity by ID.
func (*LatestVersionUpdate) SetUpdatedAt ¶ added in v0.3.0
func (lvu *LatestVersionUpdate) SetUpdatedAt(t time.Time) *LatestVersionUpdate
SetUpdatedAt sets the "updated_at" field.
func (*LatestVersionUpdate) SetVersion ¶ added in v0.3.0
func (lvu *LatestVersionUpdate) SetVersion(v *Version) *LatestVersionUpdate
SetVersion sets the "version" edge to the Version entity.
func (*LatestVersionUpdate) SetVersionID ¶ added in v0.3.0
func (lvu *LatestVersionUpdate) SetVersionID(id int) *LatestVersionUpdate
SetVersionID sets the "version" edge to the Version entity by ID.
func (*LatestVersionUpdate) Where ¶ added in v0.3.0
func (lvu *LatestVersionUpdate) Where(ps ...predicate.LatestVersion) *LatestVersionUpdate
Where appends a list predicates to the LatestVersionUpdate builder.
type LatestVersionUpdateOne ¶ added in v0.3.0
type LatestVersionUpdateOne struct {
// contains filtered or unexported fields
}
LatestVersionUpdateOne is the builder for updating a single LatestVersion entity.
func (*LatestVersionUpdateOne) ClearResource ¶ added in v0.3.0
func (lvuo *LatestVersionUpdateOne) ClearResource() *LatestVersionUpdateOne
ClearResource clears the "resource" edge to the Resource entity.
func (*LatestVersionUpdateOne) ClearVersion ¶ added in v0.3.0
func (lvuo *LatestVersionUpdateOne) ClearVersion() *LatestVersionUpdateOne
ClearVersion clears the "version" edge to the Version entity.
func (*LatestVersionUpdateOne) Exec ¶ added in v0.3.0
func (lvuo *LatestVersionUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*LatestVersionUpdateOne) ExecX ¶ added in v0.3.0
func (lvuo *LatestVersionUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LatestVersionUpdateOne) Mutation ¶ added in v0.3.0
func (lvuo *LatestVersionUpdateOne) Mutation() *LatestVersionMutation
Mutation returns the LatestVersionMutation object of the builder.
func (*LatestVersionUpdateOne) Save ¶ added in v0.3.0
func (lvuo *LatestVersionUpdateOne) Save(ctx context.Context) (*LatestVersion, error)
Save executes the query and returns the updated LatestVersion entity.
func (*LatestVersionUpdateOne) SaveX ¶ added in v0.3.0
func (lvuo *LatestVersionUpdateOne) SaveX(ctx context.Context) *LatestVersion
SaveX is like Save, but panics if an error occurs.
func (*LatestVersionUpdateOne) Select ¶ added in v0.3.0
func (lvuo *LatestVersionUpdateOne) Select(field string, fields ...string) *LatestVersionUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*LatestVersionUpdateOne) SetChannel ¶ added in v0.3.0
func (lvuo *LatestVersionUpdateOne) SetChannel(l latestversion.Channel) *LatestVersionUpdateOne
SetChannel sets the "channel" field.
func (*LatestVersionUpdateOne) SetNillableChannel ¶ added in v0.3.0
func (lvuo *LatestVersionUpdateOne) SetNillableChannel(l *latestversion.Channel) *LatestVersionUpdateOne
SetNillableChannel sets the "channel" field if the given value is not nil.
func (*LatestVersionUpdateOne) SetResource ¶ added in v0.3.0
func (lvuo *LatestVersionUpdateOne) SetResource(r *Resource) *LatestVersionUpdateOne
SetResource sets the "resource" edge to the Resource entity.
func (*LatestVersionUpdateOne) SetResourceID ¶ added in v0.3.0
func (lvuo *LatestVersionUpdateOne) SetResourceID(id string) *LatestVersionUpdateOne
SetResourceID sets the "resource" edge to the Resource entity by ID.
func (*LatestVersionUpdateOne) SetUpdatedAt ¶ added in v0.3.0
func (lvuo *LatestVersionUpdateOne) SetUpdatedAt(t time.Time) *LatestVersionUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*LatestVersionUpdateOne) SetVersion ¶ added in v0.3.0
func (lvuo *LatestVersionUpdateOne) SetVersion(v *Version) *LatestVersionUpdateOne
SetVersion sets the "version" edge to the Version entity.
func (*LatestVersionUpdateOne) SetVersionID ¶ added in v0.3.0
func (lvuo *LatestVersionUpdateOne) SetVersionID(id int) *LatestVersionUpdateOne
SetVersionID sets the "version" edge to the Version entity by ID.
func (*LatestVersionUpdateOne) Where ¶ added in v0.3.0
func (lvuo *LatestVersionUpdateOne) Where(ps ...predicate.LatestVersion) *LatestVersionUpdateOne
Where appends a list predicates to the LatestVersionUpdate builder.
type LatestVersionUpsert ¶ added in v0.3.0
LatestVersionUpsert is the "OnConflict" setter.
func (*LatestVersionUpsert) SetChannel ¶ added in v0.3.0
func (u *LatestVersionUpsert) SetChannel(v latestversion.Channel) *LatestVersionUpsert
SetChannel sets the "channel" field.
func (*LatestVersionUpsert) SetUpdatedAt ¶ added in v0.3.0
func (u *LatestVersionUpsert) SetUpdatedAt(v time.Time) *LatestVersionUpsert
SetUpdatedAt sets the "updated_at" field.
func (*LatestVersionUpsert) UpdateChannel ¶ added in v0.3.0
func (u *LatestVersionUpsert) UpdateChannel() *LatestVersionUpsert
UpdateChannel sets the "channel" field to the value that was provided on create.
func (*LatestVersionUpsert) UpdateUpdatedAt ¶ added in v0.3.0
func (u *LatestVersionUpsert) UpdateUpdatedAt() *LatestVersionUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type LatestVersionUpsertBulk ¶ added in v0.3.0
type LatestVersionUpsertBulk struct {
// contains filtered or unexported fields
}
LatestVersionUpsertBulk is the builder for "upsert"-ing a bulk of LatestVersion nodes.
func (*LatestVersionUpsertBulk) DoNothing ¶ added in v0.3.0
func (u *LatestVersionUpsertBulk) DoNothing() *LatestVersionUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*LatestVersionUpsertBulk) Exec ¶ added in v0.3.0
func (u *LatestVersionUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*LatestVersionUpsertBulk) ExecX ¶ added in v0.3.0
func (u *LatestVersionUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LatestVersionUpsertBulk) Ignore ¶ added in v0.3.0
func (u *LatestVersionUpsertBulk) Ignore() *LatestVersionUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.LatestVersion.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*LatestVersionUpsertBulk) SetChannel ¶ added in v0.3.0
func (u *LatestVersionUpsertBulk) SetChannel(v latestversion.Channel) *LatestVersionUpsertBulk
SetChannel sets the "channel" field.
func (*LatestVersionUpsertBulk) SetUpdatedAt ¶ added in v0.3.0
func (u *LatestVersionUpsertBulk) SetUpdatedAt(v time.Time) *LatestVersionUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*LatestVersionUpsertBulk) Update ¶ added in v0.3.0
func (u *LatestVersionUpsertBulk) Update(set func(*LatestVersionUpsert)) *LatestVersionUpsertBulk
Update allows overriding fields `UPDATE` values. See the LatestVersionCreateBulk.OnConflict documentation for more info.
func (*LatestVersionUpsertBulk) UpdateChannel ¶ added in v0.3.0
func (u *LatestVersionUpsertBulk) UpdateChannel() *LatestVersionUpsertBulk
UpdateChannel sets the "channel" field to the value that was provided on create.
func (*LatestVersionUpsertBulk) UpdateNewValues ¶ added in v0.3.0
func (u *LatestVersionUpsertBulk) UpdateNewValues() *LatestVersionUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.LatestVersion.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*LatestVersionUpsertBulk) UpdateUpdatedAt ¶ added in v0.3.0
func (u *LatestVersionUpsertBulk) UpdateUpdatedAt() *LatestVersionUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type LatestVersionUpsertOne ¶ added in v0.3.0
type LatestVersionUpsertOne struct {
// contains filtered or unexported fields
}
LatestVersionUpsertOne is the builder for "upsert"-ing
one LatestVersion node.
func (*LatestVersionUpsertOne) DoNothing ¶ added in v0.3.0
func (u *LatestVersionUpsertOne) DoNothing() *LatestVersionUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*LatestVersionUpsertOne) Exec ¶ added in v0.3.0
func (u *LatestVersionUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*LatestVersionUpsertOne) ExecX ¶ added in v0.3.0
func (u *LatestVersionUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LatestVersionUpsertOne) ID ¶ added in v0.3.0
func (u *LatestVersionUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*LatestVersionUpsertOne) IDX ¶ added in v0.3.0
func (u *LatestVersionUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*LatestVersionUpsertOne) Ignore ¶ added in v0.3.0
func (u *LatestVersionUpsertOne) Ignore() *LatestVersionUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.LatestVersion.Create().
OnConflict(sql.ResolveWithIgnore()).
Exec(ctx)
func (*LatestVersionUpsertOne) SetChannel ¶ added in v0.3.0
func (u *LatestVersionUpsertOne) SetChannel(v latestversion.Channel) *LatestVersionUpsertOne
SetChannel sets the "channel" field.
func (*LatestVersionUpsertOne) SetUpdatedAt ¶ added in v0.3.0
func (u *LatestVersionUpsertOne) SetUpdatedAt(v time.Time) *LatestVersionUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*LatestVersionUpsertOne) Update ¶ added in v0.3.0
func (u *LatestVersionUpsertOne) Update(set func(*LatestVersionUpsert)) *LatestVersionUpsertOne
Update allows overriding fields `UPDATE` values. See the LatestVersionCreate.OnConflict documentation for more info.
func (*LatestVersionUpsertOne) UpdateChannel ¶ added in v0.3.0
func (u *LatestVersionUpsertOne) UpdateChannel() *LatestVersionUpsertOne
UpdateChannel sets the "channel" field to the value that was provided on create.
func (*LatestVersionUpsertOne) UpdateNewValues ¶ added in v0.3.0
func (u *LatestVersionUpsertOne) UpdateNewValues() *LatestVersionUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.LatestVersion.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*LatestVersionUpsertOne) UpdateUpdatedAt ¶ added in v0.3.0
func (u *LatestVersionUpsertOne) UpdateUpdatedAt() *LatestVersionUpsertOne
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type LatestVersions ¶ added in v0.3.0
type LatestVersions []*LatestVersion
LatestVersions is a parsable slice of LatestVersion.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type Resource ¶
type Resource struct {
// ID of the ent.
ID string `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"`
// 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 ResourceQuery when eager-loading is set.
Edges ResourceEdges `json:"edges"`
// contains filtered or unexported fields
}
Resource is the model entity for the Resource schema.
func (*Resource) QueryLatestVersions ¶ added in v0.3.0
func (r *Resource) QueryLatestVersions() *LatestVersionQuery
QueryLatestVersions queries the "latest_versions" edge of the Resource entity.
func (*Resource) QueryVersions ¶
func (r *Resource) QueryVersions() *VersionQuery
QueryVersions queries the "versions" edge of the Resource entity.
func (*Resource) Unwrap ¶
Unwrap unwraps the Resource 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 (*Resource) Update ¶
func (r *Resource) Update() *ResourceUpdateOne
Update returns a builder for updating this Resource. Note that you need to call Resource.Unwrap() before calling this method if this Resource was returned from a transaction, and the transaction was committed or rolled back.
type ResourceClient ¶
type ResourceClient struct {
// contains filtered or unexported fields
}
ResourceClient is a client for the Resource schema.
func NewResourceClient ¶
func NewResourceClient(c config) *ResourceClient
NewResourceClient returns a client for the Resource from the given config.
func (*ResourceClient) Create ¶
func (c *ResourceClient) Create() *ResourceCreate
Create returns a builder for creating a Resource entity.
func (*ResourceClient) CreateBulk ¶
func (c *ResourceClient) CreateBulk(builders ...*ResourceCreate) *ResourceCreateBulk
CreateBulk returns a builder for creating a bulk of Resource entities.
func (*ResourceClient) Delete ¶
func (c *ResourceClient) Delete() *ResourceDelete
Delete returns a delete builder for Resource.
func (*ResourceClient) DeleteOne ¶
func (c *ResourceClient) DeleteOne(r *Resource) *ResourceDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ResourceClient) DeleteOneID ¶
func (c *ResourceClient) DeleteOneID(id string) *ResourceDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ResourceClient) GetX ¶
func (c *ResourceClient) GetX(ctx context.Context, id string) *Resource
GetX is like Get, but panics if an error occurs.
func (*ResourceClient) Hooks ¶
func (c *ResourceClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ResourceClient) Intercept ¶
func (c *ResourceClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `resource.Intercept(f(g(h())))`.
func (*ResourceClient) Interceptors ¶
func (c *ResourceClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ResourceClient) MapCreateBulk ¶
func (c *ResourceClient) MapCreateBulk(slice any, setFunc func(*ResourceCreate, int)) *ResourceCreateBulk
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 (*ResourceClient) Query ¶
func (c *ResourceClient) Query() *ResourceQuery
Query returns a query builder for Resource.
func (*ResourceClient) QueryLatestVersions ¶ added in v0.3.0
func (c *ResourceClient) QueryLatestVersions(r *Resource) *LatestVersionQuery
QueryLatestVersions queries the latest_versions edge of a Resource.
func (*ResourceClient) QueryVersions ¶
func (c *ResourceClient) QueryVersions(r *Resource) *VersionQuery
QueryVersions queries the versions edge of a Resource.
func (*ResourceClient) Update ¶
func (c *ResourceClient) Update() *ResourceUpdate
Update returns an update builder for Resource.
func (*ResourceClient) UpdateOne ¶
func (c *ResourceClient) UpdateOne(r *Resource) *ResourceUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ResourceClient) UpdateOneID ¶
func (c *ResourceClient) UpdateOneID(id string) *ResourceUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ResourceClient) Use ¶
func (c *ResourceClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `resource.Hooks(f(g(h())))`.
type ResourceCreate ¶
type ResourceCreate struct {
// contains filtered or unexported fields
}
ResourceCreate is the builder for creating a Resource entity.
func (*ResourceCreate) AddLatestVersionIDs ¶ added in v0.3.0
func (rc *ResourceCreate) AddLatestVersionIDs(ids ...int) *ResourceCreate
AddLatestVersionIDs adds the "latest_versions" edge to the LatestVersion entity by IDs.
func (*ResourceCreate) AddLatestVersions ¶ added in v0.3.0
func (rc *ResourceCreate) AddLatestVersions(l ...*LatestVersion) *ResourceCreate
AddLatestVersions adds the "latest_versions" edges to the LatestVersion entity.
func (*ResourceCreate) AddVersionIDs ¶
func (rc *ResourceCreate) AddVersionIDs(ids ...int) *ResourceCreate
AddVersionIDs adds the "versions" edge to the Version entity by IDs.
func (*ResourceCreate) AddVersions ¶
func (rc *ResourceCreate) AddVersions(v ...*Version) *ResourceCreate
AddVersions adds the "versions" edges to the Version entity.
func (*ResourceCreate) Exec ¶
func (rc *ResourceCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ResourceCreate) ExecX ¶
func (rc *ResourceCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ResourceCreate) Mutation ¶
func (rc *ResourceCreate) Mutation() *ResourceMutation
Mutation returns the ResourceMutation object of the builder.
func (*ResourceCreate) OnConflict ¶ added in v0.3.0
func (rc *ResourceCreate) OnConflict(opts ...sql.ConflictOption) *ResourceUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Resource.Create().
SetName(v).
OnConflict(
// Update the row with the new values
// the was proposed for insertion.
sql.ResolveWithNewValues(),
).
// Override some of the fields with custom
// update values.
Update(func(u *ent.ResourceUpsert) {
SetName(v+v).
}).
Exec(ctx)
func (*ResourceCreate) OnConflictColumns ¶ added in v0.3.0
func (rc *ResourceCreate) OnConflictColumns(columns ...string) *ResourceUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Resource.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*ResourceCreate) Save ¶
func (rc *ResourceCreate) Save(ctx context.Context) (*Resource, error)
Save creates the Resource in the database.
func (*ResourceCreate) SaveX ¶
func (rc *ResourceCreate) SaveX(ctx context.Context) *Resource
SaveX calls Save and panics if Save returns an error.
func (*ResourceCreate) SetCreatedAt ¶
func (rc *ResourceCreate) SetCreatedAt(t time.Time) *ResourceCreate
SetCreatedAt sets the "created_at" field.
func (*ResourceCreate) SetDescription ¶
func (rc *ResourceCreate) SetDescription(s string) *ResourceCreate
SetDescription sets the "description" field.
func (*ResourceCreate) SetID ¶ added in v0.2.0
func (rc *ResourceCreate) SetID(s string) *ResourceCreate
SetID sets the "id" field.
func (*ResourceCreate) SetName ¶
func (rc *ResourceCreate) SetName(s string) *ResourceCreate
SetName sets the "name" field.
func (*ResourceCreate) SetNillableCreatedAt ¶
func (rc *ResourceCreate) SetNillableCreatedAt(t *time.Time) *ResourceCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
type ResourceCreateBulk ¶
type ResourceCreateBulk struct {
// contains filtered or unexported fields
}
ResourceCreateBulk is the builder for creating many Resource entities in bulk.
func (*ResourceCreateBulk) Exec ¶
func (rcb *ResourceCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ResourceCreateBulk) ExecX ¶
func (rcb *ResourceCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ResourceCreateBulk) OnConflict ¶ added in v0.3.0
func (rcb *ResourceCreateBulk) OnConflict(opts ...sql.ConflictOption) *ResourceUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Resource.CreateBulk(builders...).
OnConflict(
// Update the row with the new values
// the was proposed for insertion.
sql.ResolveWithNewValues(),
).
// Override some of the fields with custom
// update values.
Update(func(u *ent.ResourceUpsert) {
SetName(v+v).
}).
Exec(ctx)
func (*ResourceCreateBulk) OnConflictColumns ¶ added in v0.3.0
func (rcb *ResourceCreateBulk) OnConflictColumns(columns ...string) *ResourceUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Resource.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type ResourceDelete ¶
type ResourceDelete struct {
// contains filtered or unexported fields
}
ResourceDelete is the builder for deleting a Resource entity.
func (*ResourceDelete) Exec ¶
func (rd *ResourceDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ResourceDelete) ExecX ¶
func (rd *ResourceDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ResourceDelete) Where ¶
func (rd *ResourceDelete) Where(ps ...predicate.Resource) *ResourceDelete
Where appends a list predicates to the ResourceDelete builder.
type ResourceDeleteOne ¶
type ResourceDeleteOne struct {
// contains filtered or unexported fields
}
ResourceDeleteOne is the builder for deleting a single Resource entity.
func (*ResourceDeleteOne) Exec ¶
func (rdo *ResourceDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ResourceDeleteOne) ExecX ¶
func (rdo *ResourceDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ResourceDeleteOne) Where ¶
func (rdo *ResourceDeleteOne) Where(ps ...predicate.Resource) *ResourceDeleteOne
Where appends a list predicates to the ResourceDelete builder.
type ResourceEdges ¶
type ResourceEdges struct {
// Versions holds the value of the versions edge.
Versions []*Version `json:"versions,omitempty"`
// LatestVersions holds the value of the latest_versions edge.
LatestVersions []*LatestVersion `json:"latest_versions,omitempty"`
// contains filtered or unexported fields
}
ResourceEdges holds the relations/edges for other nodes in the graph.
func (ResourceEdges) LatestVersionsOrErr ¶ added in v0.3.0
func (e ResourceEdges) LatestVersionsOrErr() ([]*LatestVersion, error)
LatestVersionsOrErr returns the LatestVersions value or an error if the edge was not loaded in eager-loading.
func (ResourceEdges) VersionsOrErr ¶
func (e ResourceEdges) VersionsOrErr() ([]*Version, error)
VersionsOrErr returns the Versions value or an error if the edge was not loaded in eager-loading.
type ResourceGroupBy ¶
type ResourceGroupBy struct {
// contains filtered or unexported fields
}
ResourceGroupBy is the group-by builder for Resource entities.
func (*ResourceGroupBy) Aggregate ¶
func (rgb *ResourceGroupBy) Aggregate(fns ...AggregateFunc) *ResourceGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ResourceGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ResourceGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ResourceGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ResourceGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ResourceGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ResourceGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ResourceGroupBy) Scan ¶
func (rgb *ResourceGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ResourceGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ResourceMutation ¶
type ResourceMutation struct {
// contains filtered or unexported fields
}
ResourceMutation represents an operation that mutates the Resource nodes in the graph.
func (*ResourceMutation) AddField ¶
func (m *ResourceMutation) 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 (*ResourceMutation) AddLatestVersionIDs ¶ added in v0.3.0
func (m *ResourceMutation) AddLatestVersionIDs(ids ...int)
AddLatestVersionIDs adds the "latest_versions" edge to the LatestVersion entity by ids.
func (*ResourceMutation) AddVersionIDs ¶
func (m *ResourceMutation) AddVersionIDs(ids ...int)
AddVersionIDs adds the "versions" edge to the Version entity by ids.
func (*ResourceMutation) AddedEdges ¶
func (m *ResourceMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ResourceMutation) AddedField ¶
func (m *ResourceMutation) 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 (*ResourceMutation) AddedFields ¶
func (m *ResourceMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ResourceMutation) AddedIDs ¶
func (m *ResourceMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ResourceMutation) ClearEdge ¶
func (m *ResourceMutation) 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 (*ResourceMutation) ClearField ¶
func (m *ResourceMutation) 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 (*ResourceMutation) ClearLatestVersions ¶ added in v0.3.0
func (m *ResourceMutation) ClearLatestVersions()
ClearLatestVersions clears the "latest_versions" edge to the LatestVersion entity.
func (*ResourceMutation) ClearVersions ¶
func (m *ResourceMutation) ClearVersions()
ClearVersions clears the "versions" edge to the Version entity.
func (*ResourceMutation) ClearedEdges ¶
func (m *ResourceMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ResourceMutation) ClearedFields ¶
func (m *ResourceMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ResourceMutation) Client ¶
func (m ResourceMutation) 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 (*ResourceMutation) CreatedAt ¶
func (m *ResourceMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*ResourceMutation) Description ¶
func (m *ResourceMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*ResourceMutation) EdgeCleared ¶
func (m *ResourceMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ResourceMutation) Field ¶
func (m *ResourceMutation) 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 (*ResourceMutation) FieldCleared ¶
func (m *ResourceMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ResourceMutation) Fields ¶
func (m *ResourceMutation) 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 (*ResourceMutation) ID ¶
func (m *ResourceMutation) ID() (id string, 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 (*ResourceMutation) IDs ¶
func (m *ResourceMutation) IDs(ctx context.Context) ([]string, 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 (*ResourceMutation) LatestVersionsCleared ¶ added in v0.3.0
func (m *ResourceMutation) LatestVersionsCleared() bool
LatestVersionsCleared reports if the "latest_versions" edge to the LatestVersion entity was cleared.
func (*ResourceMutation) LatestVersionsIDs ¶ added in v0.3.0
func (m *ResourceMutation) LatestVersionsIDs() (ids []int)
LatestVersionsIDs returns the "latest_versions" edge IDs in the mutation.
func (*ResourceMutation) Name ¶
func (m *ResourceMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*ResourceMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Resource entity. If the Resource 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 (*ResourceMutation) OldDescription ¶
func (m *ResourceMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Resource entity. If the Resource 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 (*ResourceMutation) 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 (*ResourceMutation) OldName ¶
func (m *ResourceMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Resource entity. If the Resource 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 (*ResourceMutation) RemoveLatestVersionIDs ¶ added in v0.3.0
func (m *ResourceMutation) RemoveLatestVersionIDs(ids ...int)
RemoveLatestVersionIDs removes the "latest_versions" edge to the LatestVersion entity by IDs.
func (*ResourceMutation) RemoveVersionIDs ¶
func (m *ResourceMutation) RemoveVersionIDs(ids ...int)
RemoveVersionIDs removes the "versions" edge to the Version entity by IDs.
func (*ResourceMutation) RemovedEdges ¶
func (m *ResourceMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ResourceMutation) RemovedIDs ¶
func (m *ResourceMutation) 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 (*ResourceMutation) RemovedLatestVersionsIDs ¶ added in v0.3.0
func (m *ResourceMutation) RemovedLatestVersionsIDs() (ids []int)
RemovedLatestVersions returns the removed IDs of the "latest_versions" edge to the LatestVersion entity.
func (*ResourceMutation) RemovedVersionsIDs ¶
func (m *ResourceMutation) RemovedVersionsIDs() (ids []int)
RemovedVersions returns the removed IDs of the "versions" edge to the Version entity.
func (*ResourceMutation) ResetCreatedAt ¶
func (m *ResourceMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*ResourceMutation) ResetDescription ¶
func (m *ResourceMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*ResourceMutation) ResetEdge ¶
func (m *ResourceMutation) 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 (*ResourceMutation) ResetField ¶
func (m *ResourceMutation) 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 (*ResourceMutation) ResetLatestVersions ¶ added in v0.3.0
func (m *ResourceMutation) ResetLatestVersions()
ResetLatestVersions resets all changes to the "latest_versions" edge.
func (*ResourceMutation) ResetName ¶
func (m *ResourceMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*ResourceMutation) ResetVersions ¶
func (m *ResourceMutation) ResetVersions()
ResetVersions resets all changes to the "versions" edge.
func (*ResourceMutation) SetCreatedAt ¶
func (m *ResourceMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*ResourceMutation) SetDescription ¶
func (m *ResourceMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*ResourceMutation) SetField ¶
func (m *ResourceMutation) 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 (*ResourceMutation) SetID ¶ added in v0.2.0
func (m *ResourceMutation) SetID(id string)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Resource entities.
func (*ResourceMutation) SetName ¶
func (m *ResourceMutation) SetName(s string)
SetName sets the "name" field.
func (*ResourceMutation) SetOp ¶
func (m *ResourceMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (ResourceMutation) Tx ¶
func (m ResourceMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ResourceMutation) Type ¶
func (m *ResourceMutation) Type() string
Type returns the node type of this mutation (Resource).
func (*ResourceMutation) VersionsCleared ¶
func (m *ResourceMutation) VersionsCleared() bool
VersionsCleared reports if the "versions" edge to the Version entity was cleared.
func (*ResourceMutation) VersionsIDs ¶
func (m *ResourceMutation) VersionsIDs() (ids []int)
VersionsIDs returns the "versions" edge IDs in the mutation.
func (*ResourceMutation) Where ¶
func (m *ResourceMutation) Where(ps ...predicate.Resource)
Where appends a list predicates to the ResourceMutation builder.
func (*ResourceMutation) WhereP ¶
func (m *ResourceMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ResourceMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ResourceQuery ¶
type ResourceQuery struct {
// contains filtered or unexported fields
}
ResourceQuery is the builder for querying Resource entities.
func (*ResourceQuery) Aggregate ¶
func (rq *ResourceQuery) Aggregate(fns ...AggregateFunc) *ResourceSelect
Aggregate returns a ResourceSelect configured with the given aggregations.
func (*ResourceQuery) All ¶
func (rq *ResourceQuery) All(ctx context.Context) ([]*Resource, error)
All executes the query and returns a list of Resources.
func (*ResourceQuery) AllX ¶
func (rq *ResourceQuery) AllX(ctx context.Context) []*Resource
AllX is like All, but panics if an error occurs.
func (*ResourceQuery) Clone ¶
func (rq *ResourceQuery) Clone() *ResourceQuery
Clone returns a duplicate of the ResourceQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ResourceQuery) Count ¶
func (rq *ResourceQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ResourceQuery) CountX ¶
func (rq *ResourceQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ResourceQuery) Exist ¶
func (rq *ResourceQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ResourceQuery) ExistX ¶
func (rq *ResourceQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ResourceQuery) First ¶
func (rq *ResourceQuery) First(ctx context.Context) (*Resource, error)
First returns the first Resource entity from the query. Returns a *NotFoundError when no Resource was found.
func (*ResourceQuery) FirstID ¶
func (rq *ResourceQuery) FirstID(ctx context.Context) (id string, err error)
FirstID returns the first Resource ID from the query. Returns a *NotFoundError when no Resource ID was found.
func (*ResourceQuery) FirstIDX ¶
func (rq *ResourceQuery) FirstIDX(ctx context.Context) string
FirstIDX is like FirstID, but panics if an error occurs.
func (*ResourceQuery) FirstX ¶
func (rq *ResourceQuery) FirstX(ctx context.Context) *Resource
FirstX is like First, but panics if an error occurs.
func (*ResourceQuery) GroupBy ¶
func (rq *ResourceQuery) GroupBy(field string, fields ...string) *ResourceGroupBy
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.Resource.Query().
GroupBy(resource.FieldName).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*ResourceQuery) IDs ¶
func (rq *ResourceQuery) IDs(ctx context.Context) (ids []string, err error)
IDs executes the query and returns a list of Resource IDs.
func (*ResourceQuery) IDsX ¶
func (rq *ResourceQuery) IDsX(ctx context.Context) []string
IDsX is like IDs, but panics if an error occurs.
func (*ResourceQuery) Limit ¶
func (rq *ResourceQuery) Limit(limit int) *ResourceQuery
Limit the number of records to be returned by this query.
func (*ResourceQuery) Offset ¶
func (rq *ResourceQuery) Offset(offset int) *ResourceQuery
Offset to start from.
func (*ResourceQuery) Only ¶
func (rq *ResourceQuery) Only(ctx context.Context) (*Resource, error)
Only returns a single Resource entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Resource entity is found. Returns a *NotFoundError when no Resource entities are found.
func (*ResourceQuery) OnlyID ¶
func (rq *ResourceQuery) OnlyID(ctx context.Context) (id string, err error)
OnlyID is like Only, but returns the only Resource ID in the query. Returns a *NotSingularError when more than one Resource ID is found. Returns a *NotFoundError when no entities are found.
func (*ResourceQuery) OnlyIDX ¶
func (rq *ResourceQuery) OnlyIDX(ctx context.Context) string
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ResourceQuery) OnlyX ¶
func (rq *ResourceQuery) OnlyX(ctx context.Context) *Resource
OnlyX is like Only, but panics if an error occurs.
func (*ResourceQuery) Order ¶
func (rq *ResourceQuery) Order(o ...resource.OrderOption) *ResourceQuery
Order specifies how the records should be ordered.
func (*ResourceQuery) QueryLatestVersions ¶ added in v0.3.0
func (rq *ResourceQuery) QueryLatestVersions() *LatestVersionQuery
QueryLatestVersions chains the current query on the "latest_versions" edge.
func (*ResourceQuery) QueryVersions ¶
func (rq *ResourceQuery) QueryVersions() *VersionQuery
QueryVersions chains the current query on the "versions" edge.
func (*ResourceQuery) Select ¶
func (rq *ResourceQuery) Select(fields ...string) *ResourceSelect
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.Resource.Query().
Select(resource.FieldName).
Scan(ctx, &v)
func (*ResourceQuery) Unique ¶
func (rq *ResourceQuery) Unique(unique bool) *ResourceQuery
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 (*ResourceQuery) Where ¶
func (rq *ResourceQuery) Where(ps ...predicate.Resource) *ResourceQuery
Where adds a new predicate for the ResourceQuery builder.
func (*ResourceQuery) WithLatestVersions ¶ added in v0.3.0
func (rq *ResourceQuery) WithLatestVersions(opts ...func(*LatestVersionQuery)) *ResourceQuery
WithLatestVersions tells the query-builder to eager-load the nodes that are connected to the "latest_versions" edge. The optional arguments are used to configure the query builder of the edge.
func (*ResourceQuery) WithVersions ¶
func (rq *ResourceQuery) WithVersions(opts ...func(*VersionQuery)) *ResourceQuery
WithVersions tells the query-builder to eager-load the nodes that are connected to the "versions" edge. The optional arguments are used to configure the query builder of the edge.
type ResourceSelect ¶
type ResourceSelect struct {
*ResourceQuery
// contains filtered or unexported fields
}
ResourceSelect is the builder for selecting fields of Resource entities.
func (*ResourceSelect) Aggregate ¶
func (rs *ResourceSelect) Aggregate(fns ...AggregateFunc) *ResourceSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ResourceSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ResourceSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ResourceSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ResourceSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ResourceSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ResourceSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ResourceSelect) Scan ¶
func (rs *ResourceSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ResourceSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ResourceUpdate ¶
type ResourceUpdate struct {
// contains filtered or unexported fields
}
ResourceUpdate is the builder for updating Resource entities.
func (*ResourceUpdate) AddLatestVersionIDs ¶ added in v0.3.0
func (ru *ResourceUpdate) AddLatestVersionIDs(ids ...int) *ResourceUpdate
AddLatestVersionIDs adds the "latest_versions" edge to the LatestVersion entity by IDs.
func (*ResourceUpdate) AddLatestVersions ¶ added in v0.3.0
func (ru *ResourceUpdate) AddLatestVersions(l ...*LatestVersion) *ResourceUpdate
AddLatestVersions adds the "latest_versions" edges to the LatestVersion entity.
func (*ResourceUpdate) AddVersionIDs ¶
func (ru *ResourceUpdate) AddVersionIDs(ids ...int) *ResourceUpdate
AddVersionIDs adds the "versions" edge to the Version entity by IDs.
func (*ResourceUpdate) AddVersions ¶
func (ru *ResourceUpdate) AddVersions(v ...*Version) *ResourceUpdate
AddVersions adds the "versions" edges to the Version entity.
func (*ResourceUpdate) ClearLatestVersions ¶ added in v0.3.0
func (ru *ResourceUpdate) ClearLatestVersions() *ResourceUpdate
ClearLatestVersions clears all "latest_versions" edges to the LatestVersion entity.
func (*ResourceUpdate) ClearVersions ¶
func (ru *ResourceUpdate) ClearVersions() *ResourceUpdate
ClearVersions clears all "versions" edges to the Version entity.
func (*ResourceUpdate) Exec ¶
func (ru *ResourceUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ResourceUpdate) ExecX ¶
func (ru *ResourceUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ResourceUpdate) Mutation ¶
func (ru *ResourceUpdate) Mutation() *ResourceMutation
Mutation returns the ResourceMutation object of the builder.
func (*ResourceUpdate) RemoveLatestVersionIDs ¶ added in v0.3.0
func (ru *ResourceUpdate) RemoveLatestVersionIDs(ids ...int) *ResourceUpdate
RemoveLatestVersionIDs removes the "latest_versions" edge to LatestVersion entities by IDs.
func (*ResourceUpdate) RemoveLatestVersions ¶ added in v0.3.0
func (ru *ResourceUpdate) RemoveLatestVersions(l ...*LatestVersion) *ResourceUpdate
RemoveLatestVersions removes "latest_versions" edges to LatestVersion entities.
func (*ResourceUpdate) RemoveVersionIDs ¶
func (ru *ResourceUpdate) RemoveVersionIDs(ids ...int) *ResourceUpdate
RemoveVersionIDs removes the "versions" edge to Version entities by IDs.
func (*ResourceUpdate) RemoveVersions ¶
func (ru *ResourceUpdate) RemoveVersions(v ...*Version) *ResourceUpdate
RemoveVersions removes "versions" edges to Version entities.
func (*ResourceUpdate) Save ¶
func (ru *ResourceUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ResourceUpdate) SaveX ¶
func (ru *ResourceUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ResourceUpdate) SetCreatedAt ¶
func (ru *ResourceUpdate) SetCreatedAt(t time.Time) *ResourceUpdate
SetCreatedAt sets the "created_at" field.
func (*ResourceUpdate) SetDescription ¶
func (ru *ResourceUpdate) SetDescription(s string) *ResourceUpdate
SetDescription sets the "description" field.
func (*ResourceUpdate) SetName ¶
func (ru *ResourceUpdate) SetName(s string) *ResourceUpdate
SetName sets the "name" field.
func (*ResourceUpdate) SetNillableCreatedAt ¶
func (ru *ResourceUpdate) SetNillableCreatedAt(t *time.Time) *ResourceUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ResourceUpdate) SetNillableDescription ¶
func (ru *ResourceUpdate) SetNillableDescription(s *string) *ResourceUpdate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*ResourceUpdate) SetNillableName ¶
func (ru *ResourceUpdate) SetNillableName(s *string) *ResourceUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*ResourceUpdate) Where ¶
func (ru *ResourceUpdate) Where(ps ...predicate.Resource) *ResourceUpdate
Where appends a list predicates to the ResourceUpdate builder.
type ResourceUpdateOne ¶
type ResourceUpdateOne struct {
// contains filtered or unexported fields
}
ResourceUpdateOne is the builder for updating a single Resource entity.
func (*ResourceUpdateOne) AddLatestVersionIDs ¶ added in v0.3.0
func (ruo *ResourceUpdateOne) AddLatestVersionIDs(ids ...int) *ResourceUpdateOne
AddLatestVersionIDs adds the "latest_versions" edge to the LatestVersion entity by IDs.
func (*ResourceUpdateOne) AddLatestVersions ¶ added in v0.3.0
func (ruo *ResourceUpdateOne) AddLatestVersions(l ...*LatestVersion) *ResourceUpdateOne
AddLatestVersions adds the "latest_versions" edges to the LatestVersion entity.
func (*ResourceUpdateOne) AddVersionIDs ¶
func (ruo *ResourceUpdateOne) AddVersionIDs(ids ...int) *ResourceUpdateOne
AddVersionIDs adds the "versions" edge to the Version entity by IDs.
func (*ResourceUpdateOne) AddVersions ¶
func (ruo *ResourceUpdateOne) AddVersions(v ...*Version) *ResourceUpdateOne
AddVersions adds the "versions" edges to the Version entity.
func (*ResourceUpdateOne) ClearLatestVersions ¶ added in v0.3.0
func (ruo *ResourceUpdateOne) ClearLatestVersions() *ResourceUpdateOne
ClearLatestVersions clears all "latest_versions" edges to the LatestVersion entity.
func (*ResourceUpdateOne) ClearVersions ¶
func (ruo *ResourceUpdateOne) ClearVersions() *ResourceUpdateOne
ClearVersions clears all "versions" edges to the Version entity.
func (*ResourceUpdateOne) Exec ¶
func (ruo *ResourceUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ResourceUpdateOne) ExecX ¶
func (ruo *ResourceUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ResourceUpdateOne) Mutation ¶
func (ruo *ResourceUpdateOne) Mutation() *ResourceMutation
Mutation returns the ResourceMutation object of the builder.
func (*ResourceUpdateOne) RemoveLatestVersionIDs ¶ added in v0.3.0
func (ruo *ResourceUpdateOne) RemoveLatestVersionIDs(ids ...int) *ResourceUpdateOne
RemoveLatestVersionIDs removes the "latest_versions" edge to LatestVersion entities by IDs.
func (*ResourceUpdateOne) RemoveLatestVersions ¶ added in v0.3.0
func (ruo *ResourceUpdateOne) RemoveLatestVersions(l ...*LatestVersion) *ResourceUpdateOne
RemoveLatestVersions removes "latest_versions" edges to LatestVersion entities.
func (*ResourceUpdateOne) RemoveVersionIDs ¶
func (ruo *ResourceUpdateOne) RemoveVersionIDs(ids ...int) *ResourceUpdateOne
RemoveVersionIDs removes the "versions" edge to Version entities by IDs.
func (*ResourceUpdateOne) RemoveVersions ¶
func (ruo *ResourceUpdateOne) RemoveVersions(v ...*Version) *ResourceUpdateOne
RemoveVersions removes "versions" edges to Version entities.
func (*ResourceUpdateOne) Save ¶
func (ruo *ResourceUpdateOne) Save(ctx context.Context) (*Resource, error)
Save executes the query and returns the updated Resource entity.
func (*ResourceUpdateOne) SaveX ¶
func (ruo *ResourceUpdateOne) SaveX(ctx context.Context) *Resource
SaveX is like Save, but panics if an error occurs.
func (*ResourceUpdateOne) Select ¶
func (ruo *ResourceUpdateOne) Select(field string, fields ...string) *ResourceUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ResourceUpdateOne) SetCreatedAt ¶
func (ruo *ResourceUpdateOne) SetCreatedAt(t time.Time) *ResourceUpdateOne
SetCreatedAt sets the "created_at" field.
func (*ResourceUpdateOne) SetDescription ¶
func (ruo *ResourceUpdateOne) SetDescription(s string) *ResourceUpdateOne
SetDescription sets the "description" field.
func (*ResourceUpdateOne) SetName ¶
func (ruo *ResourceUpdateOne) SetName(s string) *ResourceUpdateOne
SetName sets the "name" field.
func (*ResourceUpdateOne) SetNillableCreatedAt ¶
func (ruo *ResourceUpdateOne) SetNillableCreatedAt(t *time.Time) *ResourceUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ResourceUpdateOne) SetNillableDescription ¶
func (ruo *ResourceUpdateOne) SetNillableDescription(s *string) *ResourceUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*ResourceUpdateOne) SetNillableName ¶
func (ruo *ResourceUpdateOne) SetNillableName(s *string) *ResourceUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*ResourceUpdateOne) Where ¶
func (ruo *ResourceUpdateOne) Where(ps ...predicate.Resource) *ResourceUpdateOne
Where appends a list predicates to the ResourceUpdate builder.
type ResourceUpsert ¶ added in v0.3.0
ResourceUpsert is the "OnConflict" setter.
func (*ResourceUpsert) SetCreatedAt ¶ added in v0.3.0
func (u *ResourceUpsert) SetCreatedAt(v time.Time) *ResourceUpsert
SetCreatedAt sets the "created_at" field.
func (*ResourceUpsert) SetDescription ¶ added in v0.3.0
func (u *ResourceUpsert) SetDescription(v string) *ResourceUpsert
SetDescription sets the "description" field.
func (*ResourceUpsert) SetName ¶ added in v0.3.0
func (u *ResourceUpsert) SetName(v string) *ResourceUpsert
SetName sets the "name" field.
func (*ResourceUpsert) UpdateCreatedAt ¶ added in v0.3.0
func (u *ResourceUpsert) UpdateCreatedAt() *ResourceUpsert
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*ResourceUpsert) UpdateDescription ¶ added in v0.3.0
func (u *ResourceUpsert) UpdateDescription() *ResourceUpsert
UpdateDescription sets the "description" field to the value that was provided on create.
func (*ResourceUpsert) UpdateName ¶ added in v0.3.0
func (u *ResourceUpsert) UpdateName() *ResourceUpsert
UpdateName sets the "name" field to the value that was provided on create.
type ResourceUpsertBulk ¶ added in v0.3.0
type ResourceUpsertBulk struct {
// contains filtered or unexported fields
}
ResourceUpsertBulk is the builder for "upsert"-ing a bulk of Resource nodes.
func (*ResourceUpsertBulk) DoNothing ¶ added in v0.3.0
func (u *ResourceUpsertBulk) DoNothing() *ResourceUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*ResourceUpsertBulk) Exec ¶ added in v0.3.0
func (u *ResourceUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ResourceUpsertBulk) ExecX ¶ added in v0.3.0
func (u *ResourceUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ResourceUpsertBulk) Ignore ¶ added in v0.3.0
func (u *ResourceUpsertBulk) Ignore() *ResourceUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Resource.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*ResourceUpsertBulk) SetCreatedAt ¶ added in v0.3.0
func (u *ResourceUpsertBulk) SetCreatedAt(v time.Time) *ResourceUpsertBulk
SetCreatedAt sets the "created_at" field.
func (*ResourceUpsertBulk) SetDescription ¶ added in v0.3.0
func (u *ResourceUpsertBulk) SetDescription(v string) *ResourceUpsertBulk
SetDescription sets the "description" field.
func (*ResourceUpsertBulk) SetName ¶ added in v0.3.0
func (u *ResourceUpsertBulk) SetName(v string) *ResourceUpsertBulk
SetName sets the "name" field.
func (*ResourceUpsertBulk) Update ¶ added in v0.3.0
func (u *ResourceUpsertBulk) Update(set func(*ResourceUpsert)) *ResourceUpsertBulk
Update allows overriding fields `UPDATE` values. See the ResourceCreateBulk.OnConflict documentation for more info.
func (*ResourceUpsertBulk) UpdateCreatedAt ¶ added in v0.3.0
func (u *ResourceUpsertBulk) UpdateCreatedAt() *ResourceUpsertBulk
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*ResourceUpsertBulk) UpdateDescription ¶ added in v0.3.0
func (u *ResourceUpsertBulk) UpdateDescription() *ResourceUpsertBulk
UpdateDescription sets the "description" field to the value that was provided on create.
func (*ResourceUpsertBulk) UpdateName ¶ added in v0.3.0
func (u *ResourceUpsertBulk) UpdateName() *ResourceUpsertBulk
UpdateName sets the "name" field to the value that was provided on create.
func (*ResourceUpsertBulk) UpdateNewValues ¶ added in v0.3.0
func (u *ResourceUpsertBulk) UpdateNewValues() *ResourceUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Resource.Create().
OnConflict(
sql.ResolveWithNewValues(),
sql.ResolveWith(func(u *sql.UpdateSet) {
u.SetIgnore(resource.FieldID)
}),
).
Exec(ctx)
type ResourceUpsertOne ¶ added in v0.3.0
type ResourceUpsertOne struct {
// contains filtered or unexported fields
}
ResourceUpsertOne is the builder for "upsert"-ing
one Resource node.
func (*ResourceUpsertOne) DoNothing ¶ added in v0.3.0
func (u *ResourceUpsertOne) DoNothing() *ResourceUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*ResourceUpsertOne) Exec ¶ added in v0.3.0
func (u *ResourceUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*ResourceUpsertOne) ExecX ¶ added in v0.3.0
func (u *ResourceUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ResourceUpsertOne) ID ¶ added in v0.3.0
func (u *ResourceUpsertOne) ID(ctx context.Context) (id string, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*ResourceUpsertOne) IDX ¶ added in v0.3.0
func (u *ResourceUpsertOne) IDX(ctx context.Context) string
IDX is like ID, but panics if an error occurs.
func (*ResourceUpsertOne) Ignore ¶ added in v0.3.0
func (u *ResourceUpsertOne) Ignore() *ResourceUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Resource.Create().
OnConflict(sql.ResolveWithIgnore()).
Exec(ctx)
func (*ResourceUpsertOne) SetCreatedAt ¶ added in v0.3.0
func (u *ResourceUpsertOne) SetCreatedAt(v time.Time) *ResourceUpsertOne
SetCreatedAt sets the "created_at" field.
func (*ResourceUpsertOne) SetDescription ¶ added in v0.3.0
func (u *ResourceUpsertOne) SetDescription(v string) *ResourceUpsertOne
SetDescription sets the "description" field.
func (*ResourceUpsertOne) SetName ¶ added in v0.3.0
func (u *ResourceUpsertOne) SetName(v string) *ResourceUpsertOne
SetName sets the "name" field.
func (*ResourceUpsertOne) Update ¶ added in v0.3.0
func (u *ResourceUpsertOne) Update(set func(*ResourceUpsert)) *ResourceUpsertOne
Update allows overriding fields `UPDATE` values. See the ResourceCreate.OnConflict documentation for more info.
func (*ResourceUpsertOne) UpdateCreatedAt ¶ added in v0.3.0
func (u *ResourceUpsertOne) UpdateCreatedAt() *ResourceUpsertOne
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*ResourceUpsertOne) UpdateDescription ¶ added in v0.3.0
func (u *ResourceUpsertOne) UpdateDescription() *ResourceUpsertOne
UpdateDescription sets the "description" field to the value that was provided on create.
func (*ResourceUpsertOne) UpdateName ¶ added in v0.3.0
func (u *ResourceUpsertOne) UpdateName() *ResourceUpsertOne
UpdateName sets the "name" field to the value that was provided on create.
func (*ResourceUpsertOne) UpdateNewValues ¶ added in v0.3.0
func (u *ResourceUpsertOne) UpdateNewValues() *ResourceUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:
client.Resource.Create().
OnConflict(
sql.ResolveWithNewValues(),
sql.ResolveWith(func(u *sql.UpdateSet) {
u.SetIgnore(resource.FieldID)
}),
).
Exec(ctx)
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 Storage ¶
type Storage struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// UpdateType holds the value of the "update_type" field.
UpdateType storage.UpdateType `json:"update_type,omitempty"`
// Os holds the value of the "os" field.
Os string `json:"os,omitempty"`
// Arch holds the value of the "arch" field.
Arch string `json:"arch,omitempty"`
// PackagePath holds the value of the "package_path" field.
PackagePath string `json:"package_path,omitempty"`
// only for full update
ResourcePath string `json:"resource_path,omitempty"`
// only for full update
FileHashes map[string]string `json:"file_hashes,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 StorageQuery when eager-loading is set.
Edges StorageEdges `json:"edges"`
// contains filtered or unexported fields
}
Storage is the model entity for the Storage schema.
func (*Storage) QueryOldVersion ¶ added in v0.3.0
func (s *Storage) QueryOldVersion() *VersionQuery
QueryOldVersion queries the "old_version" edge of the Storage entity.
func (*Storage) QueryVersion ¶
func (s *Storage) QueryVersion() *VersionQuery
QueryVersion queries the "version" edge of the Storage entity.
func (*Storage) Unwrap ¶
Unwrap unwraps the Storage 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 (*Storage) Update ¶
func (s *Storage) Update() *StorageUpdateOne
Update returns a builder for updating this Storage. Note that you need to call Storage.Unwrap() before calling this method if this Storage was returned from a transaction, and the transaction was committed or rolled back.
type StorageClient ¶
type StorageClient struct {
// contains filtered or unexported fields
}
StorageClient is a client for the Storage schema.
func NewStorageClient ¶
func NewStorageClient(c config) *StorageClient
NewStorageClient returns a client for the Storage from the given config.
func (*StorageClient) Create ¶
func (c *StorageClient) Create() *StorageCreate
Create returns a builder for creating a Storage entity.
func (*StorageClient) CreateBulk ¶
func (c *StorageClient) CreateBulk(builders ...*StorageCreate) *StorageCreateBulk
CreateBulk returns a builder for creating a bulk of Storage entities.
func (*StorageClient) Delete ¶
func (c *StorageClient) Delete() *StorageDelete
Delete returns a delete builder for Storage.
func (*StorageClient) DeleteOne ¶
func (c *StorageClient) DeleteOne(s *Storage) *StorageDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*StorageClient) DeleteOneID ¶
func (c *StorageClient) DeleteOneID(id int) *StorageDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*StorageClient) GetX ¶
func (c *StorageClient) GetX(ctx context.Context, id int) *Storage
GetX is like Get, but panics if an error occurs.
func (*StorageClient) Hooks ¶
func (c *StorageClient) Hooks() []Hook
Hooks returns the client hooks.
func (*StorageClient) Intercept ¶
func (c *StorageClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `storage.Intercept(f(g(h())))`.
func (*StorageClient) Interceptors ¶
func (c *StorageClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*StorageClient) MapCreateBulk ¶
func (c *StorageClient) MapCreateBulk(slice any, setFunc func(*StorageCreate, int)) *StorageCreateBulk
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 (*StorageClient) Query ¶
func (c *StorageClient) Query() *StorageQuery
Query returns a query builder for Storage.
func (*StorageClient) QueryOldVersion ¶ added in v0.3.0
func (c *StorageClient) QueryOldVersion(s *Storage) *VersionQuery
QueryOldVersion queries the old_version edge of a Storage.
func (*StorageClient) QueryVersion ¶
func (c *StorageClient) QueryVersion(s *Storage) *VersionQuery
QueryVersion queries the version edge of a Storage.
func (*StorageClient) Update ¶
func (c *StorageClient) Update() *StorageUpdate
Update returns an update builder for Storage.
func (*StorageClient) UpdateOne ¶
func (c *StorageClient) UpdateOne(s *Storage) *StorageUpdateOne
UpdateOne returns an update builder for the given entity.
func (*StorageClient) UpdateOneID ¶
func (c *StorageClient) UpdateOneID(id int) *StorageUpdateOne
UpdateOneID returns an update builder for the given id.
func (*StorageClient) Use ¶
func (c *StorageClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `storage.Hooks(f(g(h())))`.
type StorageCreate ¶
type StorageCreate struct {
// contains filtered or unexported fields
}
StorageCreate is the builder for creating a Storage entity.
func (*StorageCreate) Exec ¶
func (sc *StorageCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*StorageCreate) ExecX ¶
func (sc *StorageCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*StorageCreate) Mutation ¶
func (sc *StorageCreate) Mutation() *StorageMutation
Mutation returns the StorageMutation object of the builder.
func (*StorageCreate) OnConflict ¶ added in v0.3.0
func (sc *StorageCreate) OnConflict(opts ...sql.ConflictOption) *StorageUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Storage.Create().
SetUpdateType(v).
OnConflict(
// Update the row with the new values
// the was proposed for insertion.
sql.ResolveWithNewValues(),
).
// Override some of the fields with custom
// update values.
Update(func(u *ent.StorageUpsert) {
SetUpdateType(v+v).
}).
Exec(ctx)
func (*StorageCreate) OnConflictColumns ¶ added in v0.3.0
func (sc *StorageCreate) OnConflictColumns(columns ...string) *StorageUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Storage.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*StorageCreate) Save ¶
func (sc *StorageCreate) Save(ctx context.Context) (*Storage, error)
Save creates the Storage in the database.
func (*StorageCreate) SaveX ¶
func (sc *StorageCreate) SaveX(ctx context.Context) *Storage
SaveX calls Save and panics if Save returns an error.
func (*StorageCreate) SetArch ¶ added in v0.3.0
func (sc *StorageCreate) SetArch(s string) *StorageCreate
SetArch sets the "arch" field.
func (*StorageCreate) SetCreatedAt ¶
func (sc *StorageCreate) SetCreatedAt(t time.Time) *StorageCreate
SetCreatedAt sets the "created_at" field.
func (*StorageCreate) SetFileHashes ¶ added in v0.3.0
func (sc *StorageCreate) SetFileHashes(m map[string]string) *StorageCreate
SetFileHashes sets the "file_hashes" field.
func (*StorageCreate) SetNillableArch ¶ added in v0.3.0
func (sc *StorageCreate) SetNillableArch(s *string) *StorageCreate
SetNillableArch sets the "arch" field if the given value is not nil.
func (*StorageCreate) SetNillableCreatedAt ¶
func (sc *StorageCreate) SetNillableCreatedAt(t *time.Time) *StorageCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*StorageCreate) SetNillableOldVersionID ¶ added in v0.3.0
func (sc *StorageCreate) SetNillableOldVersionID(id *int) *StorageCreate
SetNillableOldVersionID sets the "old_version" edge to the Version entity by ID if the given value is not nil.
func (*StorageCreate) SetNillableOs ¶ added in v0.3.0
func (sc *StorageCreate) SetNillableOs(s *string) *StorageCreate
SetNillableOs sets the "os" field if the given value is not nil.
func (*StorageCreate) SetNillablePackagePath ¶ added in v0.3.0
func (sc *StorageCreate) SetNillablePackagePath(s *string) *StorageCreate
SetNillablePackagePath sets the "package_path" field if the given value is not nil.
func (*StorageCreate) SetNillableResourcePath ¶ added in v0.3.0
func (sc *StorageCreate) SetNillableResourcePath(s *string) *StorageCreate
SetNillableResourcePath sets the "resource_path" field if the given value is not nil.
func (*StorageCreate) SetOldVersion ¶ added in v0.3.0
func (sc *StorageCreate) SetOldVersion(v *Version) *StorageCreate
SetOldVersion sets the "old_version" edge to the Version entity.
func (*StorageCreate) SetOldVersionID ¶ added in v0.3.0
func (sc *StorageCreate) SetOldVersionID(id int) *StorageCreate
SetOldVersionID sets the "old_version" edge to the Version entity by ID.
func (*StorageCreate) SetOs ¶ added in v0.3.0
func (sc *StorageCreate) SetOs(s string) *StorageCreate
SetOs sets the "os" field.
func (*StorageCreate) SetPackagePath ¶ added in v0.3.0
func (sc *StorageCreate) SetPackagePath(s string) *StorageCreate
SetPackagePath sets the "package_path" field.
func (*StorageCreate) SetResourcePath ¶ added in v0.3.0
func (sc *StorageCreate) SetResourcePath(s string) *StorageCreate
SetResourcePath sets the "resource_path" field.
func (*StorageCreate) SetUpdateType ¶ added in v0.3.0
func (sc *StorageCreate) SetUpdateType(st storage.UpdateType) *StorageCreate
SetUpdateType sets the "update_type" field.
func (*StorageCreate) SetVersion ¶
func (sc *StorageCreate) SetVersion(v *Version) *StorageCreate
SetVersion sets the "version" edge to the Version entity.
func (*StorageCreate) SetVersionID ¶
func (sc *StorageCreate) SetVersionID(id int) *StorageCreate
SetVersionID sets the "version" edge to the Version entity by ID.
type StorageCreateBulk ¶
type StorageCreateBulk struct {
// contains filtered or unexported fields
}
StorageCreateBulk is the builder for creating many Storage entities in bulk.
func (*StorageCreateBulk) Exec ¶
func (scb *StorageCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*StorageCreateBulk) ExecX ¶
func (scb *StorageCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*StorageCreateBulk) OnConflict ¶ added in v0.3.0
func (scb *StorageCreateBulk) OnConflict(opts ...sql.ConflictOption) *StorageUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Storage.CreateBulk(builders...).
OnConflict(
// Update the row with the new values
// the was proposed for insertion.
sql.ResolveWithNewValues(),
).
// Override some of the fields with custom
// update values.
Update(func(u *ent.StorageUpsert) {
SetUpdateType(v+v).
}).
Exec(ctx)
func (*StorageCreateBulk) OnConflictColumns ¶ added in v0.3.0
func (scb *StorageCreateBulk) OnConflictColumns(columns ...string) *StorageUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Storage.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type StorageDelete ¶
type StorageDelete struct {
// contains filtered or unexported fields
}
StorageDelete is the builder for deleting a Storage entity.
func (*StorageDelete) Exec ¶
func (sd *StorageDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*StorageDelete) ExecX ¶
func (sd *StorageDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*StorageDelete) Where ¶
func (sd *StorageDelete) Where(ps ...predicate.Storage) *StorageDelete
Where appends a list predicates to the StorageDelete builder.
type StorageDeleteOne ¶
type StorageDeleteOne struct {
// contains filtered or unexported fields
}
StorageDeleteOne is the builder for deleting a single Storage entity.
func (*StorageDeleteOne) Exec ¶
func (sdo *StorageDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*StorageDeleteOne) ExecX ¶
func (sdo *StorageDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*StorageDeleteOne) Where ¶
func (sdo *StorageDeleteOne) Where(ps ...predicate.Storage) *StorageDeleteOne
Where appends a list predicates to the StorageDelete builder.
type StorageEdges ¶
type StorageEdges struct {
// Version holds the value of the version edge.
Version *Version `json:"version,omitempty"`
// only for incremental update
OldVersion *Version `json:"old_version,omitempty"`
// contains filtered or unexported fields
}
StorageEdges holds the relations/edges for other nodes in the graph.
func (StorageEdges) OldVersionOrErr ¶ added in v0.3.0
func (e StorageEdges) OldVersionOrErr() (*Version, error)
OldVersionOrErr returns the OldVersion value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (StorageEdges) VersionOrErr ¶
func (e StorageEdges) VersionOrErr() (*Version, error)
VersionOrErr returns the Version value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type StorageGroupBy ¶
type StorageGroupBy struct {
// contains filtered or unexported fields
}
StorageGroupBy is the group-by builder for Storage entities.
func (*StorageGroupBy) Aggregate ¶
func (sgb *StorageGroupBy) Aggregate(fns ...AggregateFunc) *StorageGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*StorageGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*StorageGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*StorageGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*StorageGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*StorageGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*StorageGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*StorageGroupBy) Scan ¶
func (sgb *StorageGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*StorageGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type StorageMutation ¶
type StorageMutation struct {
// contains filtered or unexported fields
}
StorageMutation represents an operation that mutates the Storage nodes in the graph.
func (*StorageMutation) AddField ¶
func (m *StorageMutation) 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 (*StorageMutation) AddedEdges ¶
func (m *StorageMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*StorageMutation) AddedField ¶
func (m *StorageMutation) 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 (*StorageMutation) AddedFields ¶
func (m *StorageMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*StorageMutation) AddedIDs ¶
func (m *StorageMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*StorageMutation) Arch ¶ added in v0.3.0
func (m *StorageMutation) Arch() (r string, exists bool)
Arch returns the value of the "arch" field in the mutation.
func (*StorageMutation) ArchCleared ¶ added in v0.3.0
func (m *StorageMutation) ArchCleared() bool
ArchCleared returns if the "arch" field was cleared in this mutation.
func (*StorageMutation) ClearArch ¶ added in v0.3.0
func (m *StorageMutation) ClearArch()
ClearArch clears the value of the "arch" field.
func (*StorageMutation) ClearEdge ¶
func (m *StorageMutation) 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 (*StorageMutation) ClearField ¶
func (m *StorageMutation) 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 (*StorageMutation) ClearFileHashes ¶ added in v0.3.0
func (m *StorageMutation) ClearFileHashes()
ClearFileHashes clears the value of the "file_hashes" field.
func (*StorageMutation) ClearOldVersion ¶ added in v0.3.0
func (m *StorageMutation) ClearOldVersion()
ClearOldVersion clears the "old_version" edge to the Version entity.
func (*StorageMutation) ClearOs ¶ added in v0.3.0
func (m *StorageMutation) ClearOs()
ClearOs clears the value of the "os" field.
func (*StorageMutation) ClearPackagePath ¶ added in v0.3.0
func (m *StorageMutation) ClearPackagePath()
ClearPackagePath clears the value of the "package_path" field.
func (*StorageMutation) ClearResourcePath ¶ added in v0.3.0
func (m *StorageMutation) ClearResourcePath()
ClearResourcePath clears the value of the "resource_path" field.
func (*StorageMutation) ClearVersion ¶
func (m *StorageMutation) ClearVersion()
ClearVersion clears the "version" edge to the Version entity.
func (*StorageMutation) ClearedEdges ¶
func (m *StorageMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*StorageMutation) ClearedFields ¶
func (m *StorageMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (StorageMutation) Client ¶
func (m StorageMutation) 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 (*StorageMutation) CreatedAt ¶
func (m *StorageMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*StorageMutation) EdgeCleared ¶
func (m *StorageMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*StorageMutation) Field ¶
func (m *StorageMutation) 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 (*StorageMutation) FieldCleared ¶
func (m *StorageMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*StorageMutation) Fields ¶
func (m *StorageMutation) 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 (*StorageMutation) FileHashes ¶ added in v0.3.0
func (m *StorageMutation) FileHashes() (r map[string]string, exists bool)
FileHashes returns the value of the "file_hashes" field in the mutation.
func (*StorageMutation) FileHashesCleared ¶ added in v0.3.0
func (m *StorageMutation) FileHashesCleared() bool
FileHashesCleared returns if the "file_hashes" field was cleared in this mutation.
func (*StorageMutation) ID ¶
func (m *StorageMutation) 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 (*StorageMutation) IDs ¶
func (m *StorageMutation) 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 (*StorageMutation) OldArch ¶ added in v0.3.0
func (m *StorageMutation) OldArch(ctx context.Context) (v string, err error)
OldArch returns the old "arch" field's value of the Storage entity. If the Storage 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 (*StorageMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Storage entity. If the Storage 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 (*StorageMutation) 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 (*StorageMutation) OldFileHashes ¶ added in v0.3.0
OldFileHashes returns the old "file_hashes" field's value of the Storage entity. If the Storage 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 (*StorageMutation) OldOs ¶ added in v0.3.0
func (m *StorageMutation) OldOs(ctx context.Context) (v string, err error)
OldOs returns the old "os" field's value of the Storage entity. If the Storage 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 (*StorageMutation) OldPackagePath ¶ added in v0.3.0
func (m *StorageMutation) OldPackagePath(ctx context.Context) (v string, err error)
OldPackagePath returns the old "package_path" field's value of the Storage entity. If the Storage 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 (*StorageMutation) OldResourcePath ¶ added in v0.3.0
func (m *StorageMutation) OldResourcePath(ctx context.Context) (v string, err error)
OldResourcePath returns the old "resource_path" field's value of the Storage entity. If the Storage 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 (*StorageMutation) OldUpdateType ¶ added in v0.3.0
func (m *StorageMutation) OldUpdateType(ctx context.Context) (v storage.UpdateType, err error)
OldUpdateType returns the old "update_type" field's value of the Storage entity. If the Storage 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 (*StorageMutation) OldVersionCleared ¶ added in v0.3.0
func (m *StorageMutation) OldVersionCleared() bool
OldVersionCleared reports if the "old_version" edge to the Version entity was cleared.
func (*StorageMutation) OldVersionID ¶ added in v0.3.0
func (m *StorageMutation) OldVersionID() (id int, exists bool)
OldVersionID returns the "old_version" edge ID in the mutation.
func (*StorageMutation) OldVersionIDs ¶ added in v0.3.0
func (m *StorageMutation) OldVersionIDs() (ids []int)
OldVersionIDs returns the "old_version" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OldVersionID instead. It exists only for internal usage by the builders.
func (*StorageMutation) Os ¶ added in v0.3.0
func (m *StorageMutation) Os() (r string, exists bool)
Os returns the value of the "os" field in the mutation.
func (*StorageMutation) OsCleared ¶ added in v0.3.0
func (m *StorageMutation) OsCleared() bool
OsCleared returns if the "os" field was cleared in this mutation.
func (*StorageMutation) PackagePath ¶ added in v0.3.0
func (m *StorageMutation) PackagePath() (r string, exists bool)
PackagePath returns the value of the "package_path" field in the mutation.
func (*StorageMutation) PackagePathCleared ¶ added in v0.3.0
func (m *StorageMutation) PackagePathCleared() bool
PackagePathCleared returns if the "package_path" field was cleared in this mutation.
func (*StorageMutation) RemovedEdges ¶
func (m *StorageMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*StorageMutation) RemovedIDs ¶
func (m *StorageMutation) 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 (*StorageMutation) ResetArch ¶ added in v0.3.0
func (m *StorageMutation) ResetArch()
ResetArch resets all changes to the "arch" field.
func (*StorageMutation) ResetCreatedAt ¶
func (m *StorageMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*StorageMutation) ResetEdge ¶
func (m *StorageMutation) 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 (*StorageMutation) ResetField ¶
func (m *StorageMutation) 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 (*StorageMutation) ResetFileHashes ¶ added in v0.3.0
func (m *StorageMutation) ResetFileHashes()
ResetFileHashes resets all changes to the "file_hashes" field.
func (*StorageMutation) ResetOldVersion ¶ added in v0.3.0
func (m *StorageMutation) ResetOldVersion()
ResetOldVersion resets all changes to the "old_version" edge.
func (*StorageMutation) ResetOs ¶ added in v0.3.0
func (m *StorageMutation) ResetOs()
ResetOs resets all changes to the "os" field.
func (*StorageMutation) ResetPackagePath ¶ added in v0.3.0
func (m *StorageMutation) ResetPackagePath()
ResetPackagePath resets all changes to the "package_path" field.
func (*StorageMutation) ResetResourcePath ¶ added in v0.3.0
func (m *StorageMutation) ResetResourcePath()
ResetResourcePath resets all changes to the "resource_path" field.
func (*StorageMutation) ResetUpdateType ¶ added in v0.3.0
func (m *StorageMutation) ResetUpdateType()
ResetUpdateType resets all changes to the "update_type" field.
func (*StorageMutation) ResetVersion ¶
func (m *StorageMutation) ResetVersion()
ResetVersion resets all changes to the "version" edge.
func (*StorageMutation) ResourcePath ¶ added in v0.3.0
func (m *StorageMutation) ResourcePath() (r string, exists bool)
ResourcePath returns the value of the "resource_path" field in the mutation.
func (*StorageMutation) ResourcePathCleared ¶ added in v0.3.0
func (m *StorageMutation) ResourcePathCleared() bool
ResourcePathCleared returns if the "resource_path" field was cleared in this mutation.
func (*StorageMutation) SetArch ¶ added in v0.3.0
func (m *StorageMutation) SetArch(s string)
SetArch sets the "arch" field.
func (*StorageMutation) SetCreatedAt ¶
func (m *StorageMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*StorageMutation) SetField ¶
func (m *StorageMutation) 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 (*StorageMutation) SetFileHashes ¶ added in v0.3.0
func (m *StorageMutation) SetFileHashes(value map[string]string)
SetFileHashes sets the "file_hashes" field.
func (*StorageMutation) SetOldVersionID ¶ added in v0.3.0
func (m *StorageMutation) SetOldVersionID(id int)
SetOldVersionID sets the "old_version" edge to the Version entity by id.
func (*StorageMutation) SetOp ¶
func (m *StorageMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*StorageMutation) SetOs ¶ added in v0.3.0
func (m *StorageMutation) SetOs(s string)
SetOs sets the "os" field.
func (*StorageMutation) SetPackagePath ¶ added in v0.3.0
func (m *StorageMutation) SetPackagePath(s string)
SetPackagePath sets the "package_path" field.
func (*StorageMutation) SetResourcePath ¶ added in v0.3.0
func (m *StorageMutation) SetResourcePath(s string)
SetResourcePath sets the "resource_path" field.
func (*StorageMutation) SetUpdateType ¶ added in v0.3.0
func (m *StorageMutation) SetUpdateType(st storage.UpdateType)
SetUpdateType sets the "update_type" field.
func (*StorageMutation) SetVersionID ¶
func (m *StorageMutation) SetVersionID(id int)
SetVersionID sets the "version" edge to the Version entity by id.
func (StorageMutation) Tx ¶
func (m StorageMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*StorageMutation) Type ¶
func (m *StorageMutation) Type() string
Type returns the node type of this mutation (Storage).
func (*StorageMutation) UpdateType ¶ added in v0.3.0
func (m *StorageMutation) UpdateType() (r storage.UpdateType, exists bool)
UpdateType returns the value of the "update_type" field in the mutation.
func (*StorageMutation) VersionCleared ¶
func (m *StorageMutation) VersionCleared() bool
VersionCleared reports if the "version" edge to the Version entity was cleared.
func (*StorageMutation) VersionID ¶
func (m *StorageMutation) VersionID() (id int, exists bool)
VersionID returns the "version" edge ID in the mutation.
func (*StorageMutation) VersionIDs ¶
func (m *StorageMutation) VersionIDs() (ids []int)
VersionIDs returns the "version" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use VersionID instead. It exists only for internal usage by the builders.
func (*StorageMutation) Where ¶
func (m *StorageMutation) Where(ps ...predicate.Storage)
Where appends a list predicates to the StorageMutation builder.
func (*StorageMutation) WhereP ¶
func (m *StorageMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the StorageMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type StorageQuery ¶
type StorageQuery struct {
// contains filtered or unexported fields
}
StorageQuery is the builder for querying Storage entities.
func (*StorageQuery) Aggregate ¶
func (sq *StorageQuery) Aggregate(fns ...AggregateFunc) *StorageSelect
Aggregate returns a StorageSelect configured with the given aggregations.
func (*StorageQuery) All ¶
func (sq *StorageQuery) All(ctx context.Context) ([]*Storage, error)
All executes the query and returns a list of Storages.
func (*StorageQuery) AllX ¶
func (sq *StorageQuery) AllX(ctx context.Context) []*Storage
AllX is like All, but panics if an error occurs.
func (*StorageQuery) Clone ¶
func (sq *StorageQuery) Clone() *StorageQuery
Clone returns a duplicate of the StorageQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*StorageQuery) Count ¶
func (sq *StorageQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*StorageQuery) CountX ¶
func (sq *StorageQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*StorageQuery) Exist ¶
func (sq *StorageQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*StorageQuery) ExistX ¶
func (sq *StorageQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*StorageQuery) First ¶
func (sq *StorageQuery) First(ctx context.Context) (*Storage, error)
First returns the first Storage entity from the query. Returns a *NotFoundError when no Storage was found.
func (*StorageQuery) FirstID ¶
func (sq *StorageQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Storage ID from the query. Returns a *NotFoundError when no Storage ID was found.
func (*StorageQuery) FirstIDX ¶
func (sq *StorageQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*StorageQuery) FirstX ¶
func (sq *StorageQuery) FirstX(ctx context.Context) *Storage
FirstX is like First, but panics if an error occurs.
func (*StorageQuery) GroupBy ¶
func (sq *StorageQuery) GroupBy(field string, fields ...string) *StorageGroupBy
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 {
UpdateType storage.UpdateType `json:"update_type,omitempty"`
Count int `json:"count,omitempty"`
}
client.Storage.Query().
GroupBy(storage.FieldUpdateType).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*StorageQuery) IDs ¶
func (sq *StorageQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Storage IDs.
func (*StorageQuery) IDsX ¶
func (sq *StorageQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*StorageQuery) Limit ¶
func (sq *StorageQuery) Limit(limit int) *StorageQuery
Limit the number of records to be returned by this query.
func (*StorageQuery) Offset ¶
func (sq *StorageQuery) Offset(offset int) *StorageQuery
Offset to start from.
func (*StorageQuery) Only ¶
func (sq *StorageQuery) Only(ctx context.Context) (*Storage, error)
Only returns a single Storage entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Storage entity is found. Returns a *NotFoundError when no Storage entities are found.
func (*StorageQuery) OnlyID ¶
func (sq *StorageQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Storage ID in the query. Returns a *NotSingularError when more than one Storage ID is found. Returns a *NotFoundError when no entities are found.
func (*StorageQuery) OnlyIDX ¶
func (sq *StorageQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*StorageQuery) OnlyX ¶
func (sq *StorageQuery) OnlyX(ctx context.Context) *Storage
OnlyX is like Only, but panics if an error occurs.
func (*StorageQuery) Order ¶
func (sq *StorageQuery) Order(o ...storage.OrderOption) *StorageQuery
Order specifies how the records should be ordered.
func (*StorageQuery) QueryOldVersion ¶ added in v0.3.0
func (sq *StorageQuery) QueryOldVersion() *VersionQuery
QueryOldVersion chains the current query on the "old_version" edge.
func (*StorageQuery) QueryVersion ¶
func (sq *StorageQuery) QueryVersion() *VersionQuery
QueryVersion chains the current query on the "version" edge.
func (*StorageQuery) Select ¶
func (sq *StorageQuery) Select(fields ...string) *StorageSelect
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 {
UpdateType storage.UpdateType `json:"update_type,omitempty"`
}
client.Storage.Query().
Select(storage.FieldUpdateType).
Scan(ctx, &v)
func (*StorageQuery) Unique ¶
func (sq *StorageQuery) Unique(unique bool) *StorageQuery
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 (*StorageQuery) Where ¶
func (sq *StorageQuery) Where(ps ...predicate.Storage) *StorageQuery
Where adds a new predicate for the StorageQuery builder.
func (*StorageQuery) WithOldVersion ¶ added in v0.3.0
func (sq *StorageQuery) WithOldVersion(opts ...func(*VersionQuery)) *StorageQuery
WithOldVersion tells the query-builder to eager-load the nodes that are connected to the "old_version" edge. The optional arguments are used to configure the query builder of the edge.
func (*StorageQuery) WithVersion ¶
func (sq *StorageQuery) WithVersion(opts ...func(*VersionQuery)) *StorageQuery
WithVersion tells the query-builder to eager-load the nodes that are connected to the "version" edge. The optional arguments are used to configure the query builder of the edge.
type StorageSelect ¶
type StorageSelect struct {
*StorageQuery
// contains filtered or unexported fields
}
StorageSelect is the builder for selecting fields of Storage entities.
func (*StorageSelect) Aggregate ¶
func (ss *StorageSelect) Aggregate(fns ...AggregateFunc) *StorageSelect
Aggregate adds the given aggregation functions to the selector query.
func (*StorageSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*StorageSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*StorageSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*StorageSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*StorageSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*StorageSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*StorageSelect) Scan ¶
func (ss *StorageSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*StorageSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type StorageUpdate ¶
type StorageUpdate struct {
// contains filtered or unexported fields
}
StorageUpdate is the builder for updating Storage entities.
func (*StorageUpdate) ClearArch ¶ added in v0.3.0
func (su *StorageUpdate) ClearArch() *StorageUpdate
ClearArch clears the value of the "arch" field.
func (*StorageUpdate) ClearFileHashes ¶ added in v0.3.0
func (su *StorageUpdate) ClearFileHashes() *StorageUpdate
ClearFileHashes clears the value of the "file_hashes" field.
func (*StorageUpdate) ClearOldVersion ¶ added in v0.3.0
func (su *StorageUpdate) ClearOldVersion() *StorageUpdate
ClearOldVersion clears the "old_version" edge to the Version entity.
func (*StorageUpdate) ClearOs ¶ added in v0.3.0
func (su *StorageUpdate) ClearOs() *StorageUpdate
ClearOs clears the value of the "os" field.
func (*StorageUpdate) ClearPackagePath ¶ added in v0.3.0
func (su *StorageUpdate) ClearPackagePath() *StorageUpdate
ClearPackagePath clears the value of the "package_path" field.
func (*StorageUpdate) ClearResourcePath ¶ added in v0.3.0
func (su *StorageUpdate) ClearResourcePath() *StorageUpdate
ClearResourcePath clears the value of the "resource_path" field.
func (*StorageUpdate) ClearVersion ¶
func (su *StorageUpdate) ClearVersion() *StorageUpdate
ClearVersion clears the "version" edge to the Version entity.
func (*StorageUpdate) Exec ¶
func (su *StorageUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*StorageUpdate) ExecX ¶
func (su *StorageUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*StorageUpdate) Mutation ¶
func (su *StorageUpdate) Mutation() *StorageMutation
Mutation returns the StorageMutation object of the builder.
func (*StorageUpdate) Save ¶
func (su *StorageUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*StorageUpdate) SaveX ¶
func (su *StorageUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*StorageUpdate) SetArch ¶ added in v0.3.0
func (su *StorageUpdate) SetArch(s string) *StorageUpdate
SetArch sets the "arch" field.
func (*StorageUpdate) SetCreatedAt ¶
func (su *StorageUpdate) SetCreatedAt(t time.Time) *StorageUpdate
SetCreatedAt sets the "created_at" field.
func (*StorageUpdate) SetFileHashes ¶ added in v0.3.0
func (su *StorageUpdate) SetFileHashes(m map[string]string) *StorageUpdate
SetFileHashes sets the "file_hashes" field.
func (*StorageUpdate) SetNillableArch ¶ added in v0.3.0
func (su *StorageUpdate) SetNillableArch(s *string) *StorageUpdate
SetNillableArch sets the "arch" field if the given value is not nil.
func (*StorageUpdate) SetNillableCreatedAt ¶
func (su *StorageUpdate) SetNillableCreatedAt(t *time.Time) *StorageUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*StorageUpdate) SetNillableOldVersionID ¶ added in v0.3.0
func (su *StorageUpdate) SetNillableOldVersionID(id *int) *StorageUpdate
SetNillableOldVersionID sets the "old_version" edge to the Version entity by ID if the given value is not nil.
func (*StorageUpdate) SetNillableOs ¶ added in v0.3.0
func (su *StorageUpdate) SetNillableOs(s *string) *StorageUpdate
SetNillableOs sets the "os" field if the given value is not nil.
func (*StorageUpdate) SetNillablePackagePath ¶ added in v0.3.0
func (su *StorageUpdate) SetNillablePackagePath(s *string) *StorageUpdate
SetNillablePackagePath sets the "package_path" field if the given value is not nil.
func (*StorageUpdate) SetNillableResourcePath ¶ added in v0.3.0
func (su *StorageUpdate) SetNillableResourcePath(s *string) *StorageUpdate
SetNillableResourcePath sets the "resource_path" field if the given value is not nil.
func (*StorageUpdate) SetNillableUpdateType ¶ added in v0.3.0
func (su *StorageUpdate) SetNillableUpdateType(st *storage.UpdateType) *StorageUpdate
SetNillableUpdateType sets the "update_type" field if the given value is not nil.
func (*StorageUpdate) SetOldVersion ¶ added in v0.3.0
func (su *StorageUpdate) SetOldVersion(v *Version) *StorageUpdate
SetOldVersion sets the "old_version" edge to the Version entity.
func (*StorageUpdate) SetOldVersionID ¶ added in v0.3.0
func (su *StorageUpdate) SetOldVersionID(id int) *StorageUpdate
SetOldVersionID sets the "old_version" edge to the Version entity by ID.
func (*StorageUpdate) SetOs ¶ added in v0.3.0
func (su *StorageUpdate) SetOs(s string) *StorageUpdate
SetOs sets the "os" field.
func (*StorageUpdate) SetPackagePath ¶ added in v0.3.0
func (su *StorageUpdate) SetPackagePath(s string) *StorageUpdate
SetPackagePath sets the "package_path" field.
func (*StorageUpdate) SetResourcePath ¶ added in v0.3.0
func (su *StorageUpdate) SetResourcePath(s string) *StorageUpdate
SetResourcePath sets the "resource_path" field.
func (*StorageUpdate) SetUpdateType ¶ added in v0.3.0
func (su *StorageUpdate) SetUpdateType(st storage.UpdateType) *StorageUpdate
SetUpdateType sets the "update_type" field.
func (*StorageUpdate) SetVersion ¶
func (su *StorageUpdate) SetVersion(v *Version) *StorageUpdate
SetVersion sets the "version" edge to the Version entity.
func (*StorageUpdate) SetVersionID ¶
func (su *StorageUpdate) SetVersionID(id int) *StorageUpdate
SetVersionID sets the "version" edge to the Version entity by ID.
func (*StorageUpdate) Where ¶
func (su *StorageUpdate) Where(ps ...predicate.Storage) *StorageUpdate
Where appends a list predicates to the StorageUpdate builder.
type StorageUpdateOne ¶
type StorageUpdateOne struct {
// contains filtered or unexported fields
}
StorageUpdateOne is the builder for updating a single Storage entity.
func (*StorageUpdateOne) ClearArch ¶ added in v0.3.0
func (suo *StorageUpdateOne) ClearArch() *StorageUpdateOne
ClearArch clears the value of the "arch" field.
func (*StorageUpdateOne) ClearFileHashes ¶ added in v0.3.0
func (suo *StorageUpdateOne) ClearFileHashes() *StorageUpdateOne
ClearFileHashes clears the value of the "file_hashes" field.
func (*StorageUpdateOne) ClearOldVersion ¶ added in v0.3.0
func (suo *StorageUpdateOne) ClearOldVersion() *StorageUpdateOne
ClearOldVersion clears the "old_version" edge to the Version entity.
func (*StorageUpdateOne) ClearOs ¶ added in v0.3.0
func (suo *StorageUpdateOne) ClearOs() *StorageUpdateOne
ClearOs clears the value of the "os" field.
func (*StorageUpdateOne) ClearPackagePath ¶ added in v0.3.0
func (suo *StorageUpdateOne) ClearPackagePath() *StorageUpdateOne
ClearPackagePath clears the value of the "package_path" field.
func (*StorageUpdateOne) ClearResourcePath ¶ added in v0.3.0
func (suo *StorageUpdateOne) ClearResourcePath() *StorageUpdateOne
ClearResourcePath clears the value of the "resource_path" field.
func (*StorageUpdateOne) ClearVersion ¶
func (suo *StorageUpdateOne) ClearVersion() *StorageUpdateOne
ClearVersion clears the "version" edge to the Version entity.
func (*StorageUpdateOne) Exec ¶
func (suo *StorageUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*StorageUpdateOne) ExecX ¶
func (suo *StorageUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*StorageUpdateOne) Mutation ¶
func (suo *StorageUpdateOne) Mutation() *StorageMutation
Mutation returns the StorageMutation object of the builder.
func (*StorageUpdateOne) Save ¶
func (suo *StorageUpdateOne) Save(ctx context.Context) (*Storage, error)
Save executes the query and returns the updated Storage entity.
func (*StorageUpdateOne) SaveX ¶
func (suo *StorageUpdateOne) SaveX(ctx context.Context) *Storage
SaveX is like Save, but panics if an error occurs.
func (*StorageUpdateOne) Select ¶
func (suo *StorageUpdateOne) Select(field string, fields ...string) *StorageUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*StorageUpdateOne) SetArch ¶ added in v0.3.0
func (suo *StorageUpdateOne) SetArch(s string) *StorageUpdateOne
SetArch sets the "arch" field.
func (*StorageUpdateOne) SetCreatedAt ¶
func (suo *StorageUpdateOne) SetCreatedAt(t time.Time) *StorageUpdateOne
SetCreatedAt sets the "created_at" field.
func (*StorageUpdateOne) SetFileHashes ¶ added in v0.3.0
func (suo *StorageUpdateOne) SetFileHashes(m map[string]string) *StorageUpdateOne
SetFileHashes sets the "file_hashes" field.
func (*StorageUpdateOne) SetNillableArch ¶ added in v0.3.0
func (suo *StorageUpdateOne) SetNillableArch(s *string) *StorageUpdateOne
SetNillableArch sets the "arch" field if the given value is not nil.
func (*StorageUpdateOne) SetNillableCreatedAt ¶
func (suo *StorageUpdateOne) SetNillableCreatedAt(t *time.Time) *StorageUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*StorageUpdateOne) SetNillableOldVersionID ¶ added in v0.3.0
func (suo *StorageUpdateOne) SetNillableOldVersionID(id *int) *StorageUpdateOne
SetNillableOldVersionID sets the "old_version" edge to the Version entity by ID if the given value is not nil.
func (*StorageUpdateOne) SetNillableOs ¶ added in v0.3.0
func (suo *StorageUpdateOne) SetNillableOs(s *string) *StorageUpdateOne
SetNillableOs sets the "os" field if the given value is not nil.
func (*StorageUpdateOne) SetNillablePackagePath ¶ added in v0.3.0
func (suo *StorageUpdateOne) SetNillablePackagePath(s *string) *StorageUpdateOne
SetNillablePackagePath sets the "package_path" field if the given value is not nil.
func (*StorageUpdateOne) SetNillableResourcePath ¶ added in v0.3.0
func (suo *StorageUpdateOne) SetNillableResourcePath(s *string) *StorageUpdateOne
SetNillableResourcePath sets the "resource_path" field if the given value is not nil.
func (*StorageUpdateOne) SetNillableUpdateType ¶ added in v0.3.0
func (suo *StorageUpdateOne) SetNillableUpdateType(st *storage.UpdateType) *StorageUpdateOne
SetNillableUpdateType sets the "update_type" field if the given value is not nil.
func (*StorageUpdateOne) SetOldVersion ¶ added in v0.3.0
func (suo *StorageUpdateOne) SetOldVersion(v *Version) *StorageUpdateOne
SetOldVersion sets the "old_version" edge to the Version entity.
func (*StorageUpdateOne) SetOldVersionID ¶ added in v0.3.0
func (suo *StorageUpdateOne) SetOldVersionID(id int) *StorageUpdateOne
SetOldVersionID sets the "old_version" edge to the Version entity by ID.
func (*StorageUpdateOne) SetOs ¶ added in v0.3.0
func (suo *StorageUpdateOne) SetOs(s string) *StorageUpdateOne
SetOs sets the "os" field.
func (*StorageUpdateOne) SetPackagePath ¶ added in v0.3.0
func (suo *StorageUpdateOne) SetPackagePath(s string) *StorageUpdateOne
SetPackagePath sets the "package_path" field.
func (*StorageUpdateOne) SetResourcePath ¶ added in v0.3.0
func (suo *StorageUpdateOne) SetResourcePath(s string) *StorageUpdateOne
SetResourcePath sets the "resource_path" field.
func (*StorageUpdateOne) SetUpdateType ¶ added in v0.3.0
func (suo *StorageUpdateOne) SetUpdateType(st storage.UpdateType) *StorageUpdateOne
SetUpdateType sets the "update_type" field.
func (*StorageUpdateOne) SetVersion ¶
func (suo *StorageUpdateOne) SetVersion(v *Version) *StorageUpdateOne
SetVersion sets the "version" edge to the Version entity.
func (*StorageUpdateOne) SetVersionID ¶
func (suo *StorageUpdateOne) SetVersionID(id int) *StorageUpdateOne
SetVersionID sets the "version" edge to the Version entity by ID.
func (*StorageUpdateOne) Where ¶
func (suo *StorageUpdateOne) Where(ps ...predicate.Storage) *StorageUpdateOne
Where appends a list predicates to the StorageUpdate builder.
type StorageUpsert ¶ added in v0.3.0
StorageUpsert is the "OnConflict" setter.
func (*StorageUpsert) ClearArch ¶ added in v0.3.0
func (u *StorageUpsert) ClearArch() *StorageUpsert
ClearArch clears the value of the "arch" field.
func (*StorageUpsert) ClearFileHashes ¶ added in v0.3.0
func (u *StorageUpsert) ClearFileHashes() *StorageUpsert
ClearFileHashes clears the value of the "file_hashes" field.
func (*StorageUpsert) ClearOs ¶ added in v0.3.0
func (u *StorageUpsert) ClearOs() *StorageUpsert
ClearOs clears the value of the "os" field.
func (*StorageUpsert) ClearPackagePath ¶ added in v0.3.0
func (u *StorageUpsert) ClearPackagePath() *StorageUpsert
ClearPackagePath clears the value of the "package_path" field.
func (*StorageUpsert) ClearResourcePath ¶ added in v0.3.0
func (u *StorageUpsert) ClearResourcePath() *StorageUpsert
ClearResourcePath clears the value of the "resource_path" field.
func (*StorageUpsert) SetArch ¶ added in v0.3.0
func (u *StorageUpsert) SetArch(v string) *StorageUpsert
SetArch sets the "arch" field.
func (*StorageUpsert) SetCreatedAt ¶ added in v0.3.0
func (u *StorageUpsert) SetCreatedAt(v time.Time) *StorageUpsert
SetCreatedAt sets the "created_at" field.
func (*StorageUpsert) SetFileHashes ¶ added in v0.3.0
func (u *StorageUpsert) SetFileHashes(v map[string]string) *StorageUpsert
SetFileHashes sets the "file_hashes" field.
func (*StorageUpsert) SetOs ¶ added in v0.3.0
func (u *StorageUpsert) SetOs(v string) *StorageUpsert
SetOs sets the "os" field.
func (*StorageUpsert) SetPackagePath ¶ added in v0.3.0
func (u *StorageUpsert) SetPackagePath(v string) *StorageUpsert
SetPackagePath sets the "package_path" field.
func (*StorageUpsert) SetResourcePath ¶ added in v0.3.0
func (u *StorageUpsert) SetResourcePath(v string) *StorageUpsert
SetResourcePath sets the "resource_path" field.
func (*StorageUpsert) SetUpdateType ¶ added in v0.3.0
func (u *StorageUpsert) SetUpdateType(v storage.UpdateType) *StorageUpsert
SetUpdateType sets the "update_type" field.
func (*StorageUpsert) UpdateArch ¶ added in v0.3.0
func (u *StorageUpsert) UpdateArch() *StorageUpsert
UpdateArch sets the "arch" field to the value that was provided on create.
func (*StorageUpsert) UpdateCreatedAt ¶ added in v0.3.0
func (u *StorageUpsert) UpdateCreatedAt() *StorageUpsert
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*StorageUpsert) UpdateFileHashes ¶ added in v0.3.0
func (u *StorageUpsert) UpdateFileHashes() *StorageUpsert
UpdateFileHashes sets the "file_hashes" field to the value that was provided on create.
func (*StorageUpsert) UpdateOs ¶ added in v0.3.0
func (u *StorageUpsert) UpdateOs() *StorageUpsert
UpdateOs sets the "os" field to the value that was provided on create.
func (*StorageUpsert) UpdatePackagePath ¶ added in v0.3.0
func (u *StorageUpsert) UpdatePackagePath() *StorageUpsert
UpdatePackagePath sets the "package_path" field to the value that was provided on create.
func (*StorageUpsert) UpdateResourcePath ¶ added in v0.3.0
func (u *StorageUpsert) UpdateResourcePath() *StorageUpsert
UpdateResourcePath sets the "resource_path" field to the value that was provided on create.
func (*StorageUpsert) UpdateUpdateType ¶ added in v0.3.0
func (u *StorageUpsert) UpdateUpdateType() *StorageUpsert
UpdateUpdateType sets the "update_type" field to the value that was provided on create.
type StorageUpsertBulk ¶ added in v0.3.0
type StorageUpsertBulk struct {
// contains filtered or unexported fields
}
StorageUpsertBulk is the builder for "upsert"-ing a bulk of Storage nodes.
func (*StorageUpsertBulk) ClearArch ¶ added in v0.3.0
func (u *StorageUpsertBulk) ClearArch() *StorageUpsertBulk
ClearArch clears the value of the "arch" field.
func (*StorageUpsertBulk) ClearFileHashes ¶ added in v0.3.0
func (u *StorageUpsertBulk) ClearFileHashes() *StorageUpsertBulk
ClearFileHashes clears the value of the "file_hashes" field.
func (*StorageUpsertBulk) ClearOs ¶ added in v0.3.0
func (u *StorageUpsertBulk) ClearOs() *StorageUpsertBulk
ClearOs clears the value of the "os" field.
func (*StorageUpsertBulk) ClearPackagePath ¶ added in v0.3.0
func (u *StorageUpsertBulk) ClearPackagePath() *StorageUpsertBulk
ClearPackagePath clears the value of the "package_path" field.
func (*StorageUpsertBulk) ClearResourcePath ¶ added in v0.3.0
func (u *StorageUpsertBulk) ClearResourcePath() *StorageUpsertBulk
ClearResourcePath clears the value of the "resource_path" field.
func (*StorageUpsertBulk) DoNothing ¶ added in v0.3.0
func (u *StorageUpsertBulk) DoNothing() *StorageUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*StorageUpsertBulk) Exec ¶ added in v0.3.0
func (u *StorageUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*StorageUpsertBulk) ExecX ¶ added in v0.3.0
func (u *StorageUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*StorageUpsertBulk) Ignore ¶ added in v0.3.0
func (u *StorageUpsertBulk) Ignore() *StorageUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Storage.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*StorageUpsertBulk) SetArch ¶ added in v0.3.0
func (u *StorageUpsertBulk) SetArch(v string) *StorageUpsertBulk
SetArch sets the "arch" field.
func (*StorageUpsertBulk) SetCreatedAt ¶ added in v0.3.0
func (u *StorageUpsertBulk) SetCreatedAt(v time.Time) *StorageUpsertBulk
SetCreatedAt sets the "created_at" field.
func (*StorageUpsertBulk) SetFileHashes ¶ added in v0.3.0
func (u *StorageUpsertBulk) SetFileHashes(v map[string]string) *StorageUpsertBulk
SetFileHashes sets the "file_hashes" field.
func (*StorageUpsertBulk) SetOs ¶ added in v0.3.0
func (u *StorageUpsertBulk) SetOs(v string) *StorageUpsertBulk
SetOs sets the "os" field.
func (*StorageUpsertBulk) SetPackagePath ¶ added in v0.3.0
func (u *StorageUpsertBulk) SetPackagePath(v string) *StorageUpsertBulk
SetPackagePath sets the "package_path" field.
func (*StorageUpsertBulk) SetResourcePath ¶ added in v0.3.0
func (u *StorageUpsertBulk) SetResourcePath(v string) *StorageUpsertBulk
SetResourcePath sets the "resource_path" field.
func (*StorageUpsertBulk) SetUpdateType ¶ added in v0.3.0
func (u *StorageUpsertBulk) SetUpdateType(v storage.UpdateType) *StorageUpsertBulk
SetUpdateType sets the "update_type" field.
func (*StorageUpsertBulk) Update ¶ added in v0.3.0
func (u *StorageUpsertBulk) Update(set func(*StorageUpsert)) *StorageUpsertBulk
Update allows overriding fields `UPDATE` values. See the StorageCreateBulk.OnConflict documentation for more info.
func (*StorageUpsertBulk) UpdateArch ¶ added in v0.3.0
func (u *StorageUpsertBulk) UpdateArch() *StorageUpsertBulk
UpdateArch sets the "arch" field to the value that was provided on create.
func (*StorageUpsertBulk) UpdateCreatedAt ¶ added in v0.3.0
func (u *StorageUpsertBulk) UpdateCreatedAt() *StorageUpsertBulk
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*StorageUpsertBulk) UpdateFileHashes ¶ added in v0.3.0
func (u *StorageUpsertBulk) UpdateFileHashes() *StorageUpsertBulk
UpdateFileHashes sets the "file_hashes" field to the value that was provided on create.
func (*StorageUpsertBulk) UpdateNewValues ¶ added in v0.3.0
func (u *StorageUpsertBulk) UpdateNewValues() *StorageUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Storage.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*StorageUpsertBulk) UpdateOs ¶ added in v0.3.0
func (u *StorageUpsertBulk) UpdateOs() *StorageUpsertBulk
UpdateOs sets the "os" field to the value that was provided on create.
func (*StorageUpsertBulk) UpdatePackagePath ¶ added in v0.3.0
func (u *StorageUpsertBulk) UpdatePackagePath() *StorageUpsertBulk
UpdatePackagePath sets the "package_path" field to the value that was provided on create.
func (*StorageUpsertBulk) UpdateResourcePath ¶ added in v0.3.0
func (u *StorageUpsertBulk) UpdateResourcePath() *StorageUpsertBulk
UpdateResourcePath sets the "resource_path" field to the value that was provided on create.
func (*StorageUpsertBulk) UpdateUpdateType ¶ added in v0.3.0
func (u *StorageUpsertBulk) UpdateUpdateType() *StorageUpsertBulk
UpdateUpdateType sets the "update_type" field to the value that was provided on create.
type StorageUpsertOne ¶ added in v0.3.0
type StorageUpsertOne struct {
// contains filtered or unexported fields
}
StorageUpsertOne is the builder for "upsert"-ing
one Storage node.
func (*StorageUpsertOne) ClearArch ¶ added in v0.3.0
func (u *StorageUpsertOne) ClearArch() *StorageUpsertOne
ClearArch clears the value of the "arch" field.
func (*StorageUpsertOne) ClearFileHashes ¶ added in v0.3.0
func (u *StorageUpsertOne) ClearFileHashes() *StorageUpsertOne
ClearFileHashes clears the value of the "file_hashes" field.
func (*StorageUpsertOne) ClearOs ¶ added in v0.3.0
func (u *StorageUpsertOne) ClearOs() *StorageUpsertOne
ClearOs clears the value of the "os" field.
func (*StorageUpsertOne) ClearPackagePath ¶ added in v0.3.0
func (u *StorageUpsertOne) ClearPackagePath() *StorageUpsertOne
ClearPackagePath clears the value of the "package_path" field.
func (*StorageUpsertOne) ClearResourcePath ¶ added in v0.3.0
func (u *StorageUpsertOne) ClearResourcePath() *StorageUpsertOne
ClearResourcePath clears the value of the "resource_path" field.
func (*StorageUpsertOne) DoNothing ¶ added in v0.3.0
func (u *StorageUpsertOne) DoNothing() *StorageUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*StorageUpsertOne) Exec ¶ added in v0.3.0
func (u *StorageUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*StorageUpsertOne) ExecX ¶ added in v0.3.0
func (u *StorageUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*StorageUpsertOne) ID ¶ added in v0.3.0
func (u *StorageUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*StorageUpsertOne) IDX ¶ added in v0.3.0
func (u *StorageUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*StorageUpsertOne) Ignore ¶ added in v0.3.0
func (u *StorageUpsertOne) Ignore() *StorageUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Storage.Create().
OnConflict(sql.ResolveWithIgnore()).
Exec(ctx)
func (*StorageUpsertOne) SetArch ¶ added in v0.3.0
func (u *StorageUpsertOne) SetArch(v string) *StorageUpsertOne
SetArch sets the "arch" field.
func (*StorageUpsertOne) SetCreatedAt ¶ added in v0.3.0
func (u *StorageUpsertOne) SetCreatedAt(v time.Time) *StorageUpsertOne
SetCreatedAt sets the "created_at" field.
func (*StorageUpsertOne) SetFileHashes ¶ added in v0.3.0
func (u *StorageUpsertOne) SetFileHashes(v map[string]string) *StorageUpsertOne
SetFileHashes sets the "file_hashes" field.
func (*StorageUpsertOne) SetOs ¶ added in v0.3.0
func (u *StorageUpsertOne) SetOs(v string) *StorageUpsertOne
SetOs sets the "os" field.
func (*StorageUpsertOne) SetPackagePath ¶ added in v0.3.0
func (u *StorageUpsertOne) SetPackagePath(v string) *StorageUpsertOne
SetPackagePath sets the "package_path" field.
func (*StorageUpsertOne) SetResourcePath ¶ added in v0.3.0
func (u *StorageUpsertOne) SetResourcePath(v string) *StorageUpsertOne
SetResourcePath sets the "resource_path" field.
func (*StorageUpsertOne) SetUpdateType ¶ added in v0.3.0
func (u *StorageUpsertOne) SetUpdateType(v storage.UpdateType) *StorageUpsertOne
SetUpdateType sets the "update_type" field.
func (*StorageUpsertOne) Update ¶ added in v0.3.0
func (u *StorageUpsertOne) Update(set func(*StorageUpsert)) *StorageUpsertOne
Update allows overriding fields `UPDATE` values. See the StorageCreate.OnConflict documentation for more info.
func (*StorageUpsertOne) UpdateArch ¶ added in v0.3.0
func (u *StorageUpsertOne) UpdateArch() *StorageUpsertOne
UpdateArch sets the "arch" field to the value that was provided on create.
func (*StorageUpsertOne) UpdateCreatedAt ¶ added in v0.3.0
func (u *StorageUpsertOne) UpdateCreatedAt() *StorageUpsertOne
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*StorageUpsertOne) UpdateFileHashes ¶ added in v0.3.0
func (u *StorageUpsertOne) UpdateFileHashes() *StorageUpsertOne
UpdateFileHashes sets the "file_hashes" field to the value that was provided on create.
func (*StorageUpsertOne) UpdateNewValues ¶ added in v0.3.0
func (u *StorageUpsertOne) UpdateNewValues() *StorageUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Storage.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*StorageUpsertOne) UpdateOs ¶ added in v0.3.0
func (u *StorageUpsertOne) UpdateOs() *StorageUpsertOne
UpdateOs sets the "os" field to the value that was provided on create.
func (*StorageUpsertOne) UpdatePackagePath ¶ added in v0.3.0
func (u *StorageUpsertOne) UpdatePackagePath() *StorageUpsertOne
UpdatePackagePath sets the "package_path" field to the value that was provided on create.
func (*StorageUpsertOne) UpdateResourcePath ¶ added in v0.3.0
func (u *StorageUpsertOne) UpdateResourcePath() *StorageUpsertOne
UpdateResourcePath sets the "resource_path" field to the value that was provided on create.
func (*StorageUpsertOne) UpdateUpdateType ¶ added in v0.3.0
func (u *StorageUpsertOne) UpdateUpdateType() *StorageUpsertOne
UpdateUpdateType sets the "update_type" field to the value that was provided on create.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct {
// LatestVersion is the client for interacting with the LatestVersion builders.
LatestVersion *LatestVersionClient
// Resource is the client for interacting with the Resource builders.
Resource *ResourceClient
// Storage is the client for interacting with the Storage builders.
Storage *StorageClient
// Version is the client for interacting with the Version builders.
Version *VersionClient
// 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.
type Version ¶
type Version struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// Channel holds the value of the "channel" field.
Channel version.Channel `json:"channel,omitempty"`
// Name holds the value of the "name" field.
Name string `json:"name,omitempty"`
// Number holds the value of the "number" field.
Number uint64 `json:"number,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 VersionQuery when eager-loading is set.
Edges VersionEdges `json:"edges"`
// contains filtered or unexported fields
}
Version is the model entity for the Version schema.
func (*Version) QueryResource ¶
func (v *Version) QueryResource() *ResourceQuery
QueryResource queries the "resource" edge of the Version entity.
func (*Version) QueryStorages ¶ added in v0.3.0
func (v *Version) QueryStorages() *StorageQuery
QueryStorages queries the "storages" edge of the Version entity.
func (*Version) Unwrap ¶
Unwrap unwraps the Version 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 (*Version) Update ¶
func (v *Version) Update() *VersionUpdateOne
Update returns a builder for updating this Version. Note that you need to call Version.Unwrap() before calling this method if this Version was returned from a transaction, and the transaction was committed or rolled back.
type VersionClient ¶
type VersionClient struct {
// contains filtered or unexported fields
}
VersionClient is a client for the Version schema.
func NewVersionClient ¶
func NewVersionClient(c config) *VersionClient
NewVersionClient returns a client for the Version from the given config.
func (*VersionClient) Create ¶
func (c *VersionClient) Create() *VersionCreate
Create returns a builder for creating a Version entity.
func (*VersionClient) CreateBulk ¶
func (c *VersionClient) CreateBulk(builders ...*VersionCreate) *VersionCreateBulk
CreateBulk returns a builder for creating a bulk of Version entities.
func (*VersionClient) Delete ¶
func (c *VersionClient) Delete() *VersionDelete
Delete returns a delete builder for Version.
func (*VersionClient) DeleteOne ¶
func (c *VersionClient) DeleteOne(v *Version) *VersionDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*VersionClient) DeleteOneID ¶
func (c *VersionClient) DeleteOneID(id int) *VersionDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*VersionClient) GetX ¶
func (c *VersionClient) GetX(ctx context.Context, id int) *Version
GetX is like Get, but panics if an error occurs.
func (*VersionClient) Hooks ¶
func (c *VersionClient) Hooks() []Hook
Hooks returns the client hooks.
func (*VersionClient) Intercept ¶
func (c *VersionClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `version.Intercept(f(g(h())))`.
func (*VersionClient) Interceptors ¶
func (c *VersionClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*VersionClient) MapCreateBulk ¶
func (c *VersionClient) MapCreateBulk(slice any, setFunc func(*VersionCreate, int)) *VersionCreateBulk
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 (*VersionClient) Query ¶
func (c *VersionClient) Query() *VersionQuery
Query returns a query builder for Version.
func (*VersionClient) QueryResource ¶
func (c *VersionClient) QueryResource(v *Version) *ResourceQuery
QueryResource queries the resource edge of a Version.
func (*VersionClient) QueryStorages ¶ added in v0.3.0
func (c *VersionClient) QueryStorages(v *Version) *StorageQuery
QueryStorages queries the storages edge of a Version.
func (*VersionClient) Update ¶
func (c *VersionClient) Update() *VersionUpdate
Update returns an update builder for Version.
func (*VersionClient) UpdateOne ¶
func (c *VersionClient) UpdateOne(v *Version) *VersionUpdateOne
UpdateOne returns an update builder for the given entity.
func (*VersionClient) UpdateOneID ¶
func (c *VersionClient) UpdateOneID(id int) *VersionUpdateOne
UpdateOneID returns an update builder for the given id.
func (*VersionClient) Use ¶
func (c *VersionClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `version.Hooks(f(g(h())))`.
type VersionCreate ¶
type VersionCreate struct {
// contains filtered or unexported fields
}
VersionCreate is the builder for creating a Version entity.
func (*VersionCreate) AddStorageIDs ¶
func (vc *VersionCreate) AddStorageIDs(ids ...int) *VersionCreate
AddStorageIDs adds the "storages" edge to the Storage entity by IDs.
func (*VersionCreate) AddStorages ¶ added in v0.3.0
func (vc *VersionCreate) AddStorages(s ...*Storage) *VersionCreate
AddStorages adds the "storages" edges to the Storage entity.
func (*VersionCreate) Exec ¶
func (vc *VersionCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*VersionCreate) ExecX ¶
func (vc *VersionCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VersionCreate) Mutation ¶
func (vc *VersionCreate) Mutation() *VersionMutation
Mutation returns the VersionMutation object of the builder.
func (*VersionCreate) OnConflict ¶ added in v0.3.0
func (vc *VersionCreate) OnConflict(opts ...sql.ConflictOption) *VersionUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Version.Create().
SetChannel(v).
OnConflict(
// Update the row with the new values
// the was proposed for insertion.
sql.ResolveWithNewValues(),
).
// Override some of the fields with custom
// update values.
Update(func(u *ent.VersionUpsert) {
SetChannel(v+v).
}).
Exec(ctx)
func (*VersionCreate) OnConflictColumns ¶ added in v0.3.0
func (vc *VersionCreate) OnConflictColumns(columns ...string) *VersionUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Version.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*VersionCreate) Save ¶
func (vc *VersionCreate) Save(ctx context.Context) (*Version, error)
Save creates the Version in the database.
func (*VersionCreate) SaveX ¶
func (vc *VersionCreate) SaveX(ctx context.Context) *Version
SaveX calls Save and panics if Save returns an error.
func (*VersionCreate) SetChannel ¶ added in v0.3.0
func (vc *VersionCreate) SetChannel(v version.Channel) *VersionCreate
SetChannel sets the "channel" field.
func (*VersionCreate) SetCreatedAt ¶
func (vc *VersionCreate) SetCreatedAt(t time.Time) *VersionCreate
SetCreatedAt sets the "created_at" field.
func (*VersionCreate) SetName ¶
func (vc *VersionCreate) SetName(s string) *VersionCreate
SetName sets the "name" field.
func (*VersionCreate) SetNillableChannel ¶ added in v0.3.0
func (vc *VersionCreate) SetNillableChannel(v *version.Channel) *VersionCreate
SetNillableChannel sets the "channel" field if the given value is not nil.
func (*VersionCreate) SetNillableCreatedAt ¶
func (vc *VersionCreate) SetNillableCreatedAt(t *time.Time) *VersionCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*VersionCreate) SetNillableResourceID ¶
func (vc *VersionCreate) SetNillableResourceID(id *string) *VersionCreate
SetNillableResourceID sets the "resource" edge to the Resource entity by ID if the given value is not nil.
func (*VersionCreate) SetNumber ¶
func (vc *VersionCreate) SetNumber(u uint64) *VersionCreate
SetNumber sets the "number" field.
func (*VersionCreate) SetResource ¶
func (vc *VersionCreate) SetResource(r *Resource) *VersionCreate
SetResource sets the "resource" edge to the Resource entity.
func (*VersionCreate) SetResourceID ¶
func (vc *VersionCreate) SetResourceID(id string) *VersionCreate
SetResourceID sets the "resource" edge to the Resource entity by ID.
type VersionCreateBulk ¶
type VersionCreateBulk struct {
// contains filtered or unexported fields
}
VersionCreateBulk is the builder for creating many Version entities in bulk.
func (*VersionCreateBulk) Exec ¶
func (vcb *VersionCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*VersionCreateBulk) ExecX ¶
func (vcb *VersionCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VersionCreateBulk) OnConflict ¶ added in v0.3.0
func (vcb *VersionCreateBulk) OnConflict(opts ...sql.ConflictOption) *VersionUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Version.CreateBulk(builders...).
OnConflict(
// Update the row with the new values
// the was proposed for insertion.
sql.ResolveWithNewValues(),
).
// Override some of the fields with custom
// update values.
Update(func(u *ent.VersionUpsert) {
SetChannel(v+v).
}).
Exec(ctx)
func (*VersionCreateBulk) OnConflictColumns ¶ added in v0.3.0
func (vcb *VersionCreateBulk) OnConflictColumns(columns ...string) *VersionUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Version.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type VersionDelete ¶
type VersionDelete struct {
// contains filtered or unexported fields
}
VersionDelete is the builder for deleting a Version entity.
func (*VersionDelete) Exec ¶
func (vd *VersionDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*VersionDelete) ExecX ¶
func (vd *VersionDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*VersionDelete) Where ¶
func (vd *VersionDelete) Where(ps ...predicate.Version) *VersionDelete
Where appends a list predicates to the VersionDelete builder.
type VersionDeleteOne ¶
type VersionDeleteOne struct {
// contains filtered or unexported fields
}
VersionDeleteOne is the builder for deleting a single Version entity.
func (*VersionDeleteOne) Exec ¶
func (vdo *VersionDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*VersionDeleteOne) ExecX ¶
func (vdo *VersionDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VersionDeleteOne) Where ¶
func (vdo *VersionDeleteOne) Where(ps ...predicate.Version) *VersionDeleteOne
Where appends a list predicates to the VersionDelete builder.
type VersionEdges ¶
type VersionEdges struct {
// Storages holds the value of the storages edge.
Storages []*Storage `json:"storages,omitempty"`
// Resource holds the value of the resource edge.
Resource *Resource `json:"resource,omitempty"`
// contains filtered or unexported fields
}
VersionEdges holds the relations/edges for other nodes in the graph.
func (VersionEdges) ResourceOrErr ¶
func (e VersionEdges) ResourceOrErr() (*Resource, error)
ResourceOrErr returns the Resource value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (VersionEdges) StoragesOrErr ¶ added in v0.3.0
func (e VersionEdges) StoragesOrErr() ([]*Storage, error)
StoragesOrErr returns the Storages value or an error if the edge was not loaded in eager-loading.
type VersionGroupBy ¶
type VersionGroupBy struct {
// contains filtered or unexported fields
}
VersionGroupBy is the group-by builder for Version entities.
func (*VersionGroupBy) Aggregate ¶
func (vgb *VersionGroupBy) Aggregate(fns ...AggregateFunc) *VersionGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*VersionGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*VersionGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*VersionGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*VersionGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*VersionGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*VersionGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*VersionGroupBy) Scan ¶
func (vgb *VersionGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*VersionGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type VersionMutation ¶
type VersionMutation struct {
// contains filtered or unexported fields
}
VersionMutation represents an operation that mutates the Version nodes in the graph.
func (*VersionMutation) AddField ¶
func (m *VersionMutation) 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 (*VersionMutation) AddNumber ¶
func (m *VersionMutation) AddNumber(u int64)
AddNumber adds u to the "number" field.
func (*VersionMutation) AddStorageIDs ¶
func (m *VersionMutation) AddStorageIDs(ids ...int)
AddStorageIDs adds the "storages" edge to the Storage entity by ids.
func (*VersionMutation) AddedEdges ¶
func (m *VersionMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*VersionMutation) AddedField ¶
func (m *VersionMutation) 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 (*VersionMutation) AddedFields ¶
func (m *VersionMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*VersionMutation) AddedIDs ¶
func (m *VersionMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*VersionMutation) AddedNumber ¶
func (m *VersionMutation) AddedNumber() (r int64, exists bool)
AddedNumber returns the value that was added to the "number" field in this mutation.
func (*VersionMutation) Channel ¶ added in v0.3.0
func (m *VersionMutation) Channel() (r version.Channel, exists bool)
Channel returns the value of the "channel" field in the mutation.
func (*VersionMutation) ClearEdge ¶
func (m *VersionMutation) 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 (*VersionMutation) ClearField ¶
func (m *VersionMutation) 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 (*VersionMutation) ClearResource ¶
func (m *VersionMutation) ClearResource()
ClearResource clears the "resource" edge to the Resource entity.
func (*VersionMutation) ClearStorages ¶ added in v0.3.0
func (m *VersionMutation) ClearStorages()
ClearStorages clears the "storages" edge to the Storage entity.
func (*VersionMutation) ClearedEdges ¶
func (m *VersionMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*VersionMutation) ClearedFields ¶
func (m *VersionMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (VersionMutation) Client ¶
func (m VersionMutation) 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 (*VersionMutation) CreatedAt ¶
func (m *VersionMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*VersionMutation) EdgeCleared ¶
func (m *VersionMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*VersionMutation) Field ¶
func (m *VersionMutation) 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 (*VersionMutation) FieldCleared ¶
func (m *VersionMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*VersionMutation) Fields ¶
func (m *VersionMutation) 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 (*VersionMutation) ID ¶
func (m *VersionMutation) 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 (*VersionMutation) IDs ¶
func (m *VersionMutation) 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 (*VersionMutation) Name ¶
func (m *VersionMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*VersionMutation) Number ¶
func (m *VersionMutation) Number() (r uint64, exists bool)
Number returns the value of the "number" field in the mutation.
func (*VersionMutation) OldChannel ¶ added in v0.3.0
OldChannel returns the old "channel" field's value of the Version entity. If the Version 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 (*VersionMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Version entity. If the Version 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 (*VersionMutation) 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 (*VersionMutation) OldName ¶
func (m *VersionMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Version entity. If the Version 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 (*VersionMutation) OldNumber ¶
func (m *VersionMutation) OldNumber(ctx context.Context) (v uint64, err error)
OldNumber returns the old "number" field's value of the Version entity. If the Version 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 (*VersionMutation) RemoveStorageIDs ¶
func (m *VersionMutation) RemoveStorageIDs(ids ...int)
RemoveStorageIDs removes the "storages" edge to the Storage entity by IDs.
func (*VersionMutation) RemovedEdges ¶
func (m *VersionMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*VersionMutation) RemovedIDs ¶
func (m *VersionMutation) 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 (*VersionMutation) RemovedStoragesIDs ¶ added in v0.3.0
func (m *VersionMutation) RemovedStoragesIDs() (ids []int)
RemovedStorages returns the removed IDs of the "storages" edge to the Storage entity.
func (*VersionMutation) ResetChannel ¶ added in v0.3.0
func (m *VersionMutation) ResetChannel()
ResetChannel resets all changes to the "channel" field.
func (*VersionMutation) ResetCreatedAt ¶
func (m *VersionMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*VersionMutation) ResetEdge ¶
func (m *VersionMutation) 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 (*VersionMutation) ResetField ¶
func (m *VersionMutation) 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 (*VersionMutation) ResetName ¶
func (m *VersionMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*VersionMutation) ResetNumber ¶
func (m *VersionMutation) ResetNumber()
ResetNumber resets all changes to the "number" field.
func (*VersionMutation) ResetResource ¶
func (m *VersionMutation) ResetResource()
ResetResource resets all changes to the "resource" edge.
func (*VersionMutation) ResetStorages ¶ added in v0.3.0
func (m *VersionMutation) ResetStorages()
ResetStorages resets all changes to the "storages" edge.
func (*VersionMutation) ResourceCleared ¶
func (m *VersionMutation) ResourceCleared() bool
ResourceCleared reports if the "resource" edge to the Resource entity was cleared.
func (*VersionMutation) ResourceID ¶
func (m *VersionMutation) ResourceID() (id string, exists bool)
ResourceID returns the "resource" edge ID in the mutation.
func (*VersionMutation) ResourceIDs ¶
func (m *VersionMutation) ResourceIDs() (ids []string)
ResourceIDs returns the "resource" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ResourceID instead. It exists only for internal usage by the builders.
func (*VersionMutation) SetChannel ¶ added in v0.3.0
func (m *VersionMutation) SetChannel(v version.Channel)
SetChannel sets the "channel" field.
func (*VersionMutation) SetCreatedAt ¶
func (m *VersionMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*VersionMutation) SetField ¶
func (m *VersionMutation) 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 (*VersionMutation) SetName ¶
func (m *VersionMutation) SetName(s string)
SetName sets the "name" field.
func (*VersionMutation) SetNumber ¶
func (m *VersionMutation) SetNumber(u uint64)
SetNumber sets the "number" field.
func (*VersionMutation) SetOp ¶
func (m *VersionMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*VersionMutation) SetResourceID ¶
func (m *VersionMutation) SetResourceID(id string)
SetResourceID sets the "resource" edge to the Resource entity by id.
func (*VersionMutation) StoragesCleared ¶ added in v0.3.0
func (m *VersionMutation) StoragesCleared() bool
StoragesCleared reports if the "storages" edge to the Storage entity was cleared.
func (*VersionMutation) StoragesIDs ¶ added in v0.3.0
func (m *VersionMutation) StoragesIDs() (ids []int)
StoragesIDs returns the "storages" edge IDs in the mutation.
func (VersionMutation) Tx ¶
func (m VersionMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*VersionMutation) Type ¶
func (m *VersionMutation) Type() string
Type returns the node type of this mutation (Version).
func (*VersionMutation) Where ¶
func (m *VersionMutation) Where(ps ...predicate.Version)
Where appends a list predicates to the VersionMutation builder.
func (*VersionMutation) WhereP ¶
func (m *VersionMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the VersionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type VersionQuery ¶
type VersionQuery struct {
// contains filtered or unexported fields
}
VersionQuery is the builder for querying Version entities.
func (*VersionQuery) Aggregate ¶
func (vq *VersionQuery) Aggregate(fns ...AggregateFunc) *VersionSelect
Aggregate returns a VersionSelect configured with the given aggregations.
func (*VersionQuery) All ¶
func (vq *VersionQuery) All(ctx context.Context) ([]*Version, error)
All executes the query and returns a list of Versions.
func (*VersionQuery) AllX ¶
func (vq *VersionQuery) AllX(ctx context.Context) []*Version
AllX is like All, but panics if an error occurs.
func (*VersionQuery) Clone ¶
func (vq *VersionQuery) Clone() *VersionQuery
Clone returns a duplicate of the VersionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*VersionQuery) Count ¶
func (vq *VersionQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*VersionQuery) CountX ¶
func (vq *VersionQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*VersionQuery) Exist ¶
func (vq *VersionQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*VersionQuery) ExistX ¶
func (vq *VersionQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*VersionQuery) First ¶
func (vq *VersionQuery) First(ctx context.Context) (*Version, error)
First returns the first Version entity from the query. Returns a *NotFoundError when no Version was found.
func (*VersionQuery) FirstID ¶
func (vq *VersionQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Version ID from the query. Returns a *NotFoundError when no Version ID was found.
func (*VersionQuery) FirstIDX ¶
func (vq *VersionQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*VersionQuery) FirstX ¶
func (vq *VersionQuery) FirstX(ctx context.Context) *Version
FirstX is like First, but panics if an error occurs.
func (*VersionQuery) GroupBy ¶
func (vq *VersionQuery) GroupBy(field string, fields ...string) *VersionGroupBy
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 {
Channel version.Channel `json:"channel,omitempty"`
Count int `json:"count,omitempty"`
}
client.Version.Query().
GroupBy(version.FieldChannel).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*VersionQuery) IDs ¶
func (vq *VersionQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Version IDs.
func (*VersionQuery) IDsX ¶
func (vq *VersionQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*VersionQuery) Limit ¶
func (vq *VersionQuery) Limit(limit int) *VersionQuery
Limit the number of records to be returned by this query.
func (*VersionQuery) Offset ¶
func (vq *VersionQuery) Offset(offset int) *VersionQuery
Offset to start from.
func (*VersionQuery) Only ¶
func (vq *VersionQuery) Only(ctx context.Context) (*Version, error)
Only returns a single Version entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Version entity is found. Returns a *NotFoundError when no Version entities are found.
func (*VersionQuery) OnlyID ¶
func (vq *VersionQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Version ID in the query. Returns a *NotSingularError when more than one Version ID is found. Returns a *NotFoundError when no entities are found.
func (*VersionQuery) OnlyIDX ¶
func (vq *VersionQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*VersionQuery) OnlyX ¶
func (vq *VersionQuery) OnlyX(ctx context.Context) *Version
OnlyX is like Only, but panics if an error occurs.
func (*VersionQuery) Order ¶
func (vq *VersionQuery) Order(o ...version.OrderOption) *VersionQuery
Order specifies how the records should be ordered.
func (*VersionQuery) QueryResource ¶
func (vq *VersionQuery) QueryResource() *ResourceQuery
QueryResource chains the current query on the "resource" edge.
func (*VersionQuery) QueryStorages ¶ added in v0.3.0
func (vq *VersionQuery) QueryStorages() *StorageQuery
QueryStorages chains the current query on the "storages" edge.
func (*VersionQuery) Select ¶
func (vq *VersionQuery) Select(fields ...string) *VersionSelect
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 {
Channel version.Channel `json:"channel,omitempty"`
}
client.Version.Query().
Select(version.FieldChannel).
Scan(ctx, &v)
func (*VersionQuery) Unique ¶
func (vq *VersionQuery) Unique(unique bool) *VersionQuery
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 (*VersionQuery) Where ¶
func (vq *VersionQuery) Where(ps ...predicate.Version) *VersionQuery
Where adds a new predicate for the VersionQuery builder.
func (*VersionQuery) WithResource ¶
func (vq *VersionQuery) WithResource(opts ...func(*ResourceQuery)) *VersionQuery
WithResource tells the query-builder to eager-load the nodes that are connected to the "resource" edge. The optional arguments are used to configure the query builder of the edge.
func (*VersionQuery) WithStorages ¶ added in v0.3.0
func (vq *VersionQuery) WithStorages(opts ...func(*StorageQuery)) *VersionQuery
WithStorages tells the query-builder to eager-load the nodes that are connected to the "storages" edge. The optional arguments are used to configure the query builder of the edge.
type VersionSelect ¶
type VersionSelect struct {
*VersionQuery
// contains filtered or unexported fields
}
VersionSelect is the builder for selecting fields of Version entities.
func (*VersionSelect) Aggregate ¶
func (vs *VersionSelect) Aggregate(fns ...AggregateFunc) *VersionSelect
Aggregate adds the given aggregation functions to the selector query.
func (*VersionSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*VersionSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*VersionSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*VersionSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*VersionSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*VersionSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*VersionSelect) Scan ¶
func (vs *VersionSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*VersionSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type VersionUpdate ¶
type VersionUpdate struct {
// contains filtered or unexported fields
}
VersionUpdate is the builder for updating Version entities.
func (*VersionUpdate) AddNumber ¶
func (vu *VersionUpdate) AddNumber(u int64) *VersionUpdate
AddNumber adds u to the "number" field.
func (*VersionUpdate) AddStorageIDs ¶
func (vu *VersionUpdate) AddStorageIDs(ids ...int) *VersionUpdate
AddStorageIDs adds the "storages" edge to the Storage entity by IDs.
func (*VersionUpdate) AddStorages ¶ added in v0.3.0
func (vu *VersionUpdate) AddStorages(s ...*Storage) *VersionUpdate
AddStorages adds the "storages" edges to the Storage entity.
func (*VersionUpdate) ClearResource ¶
func (vu *VersionUpdate) ClearResource() *VersionUpdate
ClearResource clears the "resource" edge to the Resource entity.
func (*VersionUpdate) ClearStorages ¶ added in v0.3.0
func (vu *VersionUpdate) ClearStorages() *VersionUpdate
ClearStorages clears all "storages" edges to the Storage entity.
func (*VersionUpdate) Exec ¶
func (vu *VersionUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*VersionUpdate) ExecX ¶
func (vu *VersionUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VersionUpdate) Mutation ¶
func (vu *VersionUpdate) Mutation() *VersionMutation
Mutation returns the VersionMutation object of the builder.
func (*VersionUpdate) RemoveStorageIDs ¶
func (vu *VersionUpdate) RemoveStorageIDs(ids ...int) *VersionUpdate
RemoveStorageIDs removes the "storages" edge to Storage entities by IDs.
func (*VersionUpdate) RemoveStorages ¶ added in v0.3.0
func (vu *VersionUpdate) RemoveStorages(s ...*Storage) *VersionUpdate
RemoveStorages removes "storages" edges to Storage entities.
func (*VersionUpdate) Save ¶
func (vu *VersionUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*VersionUpdate) SaveX ¶
func (vu *VersionUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*VersionUpdate) SetChannel ¶ added in v0.3.0
func (vu *VersionUpdate) SetChannel(v version.Channel) *VersionUpdate
SetChannel sets the "channel" field.
func (*VersionUpdate) SetCreatedAt ¶
func (vu *VersionUpdate) SetCreatedAt(t time.Time) *VersionUpdate
SetCreatedAt sets the "created_at" field.
func (*VersionUpdate) SetName ¶
func (vu *VersionUpdate) SetName(s string) *VersionUpdate
SetName sets the "name" field.
func (*VersionUpdate) SetNillableChannel ¶ added in v0.3.0
func (vu *VersionUpdate) SetNillableChannel(v *version.Channel) *VersionUpdate
SetNillableChannel sets the "channel" field if the given value is not nil.
func (*VersionUpdate) SetNillableCreatedAt ¶
func (vu *VersionUpdate) SetNillableCreatedAt(t *time.Time) *VersionUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*VersionUpdate) SetNillableName ¶
func (vu *VersionUpdate) SetNillableName(s *string) *VersionUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*VersionUpdate) SetNillableNumber ¶
func (vu *VersionUpdate) SetNillableNumber(u *uint64) *VersionUpdate
SetNillableNumber sets the "number" field if the given value is not nil.
func (*VersionUpdate) SetNillableResourceID ¶
func (vu *VersionUpdate) SetNillableResourceID(id *string) *VersionUpdate
SetNillableResourceID sets the "resource" edge to the Resource entity by ID if the given value is not nil.
func (*VersionUpdate) SetNumber ¶
func (vu *VersionUpdate) SetNumber(u uint64) *VersionUpdate
SetNumber sets the "number" field.
func (*VersionUpdate) SetResource ¶
func (vu *VersionUpdate) SetResource(r *Resource) *VersionUpdate
SetResource sets the "resource" edge to the Resource entity.
func (*VersionUpdate) SetResourceID ¶
func (vu *VersionUpdate) SetResourceID(id string) *VersionUpdate
SetResourceID sets the "resource" edge to the Resource entity by ID.
func (*VersionUpdate) Where ¶
func (vu *VersionUpdate) Where(ps ...predicate.Version) *VersionUpdate
Where appends a list predicates to the VersionUpdate builder.
type VersionUpdateOne ¶
type VersionUpdateOne struct {
// contains filtered or unexported fields
}
VersionUpdateOne is the builder for updating a single Version entity.
func (*VersionUpdateOne) AddNumber ¶
func (vuo *VersionUpdateOne) AddNumber(u int64) *VersionUpdateOne
AddNumber adds u to the "number" field.
func (*VersionUpdateOne) AddStorageIDs ¶
func (vuo *VersionUpdateOne) AddStorageIDs(ids ...int) *VersionUpdateOne
AddStorageIDs adds the "storages" edge to the Storage entity by IDs.
func (*VersionUpdateOne) AddStorages ¶ added in v0.3.0
func (vuo *VersionUpdateOne) AddStorages(s ...*Storage) *VersionUpdateOne
AddStorages adds the "storages" edges to the Storage entity.
func (*VersionUpdateOne) ClearResource ¶
func (vuo *VersionUpdateOne) ClearResource() *VersionUpdateOne
ClearResource clears the "resource" edge to the Resource entity.
func (*VersionUpdateOne) ClearStorages ¶ added in v0.3.0
func (vuo *VersionUpdateOne) ClearStorages() *VersionUpdateOne
ClearStorages clears all "storages" edges to the Storage entity.
func (*VersionUpdateOne) Exec ¶
func (vuo *VersionUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*VersionUpdateOne) ExecX ¶
func (vuo *VersionUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VersionUpdateOne) Mutation ¶
func (vuo *VersionUpdateOne) Mutation() *VersionMutation
Mutation returns the VersionMutation object of the builder.
func (*VersionUpdateOne) RemoveStorageIDs ¶
func (vuo *VersionUpdateOne) RemoveStorageIDs(ids ...int) *VersionUpdateOne
RemoveStorageIDs removes the "storages" edge to Storage entities by IDs.
func (*VersionUpdateOne) RemoveStorages ¶ added in v0.3.0
func (vuo *VersionUpdateOne) RemoveStorages(s ...*Storage) *VersionUpdateOne
RemoveStorages removes "storages" edges to Storage entities.
func (*VersionUpdateOne) Save ¶
func (vuo *VersionUpdateOne) Save(ctx context.Context) (*Version, error)
Save executes the query and returns the updated Version entity.
func (*VersionUpdateOne) SaveX ¶
func (vuo *VersionUpdateOne) SaveX(ctx context.Context) *Version
SaveX is like Save, but panics if an error occurs.
func (*VersionUpdateOne) Select ¶
func (vuo *VersionUpdateOne) Select(field string, fields ...string) *VersionUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*VersionUpdateOne) SetChannel ¶ added in v0.3.0
func (vuo *VersionUpdateOne) SetChannel(v version.Channel) *VersionUpdateOne
SetChannel sets the "channel" field.
func (*VersionUpdateOne) SetCreatedAt ¶
func (vuo *VersionUpdateOne) SetCreatedAt(t time.Time) *VersionUpdateOne
SetCreatedAt sets the "created_at" field.
func (*VersionUpdateOne) SetName ¶
func (vuo *VersionUpdateOne) SetName(s string) *VersionUpdateOne
SetName sets the "name" field.
func (*VersionUpdateOne) SetNillableChannel ¶ added in v0.3.0
func (vuo *VersionUpdateOne) SetNillableChannel(v *version.Channel) *VersionUpdateOne
SetNillableChannel sets the "channel" field if the given value is not nil.
func (*VersionUpdateOne) SetNillableCreatedAt ¶
func (vuo *VersionUpdateOne) SetNillableCreatedAt(t *time.Time) *VersionUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*VersionUpdateOne) SetNillableName ¶
func (vuo *VersionUpdateOne) SetNillableName(s *string) *VersionUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*VersionUpdateOne) SetNillableNumber ¶
func (vuo *VersionUpdateOne) SetNillableNumber(u *uint64) *VersionUpdateOne
SetNillableNumber sets the "number" field if the given value is not nil.
func (*VersionUpdateOne) SetNillableResourceID ¶
func (vuo *VersionUpdateOne) SetNillableResourceID(id *string) *VersionUpdateOne
SetNillableResourceID sets the "resource" edge to the Resource entity by ID if the given value is not nil.
func (*VersionUpdateOne) SetNumber ¶
func (vuo *VersionUpdateOne) SetNumber(u uint64) *VersionUpdateOne
SetNumber sets the "number" field.
func (*VersionUpdateOne) SetResource ¶
func (vuo *VersionUpdateOne) SetResource(r *Resource) *VersionUpdateOne
SetResource sets the "resource" edge to the Resource entity.
func (*VersionUpdateOne) SetResourceID ¶
func (vuo *VersionUpdateOne) SetResourceID(id string) *VersionUpdateOne
SetResourceID sets the "resource" edge to the Resource entity by ID.
func (*VersionUpdateOne) Where ¶
func (vuo *VersionUpdateOne) Where(ps ...predicate.Version) *VersionUpdateOne
Where appends a list predicates to the VersionUpdate builder.
type VersionUpsert ¶ added in v0.3.0
VersionUpsert is the "OnConflict" setter.
func (*VersionUpsert) AddNumber ¶ added in v0.3.0
func (u *VersionUpsert) AddNumber(v uint64) *VersionUpsert
AddNumber adds v to the "number" field.
func (*VersionUpsert) SetChannel ¶ added in v0.3.0
func (u *VersionUpsert) SetChannel(v version.Channel) *VersionUpsert
SetChannel sets the "channel" field.
func (*VersionUpsert) SetCreatedAt ¶ added in v0.3.0
func (u *VersionUpsert) SetCreatedAt(v time.Time) *VersionUpsert
SetCreatedAt sets the "created_at" field.
func (*VersionUpsert) SetName ¶ added in v0.3.0
func (u *VersionUpsert) SetName(v string) *VersionUpsert
SetName sets the "name" field.
func (*VersionUpsert) SetNumber ¶ added in v0.3.0
func (u *VersionUpsert) SetNumber(v uint64) *VersionUpsert
SetNumber sets the "number" field.
func (*VersionUpsert) UpdateChannel ¶ added in v0.3.0
func (u *VersionUpsert) UpdateChannel() *VersionUpsert
UpdateChannel sets the "channel" field to the value that was provided on create.
func (*VersionUpsert) UpdateCreatedAt ¶ added in v0.3.0
func (u *VersionUpsert) UpdateCreatedAt() *VersionUpsert
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*VersionUpsert) UpdateName ¶ added in v0.3.0
func (u *VersionUpsert) UpdateName() *VersionUpsert
UpdateName sets the "name" field to the value that was provided on create.
func (*VersionUpsert) UpdateNumber ¶ added in v0.3.0
func (u *VersionUpsert) UpdateNumber() *VersionUpsert
UpdateNumber sets the "number" field to the value that was provided on create.
type VersionUpsertBulk ¶ added in v0.3.0
type VersionUpsertBulk struct {
// contains filtered or unexported fields
}
VersionUpsertBulk is the builder for "upsert"-ing a bulk of Version nodes.
func (*VersionUpsertBulk) AddNumber ¶ added in v0.3.0
func (u *VersionUpsertBulk) AddNumber(v uint64) *VersionUpsertBulk
AddNumber adds v to the "number" field.
func (*VersionUpsertBulk) DoNothing ¶ added in v0.3.0
func (u *VersionUpsertBulk) DoNothing() *VersionUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*VersionUpsertBulk) Exec ¶ added in v0.3.0
func (u *VersionUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*VersionUpsertBulk) ExecX ¶ added in v0.3.0
func (u *VersionUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VersionUpsertBulk) Ignore ¶ added in v0.3.0
func (u *VersionUpsertBulk) Ignore() *VersionUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Version.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*VersionUpsertBulk) SetChannel ¶ added in v0.3.0
func (u *VersionUpsertBulk) SetChannel(v version.Channel) *VersionUpsertBulk
SetChannel sets the "channel" field.
func (*VersionUpsertBulk) SetCreatedAt ¶ added in v0.3.0
func (u *VersionUpsertBulk) SetCreatedAt(v time.Time) *VersionUpsertBulk
SetCreatedAt sets the "created_at" field.
func (*VersionUpsertBulk) SetName ¶ added in v0.3.0
func (u *VersionUpsertBulk) SetName(v string) *VersionUpsertBulk
SetName sets the "name" field.
func (*VersionUpsertBulk) SetNumber ¶ added in v0.3.0
func (u *VersionUpsertBulk) SetNumber(v uint64) *VersionUpsertBulk
SetNumber sets the "number" field.
func (*VersionUpsertBulk) Update ¶ added in v0.3.0
func (u *VersionUpsertBulk) Update(set func(*VersionUpsert)) *VersionUpsertBulk
Update allows overriding fields `UPDATE` values. See the VersionCreateBulk.OnConflict documentation for more info.
func (*VersionUpsertBulk) UpdateChannel ¶ added in v0.3.0
func (u *VersionUpsertBulk) UpdateChannel() *VersionUpsertBulk
UpdateChannel sets the "channel" field to the value that was provided on create.
func (*VersionUpsertBulk) UpdateCreatedAt ¶ added in v0.3.0
func (u *VersionUpsertBulk) UpdateCreatedAt() *VersionUpsertBulk
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*VersionUpsertBulk) UpdateName ¶ added in v0.3.0
func (u *VersionUpsertBulk) UpdateName() *VersionUpsertBulk
UpdateName sets the "name" field to the value that was provided on create.
func (*VersionUpsertBulk) UpdateNewValues ¶ added in v0.3.0
func (u *VersionUpsertBulk) UpdateNewValues() *VersionUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Version.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*VersionUpsertBulk) UpdateNumber ¶ added in v0.3.0
func (u *VersionUpsertBulk) UpdateNumber() *VersionUpsertBulk
UpdateNumber sets the "number" field to the value that was provided on create.
type VersionUpsertOne ¶ added in v0.3.0
type VersionUpsertOne struct {
// contains filtered or unexported fields
}
VersionUpsertOne is the builder for "upsert"-ing
one Version node.
func (*VersionUpsertOne) AddNumber ¶ added in v0.3.0
func (u *VersionUpsertOne) AddNumber(v uint64) *VersionUpsertOne
AddNumber adds v to the "number" field.
func (*VersionUpsertOne) DoNothing ¶ added in v0.3.0
func (u *VersionUpsertOne) DoNothing() *VersionUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*VersionUpsertOne) Exec ¶ added in v0.3.0
func (u *VersionUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*VersionUpsertOne) ExecX ¶ added in v0.3.0
func (u *VersionUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VersionUpsertOne) ID ¶ added in v0.3.0
func (u *VersionUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*VersionUpsertOne) IDX ¶ added in v0.3.0
func (u *VersionUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*VersionUpsertOne) Ignore ¶ added in v0.3.0
func (u *VersionUpsertOne) Ignore() *VersionUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Version.Create().
OnConflict(sql.ResolveWithIgnore()).
Exec(ctx)
func (*VersionUpsertOne) SetChannel ¶ added in v0.3.0
func (u *VersionUpsertOne) SetChannel(v version.Channel) *VersionUpsertOne
SetChannel sets the "channel" field.
func (*VersionUpsertOne) SetCreatedAt ¶ added in v0.3.0
func (u *VersionUpsertOne) SetCreatedAt(v time.Time) *VersionUpsertOne
SetCreatedAt sets the "created_at" field.
func (*VersionUpsertOne) SetName ¶ added in v0.3.0
func (u *VersionUpsertOne) SetName(v string) *VersionUpsertOne
SetName sets the "name" field.
func (*VersionUpsertOne) SetNumber ¶ added in v0.3.0
func (u *VersionUpsertOne) SetNumber(v uint64) *VersionUpsertOne
SetNumber sets the "number" field.
func (*VersionUpsertOne) Update ¶ added in v0.3.0
func (u *VersionUpsertOne) Update(set func(*VersionUpsert)) *VersionUpsertOne
Update allows overriding fields `UPDATE` values. See the VersionCreate.OnConflict documentation for more info.
func (*VersionUpsertOne) UpdateChannel ¶ added in v0.3.0
func (u *VersionUpsertOne) UpdateChannel() *VersionUpsertOne
UpdateChannel sets the "channel" field to the value that was provided on create.
func (*VersionUpsertOne) UpdateCreatedAt ¶ added in v0.3.0
func (u *VersionUpsertOne) UpdateCreatedAt() *VersionUpsertOne
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*VersionUpsertOne) UpdateName ¶ added in v0.3.0
func (u *VersionUpsertOne) UpdateName() *VersionUpsertOne
UpdateName sets the "name" field to the value that was provided on create.
func (*VersionUpsertOne) UpdateNewValues ¶ added in v0.3.0
func (u *VersionUpsertOne) UpdateNewValues() *VersionUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Version.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*VersionUpsertOne) UpdateNumber ¶ added in v0.3.0
func (u *VersionUpsertOne) UpdateNumber() *VersionUpsertOne
UpdateNumber sets the "number" field to the value that was provided on create.
Source Files
¶
- client.go
- ent.go
- generate.go
- latestversion.go
- latestversion_create.go
- latestversion_delete.go
- latestversion_query.go
- latestversion_update.go
- mutation.go
- resource.go
- resource_create.go
- resource_delete.go
- resource_query.go
- resource_update.go
- runtime.go
- storage.go
- storage_create.go
- storage_delete.go
- storage_query.go
- storage_update.go
- tx.go
- version.go
- version_create.go
- version_delete.go
- version_query.go
- version_update.go