Documentation ¶
Index ¶
- Constants
- 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 CPUCreate
- func (cc *CPUCreate) Exec(ctx context.Context) error
- func (cc *CPUCreate) ExecX(ctx context.Context)
- func (cc *CPUCreate) Mutation() *CPUMutation
- func (cc *CPUCreate) Save(ctx context.Context) (*Cpu, error)
- func (cc *CPUCreate) SaveX(ctx context.Context) *Cpu
- func (cc *CPUCreate) SetCPU(i int) *CPUCreate
- func (cc *CPUCreate) SetCreatedAt(t time.Time) *CPUCreate
- func (cc *CPUCreate) SetFamily(s string) *CPUCreate
- func (cc *CPUCreate) SetHostID(h *Host) *CPUCreate
- func (cc *CPUCreate) SetHostIDID(id string) *CPUCreate
- func (cc *CPUCreate) SetModel(s string) *CPUCreate
- func (cc *CPUCreate) SetModelName(s string) *CPUCreate
- func (cc *CPUCreate) SetNillableCreatedAt(t *time.Time) *CPUCreate
- func (cc *CPUCreate) SetNillableHostIDID(id *string) *CPUCreate
- func (cc *CPUCreate) SetNillableUpdatedAt(t *time.Time) *CPUCreate
- func (cc *CPUCreate) SetUpdatedAt(t time.Time) *CPUCreate
- func (cc *CPUCreate) SetVendorID(s string) *CPUCreate
- type CPUCreateBulk
- type CPUDelete
- type CPUDeleteOne
- type CPUGroupBy
- func (cgb *CPUGroupBy) Aggregate(fns ...AggregateFunc) *CPUGroupBy
- func (cgb *CPUGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (cgb *CPUGroupBy) BoolX(ctx context.Context) bool
- func (cgb *CPUGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (cgb *CPUGroupBy) BoolsX(ctx context.Context) []bool
- func (cgb *CPUGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (cgb *CPUGroupBy) Float64X(ctx context.Context) float64
- func (cgb *CPUGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (cgb *CPUGroupBy) Float64sX(ctx context.Context) []float64
- func (cgb *CPUGroupBy) Int(ctx context.Context) (_ int, err error)
- func (cgb *CPUGroupBy) IntX(ctx context.Context) int
- func (cgb *CPUGroupBy) Ints(ctx context.Context) ([]int, error)
- func (cgb *CPUGroupBy) IntsX(ctx context.Context) []int
- func (cgb *CPUGroupBy) Scan(ctx context.Context, v interface{}) error
- func (cgb *CPUGroupBy) ScanX(ctx context.Context, v interface{})
- func (cgb *CPUGroupBy) String(ctx context.Context) (_ string, err error)
- func (cgb *CPUGroupBy) StringX(ctx context.Context) string
- func (cgb *CPUGroupBy) Strings(ctx context.Context) ([]string, error)
- func (cgb *CPUGroupBy) StringsX(ctx context.Context) []string
- type CPUMutation
- func (m *CPUMutation) AddCPU(i int)
- func (m *CPUMutation) AddField(name string, value ent.Value) error
- func (m *CPUMutation) AddedCPU() (r int, exists bool)
- func (m *CPUMutation) AddedEdges() []string
- func (m *CPUMutation) AddedField(name string) (ent.Value, bool)
- func (m *CPUMutation) AddedFields() []string
- func (m *CPUMutation) AddedIDs(name string) []ent.Value
- func (m *CPUMutation) CPU() (r int, exists bool)
- func (m *CPUMutation) ClearEdge(name string) error
- func (m *CPUMutation) ClearField(name string) error
- func (m *CPUMutation) ClearHostID()
- func (m *CPUMutation) ClearedEdges() []string
- func (m *CPUMutation) ClearedFields() []string
- func (m CPUMutation) Client() *Client
- func (m *CPUMutation) CreatedAt() (r time.Time, exists bool)
- func (m *CPUMutation) EdgeCleared(name string) bool
- func (m *CPUMutation) Family() (r string, exists bool)
- func (m *CPUMutation) Field(name string) (ent.Value, bool)
- func (m *CPUMutation) FieldCleared(name string) bool
- func (m *CPUMutation) Fields() []string
- func (m *CPUMutation) HostIDCleared() bool
- func (m *CPUMutation) HostIDID() (id string, exists bool)
- func (m *CPUMutation) HostIDIDs() (ids []string)
- func (m *CPUMutation) ID() (id int, exists bool)
- func (m *CPUMutation) IDs(ctx context.Context) ([]int, error)
- func (m *CPUMutation) Model() (r string, exists bool)
- func (m *CPUMutation) ModelName() (r string, exists bool)
- func (m *CPUMutation) OldCPU(ctx context.Context) (v int, err error)
- func (m *CPUMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *CPUMutation) OldFamily(ctx context.Context) (v string, err error)
- func (m *CPUMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CPUMutation) OldModel(ctx context.Context) (v string, err error)
- func (m *CPUMutation) OldModelName(ctx context.Context) (v string, err error)
- func (m *CPUMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *CPUMutation) OldVendorID(ctx context.Context) (v string, err error)
- func (m *CPUMutation) Op() Op
- func (m *CPUMutation) RemovedEdges() []string
- func (m *CPUMutation) RemovedIDs(name string) []ent.Value
- func (m *CPUMutation) ResetCPU()
- func (m *CPUMutation) ResetCreatedAt()
- func (m *CPUMutation) ResetEdge(name string) error
- func (m *CPUMutation) ResetFamily()
- func (m *CPUMutation) ResetField(name string) error
- func (m *CPUMutation) ResetHostID()
- func (m *CPUMutation) ResetModel()
- func (m *CPUMutation) ResetModelName()
- func (m *CPUMutation) ResetUpdatedAt()
- func (m *CPUMutation) ResetVendorID()
- func (m *CPUMutation) SetCPU(i int)
- func (m *CPUMutation) SetCreatedAt(t time.Time)
- func (m *CPUMutation) SetFamily(s string)
- func (m *CPUMutation) SetField(name string, value ent.Value) error
- func (m *CPUMutation) SetHostIDID(id string)
- func (m *CPUMutation) SetModel(s string)
- func (m *CPUMutation) SetModelName(s string)
- func (m *CPUMutation) SetUpdatedAt(t time.Time)
- func (m *CPUMutation) SetVendorID(s string)
- func (m CPUMutation) Tx() (*Tx, error)
- func (m *CPUMutation) Type() string
- func (m *CPUMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *CPUMutation) VendorID() (r string, exists bool)
- func (m *CPUMutation) Where(ps ...predicate.Cpu)
- type CPUQuery
- func (cq *CPUQuery) All(ctx context.Context) ([]*Cpu, error)
- func (cq *CPUQuery) AllX(ctx context.Context) []*Cpu
- func (cq *CPUQuery) Clone() *CPUQuery
- func (cq *CPUQuery) Count(ctx context.Context) (int, error)
- func (cq *CPUQuery) CountX(ctx context.Context) int
- func (cq *CPUQuery) Exist(ctx context.Context) (bool, error)
- func (cq *CPUQuery) ExistX(ctx context.Context) bool
- func (cq *CPUQuery) First(ctx context.Context) (*Cpu, error)
- func (cq *CPUQuery) FirstID(ctx context.Context) (id int, err error)
- func (cq *CPUQuery) FirstIDX(ctx context.Context) int
- func (cq *CPUQuery) FirstX(ctx context.Context) *Cpu
- func (cq *CPUQuery) GroupBy(field string, fields ...string) *CPUGroupBy
- func (cq *CPUQuery) IDs(ctx context.Context) ([]int, error)
- func (cq *CPUQuery) IDsX(ctx context.Context) []int
- func (cq *CPUQuery) Limit(limit int) *CPUQuery
- func (cq *CPUQuery) Offset(offset int) *CPUQuery
- func (cq *CPUQuery) Only(ctx context.Context) (*Cpu, error)
- func (cq *CPUQuery) OnlyID(ctx context.Context) (id int, err error)
- func (cq *CPUQuery) OnlyIDX(ctx context.Context) int
- func (cq *CPUQuery) OnlyX(ctx context.Context) *Cpu
- func (cq *CPUQuery) Order(o ...OrderFunc) *CPUQuery
- func (cq *CPUQuery) QueryHostID() *HostQuery
- func (cq *CPUQuery) Select(fields ...string) *CPUSelect
- func (cq *CPUQuery) Unique(unique bool) *CPUQuery
- func (cq *CPUQuery) Where(ps ...predicate.Cpu) *CPUQuery
- func (cq *CPUQuery) WithHostID(opts ...func(*HostQuery)) *CPUQuery
- type CPUSelect
- func (cs *CPUSelect) Bool(ctx context.Context) (_ bool, err error)
- func (cs *CPUSelect) BoolX(ctx context.Context) bool
- func (cs *CPUSelect) Bools(ctx context.Context) ([]bool, error)
- func (cs *CPUSelect) BoolsX(ctx context.Context) []bool
- func (cs *CPUSelect) Float64(ctx context.Context) (_ float64, err error)
- func (cs *CPUSelect) Float64X(ctx context.Context) float64
- func (cs *CPUSelect) Float64s(ctx context.Context) ([]float64, error)
- func (cs *CPUSelect) Float64sX(ctx context.Context) []float64
- func (cs *CPUSelect) Int(ctx context.Context) (_ int, err error)
- func (cs *CPUSelect) IntX(ctx context.Context) int
- func (cs *CPUSelect) Ints(ctx context.Context) ([]int, error)
- func (cs *CPUSelect) IntsX(ctx context.Context) []int
- func (cs *CPUSelect) Scan(ctx context.Context, v interface{}) error
- func (cs *CPUSelect) ScanX(ctx context.Context, v interface{})
- func (cs *CPUSelect) String(ctx context.Context) (_ string, err error)
- func (cs *CPUSelect) StringX(ctx context.Context) string
- func (cs *CPUSelect) Strings(ctx context.Context) ([]string, error)
- func (cs *CPUSelect) StringsX(ctx context.Context) []string
- type CPUUpdate
- func (cu *CPUUpdate) AddCPU(i int) *CPUUpdate
- func (cu *CPUUpdate) ClearHostID() *CPUUpdate
- func (cu *CPUUpdate) Exec(ctx context.Context) error
- func (cu *CPUUpdate) ExecX(ctx context.Context)
- func (cu *CPUUpdate) Mutation() *CPUMutation
- func (cu *CPUUpdate) Save(ctx context.Context) (int, error)
- func (cu *CPUUpdate) SaveX(ctx context.Context) int
- func (cu *CPUUpdate) SetCPU(i int) *CPUUpdate
- func (cu *CPUUpdate) SetCreatedAt(t time.Time) *CPUUpdate
- func (cu *CPUUpdate) SetFamily(s string) *CPUUpdate
- func (cu *CPUUpdate) SetHostID(h *Host) *CPUUpdate
- func (cu *CPUUpdate) SetHostIDID(id string) *CPUUpdate
- func (cu *CPUUpdate) SetModel(s string) *CPUUpdate
- func (cu *CPUUpdate) SetModelName(s string) *CPUUpdate
- func (cu *CPUUpdate) SetNillableCreatedAt(t *time.Time) *CPUUpdate
- func (cu *CPUUpdate) SetNillableHostIDID(id *string) *CPUUpdate
- func (cu *CPUUpdate) SetNillableUpdatedAt(t *time.Time) *CPUUpdate
- func (cu *CPUUpdate) SetUpdatedAt(t time.Time) *CPUUpdate
- func (cu *CPUUpdate) SetVendorID(s string) *CPUUpdate
- func (cu *CPUUpdate) Where(ps ...predicate.Cpu) *CPUUpdate
- type CPUUpdateOne
- func (cuo *CPUUpdateOne) AddCPU(i int) *CPUUpdateOne
- func (cuo *CPUUpdateOne) ClearHostID() *CPUUpdateOne
- func (cuo *CPUUpdateOne) Exec(ctx context.Context) error
- func (cuo *CPUUpdateOne) ExecX(ctx context.Context)
- func (cuo *CPUUpdateOne) Mutation() *CPUMutation
- func (cuo *CPUUpdateOne) Save(ctx context.Context) (*Cpu, error)
- func (cuo *CPUUpdateOne) SaveX(ctx context.Context) *Cpu
- func (cuo *CPUUpdateOne) Select(field string, fields ...string) *CPUUpdateOne
- func (cuo *CPUUpdateOne) SetCPU(i int) *CPUUpdateOne
- func (cuo *CPUUpdateOne) SetCreatedAt(t time.Time) *CPUUpdateOne
- func (cuo *CPUUpdateOne) SetFamily(s string) *CPUUpdateOne
- func (cuo *CPUUpdateOne) SetHostID(h *Host) *CPUUpdateOne
- func (cuo *CPUUpdateOne) SetHostIDID(id string) *CPUUpdateOne
- func (cuo *CPUUpdateOne) SetModel(s string) *CPUUpdateOne
- func (cuo *CPUUpdateOne) SetModelName(s string) *CPUUpdateOne
- func (cuo *CPUUpdateOne) SetNillableCreatedAt(t *time.Time) *CPUUpdateOne
- func (cuo *CPUUpdateOne) SetNillableHostIDID(id *string) *CPUUpdateOne
- func (cuo *CPUUpdateOne) SetNillableUpdatedAt(t *time.Time) *CPUUpdateOne
- func (cuo *CPUUpdateOne) SetUpdatedAt(t time.Time) *CPUUpdateOne
- func (cuo *CPUUpdateOne) SetVendorID(s string) *CPUUpdateOne
- type Client
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Cpu
- type CpuClient
- func (c *CpuClient) Create() *CPUCreate
- func (c *CpuClient) CreateBulk(builders ...*CPUCreate) *CPUCreateBulk
- func (c *CpuClient) Delete() *CPUDelete
- func (c *CpuClient) DeleteOne(cp *Cpu) *CPUDeleteOne
- func (c *CpuClient) DeleteOneID(id int) *CPUDeleteOne
- func (c *CpuClient) Get(ctx context.Context, id int) (*Cpu, error)
- func (c *CpuClient) GetX(ctx context.Context, id int) *Cpu
- func (c *CpuClient) Hooks() []Hook
- func (c *CpuClient) Query() *CPUQuery
- func (c *CpuClient) QueryHostID(cp *Cpu) *HostQuery
- func (c *CpuClient) Update() *CPUUpdate
- func (c *CpuClient) UpdateOne(cp *Cpu) *CPUUpdateOne
- func (c *CpuClient) UpdateOneID(id int) *CPUUpdateOne
- func (c *CpuClient) Use(hooks ...Hook)
- type CpuEdges
- type Cpus
- type Disk
- type DiskClient
- func (c *DiskClient) Create() *DiskCreate
- func (c *DiskClient) CreateBulk(builders ...*DiskCreate) *DiskCreateBulk
- func (c *DiskClient) Delete() *DiskDelete
- func (c *DiskClient) DeleteOne(d *Disk) *DiskDeleteOne
- func (c *DiskClient) DeleteOneID(id int) *DiskDeleteOne
- func (c *DiskClient) Get(ctx context.Context, id int) (*Disk, error)
- func (c *DiskClient) GetX(ctx context.Context, id int) *Disk
- func (c *DiskClient) Hooks() []Hook
- func (c *DiskClient) Query() *DiskQuery
- func (c *DiskClient) QueryHostID(d *Disk) *HostQuery
- func (c *DiskClient) Update() *DiskUpdate
- func (c *DiskClient) UpdateOne(d *Disk) *DiskUpdateOne
- func (c *DiskClient) UpdateOneID(id int) *DiskUpdateOne
- func (c *DiskClient) Use(hooks ...Hook)
- type DiskCreate
- func (dc *DiskCreate) Exec(ctx context.Context) error
- func (dc *DiskCreate) ExecX(ctx context.Context)
- func (dc *DiskCreate) Mutation() *DiskMutation
- func (dc *DiskCreate) Save(ctx context.Context) (*Disk, error)
- func (dc *DiskCreate) SaveX(ctx context.Context) *Disk
- func (dc *DiskCreate) SetCreatedAt(t time.Time) *DiskCreate
- func (dc *DiskCreate) SetDevice(s string) *DiskCreate
- func (dc *DiskCreate) SetFstype(s string) *DiskCreate
- func (dc *DiskCreate) SetHostID(h *Host) *DiskCreate
- func (dc *DiskCreate) SetHostIDID(id string) *DiskCreate
- func (dc *DiskCreate) SetMountpoint(s string) *DiskCreate
- func (dc *DiskCreate) SetNillableCreatedAt(t *time.Time) *DiskCreate
- func (dc *DiskCreate) SetNillableUpdatedAt(t *time.Time) *DiskCreate
- func (dc *DiskCreate) SetOpts(s []string) *DiskCreate
- func (dc *DiskCreate) SetUpdatedAt(t time.Time) *DiskCreate
- type DiskCreateBulk
- type DiskDelete
- type DiskDeleteOne
- type DiskEdges
- type DiskGroupBy
- func (dgb *DiskGroupBy) Aggregate(fns ...AggregateFunc) *DiskGroupBy
- func (dgb *DiskGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (dgb *DiskGroupBy) BoolX(ctx context.Context) bool
- func (dgb *DiskGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (dgb *DiskGroupBy) BoolsX(ctx context.Context) []bool
- func (dgb *DiskGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (dgb *DiskGroupBy) Float64X(ctx context.Context) float64
- func (dgb *DiskGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (dgb *DiskGroupBy) Float64sX(ctx context.Context) []float64
- func (dgb *DiskGroupBy) Int(ctx context.Context) (_ int, err error)
- func (dgb *DiskGroupBy) IntX(ctx context.Context) int
- func (dgb *DiskGroupBy) Ints(ctx context.Context) ([]int, error)
- func (dgb *DiskGroupBy) IntsX(ctx context.Context) []int
- func (dgb *DiskGroupBy) Scan(ctx context.Context, v interface{}) error
- func (dgb *DiskGroupBy) ScanX(ctx context.Context, v interface{})
- func (dgb *DiskGroupBy) String(ctx context.Context) (_ string, err error)
- func (dgb *DiskGroupBy) StringX(ctx context.Context) string
- func (dgb *DiskGroupBy) Strings(ctx context.Context) ([]string, error)
- func (dgb *DiskGroupBy) StringsX(ctx context.Context) []string
- type DiskMutation
- func (m *DiskMutation) AddField(name string, value ent.Value) error
- func (m *DiskMutation) AddedEdges() []string
- func (m *DiskMutation) AddedField(name string) (ent.Value, bool)
- func (m *DiskMutation) AddedFields() []string
- func (m *DiskMutation) AddedIDs(name string) []ent.Value
- func (m *DiskMutation) ClearEdge(name string) error
- func (m *DiskMutation) ClearField(name string) error
- func (m *DiskMutation) ClearHostID()
- func (m *DiskMutation) ClearOpts()
- func (m *DiskMutation) ClearedEdges() []string
- func (m *DiskMutation) ClearedFields() []string
- func (m DiskMutation) Client() *Client
- func (m *DiskMutation) CreatedAt() (r time.Time, exists bool)
- func (m *DiskMutation) Device() (r string, exists bool)
- func (m *DiskMutation) EdgeCleared(name string) bool
- func (m *DiskMutation) Field(name string) (ent.Value, bool)
- func (m *DiskMutation) FieldCleared(name string) bool
- func (m *DiskMutation) Fields() []string
- func (m *DiskMutation) Fstype() (r string, exists bool)
- func (m *DiskMutation) HostIDCleared() bool
- func (m *DiskMutation) HostIDID() (id string, exists bool)
- func (m *DiskMutation) HostIDIDs() (ids []string)
- func (m *DiskMutation) ID() (id int, exists bool)
- func (m *DiskMutation) IDs(ctx context.Context) ([]int, error)
- func (m *DiskMutation) Mountpoint() (r string, exists bool)
- func (m *DiskMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *DiskMutation) OldDevice(ctx context.Context) (v string, err error)
- func (m *DiskMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *DiskMutation) OldFstype(ctx context.Context) (v string, err error)
- func (m *DiskMutation) OldMountpoint(ctx context.Context) (v string, err error)
- func (m *DiskMutation) OldOpts(ctx context.Context) (v []string, err error)
- func (m *DiskMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *DiskMutation) Op() Op
- func (m *DiskMutation) Opts() (r []string, exists bool)
- func (m *DiskMutation) OptsCleared() bool
- func (m *DiskMutation) RemovedEdges() []string
- func (m *DiskMutation) RemovedIDs(name string) []ent.Value
- func (m *DiskMutation) ResetCreatedAt()
- func (m *DiskMutation) ResetDevice()
- func (m *DiskMutation) ResetEdge(name string) error
- func (m *DiskMutation) ResetField(name string) error
- func (m *DiskMutation) ResetFstype()
- func (m *DiskMutation) ResetHostID()
- func (m *DiskMutation) ResetMountpoint()
- func (m *DiskMutation) ResetOpts()
- func (m *DiskMutation) ResetUpdatedAt()
- func (m *DiskMutation) SetCreatedAt(t time.Time)
- func (m *DiskMutation) SetDevice(s string)
- func (m *DiskMutation) SetField(name string, value ent.Value) error
- func (m *DiskMutation) SetFstype(s string)
- func (m *DiskMutation) SetHostIDID(id string)
- func (m *DiskMutation) SetMountpoint(s string)
- func (m *DiskMutation) SetOpts(s []string)
- func (m *DiskMutation) SetUpdatedAt(t time.Time)
- func (m DiskMutation) Tx() (*Tx, error)
- func (m *DiskMutation) Type() string
- func (m *DiskMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *DiskMutation) Where(ps ...predicate.Disk)
- type DiskQuery
- func (dq *DiskQuery) All(ctx context.Context) ([]*Disk, error)
- func (dq *DiskQuery) AllX(ctx context.Context) []*Disk
- func (dq *DiskQuery) Clone() *DiskQuery
- func (dq *DiskQuery) Count(ctx context.Context) (int, error)
- func (dq *DiskQuery) CountX(ctx context.Context) int
- func (dq *DiskQuery) Exist(ctx context.Context) (bool, error)
- func (dq *DiskQuery) ExistX(ctx context.Context) bool
- func (dq *DiskQuery) First(ctx context.Context) (*Disk, error)
- func (dq *DiskQuery) FirstID(ctx context.Context) (id int, err error)
- func (dq *DiskQuery) FirstIDX(ctx context.Context) int
- func (dq *DiskQuery) FirstX(ctx context.Context) *Disk
- func (dq *DiskQuery) GroupBy(field string, fields ...string) *DiskGroupBy
- func (dq *DiskQuery) IDs(ctx context.Context) ([]int, error)
- func (dq *DiskQuery) IDsX(ctx context.Context) []int
- func (dq *DiskQuery) Limit(limit int) *DiskQuery
- func (dq *DiskQuery) Offset(offset int) *DiskQuery
- func (dq *DiskQuery) Only(ctx context.Context) (*Disk, error)
- func (dq *DiskQuery) OnlyID(ctx context.Context) (id int, err error)
- func (dq *DiskQuery) OnlyIDX(ctx context.Context) int
- func (dq *DiskQuery) OnlyX(ctx context.Context) *Disk
- func (dq *DiskQuery) Order(o ...OrderFunc) *DiskQuery
- func (dq *DiskQuery) QueryHostID() *HostQuery
- func (dq *DiskQuery) Select(fields ...string) *DiskSelect
- func (dq *DiskQuery) Unique(unique bool) *DiskQuery
- func (dq *DiskQuery) Where(ps ...predicate.Disk) *DiskQuery
- func (dq *DiskQuery) WithHostID(opts ...func(*HostQuery)) *DiskQuery
- type DiskSelect
- func (ds *DiskSelect) Bool(ctx context.Context) (_ bool, err error)
- func (ds *DiskSelect) BoolX(ctx context.Context) bool
- func (ds *DiskSelect) Bools(ctx context.Context) ([]bool, error)
- func (ds *DiskSelect) BoolsX(ctx context.Context) []bool
- func (ds *DiskSelect) Float64(ctx context.Context) (_ float64, err error)
- func (ds *DiskSelect) Float64X(ctx context.Context) float64
- func (ds *DiskSelect) Float64s(ctx context.Context) ([]float64, error)
- func (ds *DiskSelect) Float64sX(ctx context.Context) []float64
- func (ds *DiskSelect) Int(ctx context.Context) (_ int, err error)
- func (ds *DiskSelect) IntX(ctx context.Context) int
- func (ds *DiskSelect) Ints(ctx context.Context) ([]int, error)
- func (ds *DiskSelect) IntsX(ctx context.Context) []int
- func (ds *DiskSelect) Scan(ctx context.Context, v interface{}) error
- func (ds *DiskSelect) ScanX(ctx context.Context, v interface{})
- func (ds *DiskSelect) String(ctx context.Context) (_ string, err error)
- func (ds *DiskSelect) StringX(ctx context.Context) string
- func (ds *DiskSelect) Strings(ctx context.Context) ([]string, error)
- func (ds *DiskSelect) StringsX(ctx context.Context) []string
- type DiskUpdate
- func (du *DiskUpdate) ClearHostID() *DiskUpdate
- func (du *DiskUpdate) ClearOpts() *DiskUpdate
- func (du *DiskUpdate) Exec(ctx context.Context) error
- func (du *DiskUpdate) ExecX(ctx context.Context)
- func (du *DiskUpdate) Mutation() *DiskMutation
- func (du *DiskUpdate) Save(ctx context.Context) (int, error)
- func (du *DiskUpdate) SaveX(ctx context.Context) int
- func (du *DiskUpdate) SetCreatedAt(t time.Time) *DiskUpdate
- func (du *DiskUpdate) SetDevice(s string) *DiskUpdate
- func (du *DiskUpdate) SetFstype(s string) *DiskUpdate
- func (du *DiskUpdate) SetHostID(h *Host) *DiskUpdate
- func (du *DiskUpdate) SetHostIDID(id string) *DiskUpdate
- func (du *DiskUpdate) SetMountpoint(s string) *DiskUpdate
- func (du *DiskUpdate) SetNillableCreatedAt(t *time.Time) *DiskUpdate
- func (du *DiskUpdate) SetNillableUpdatedAt(t *time.Time) *DiskUpdate
- func (du *DiskUpdate) SetOpts(s []string) *DiskUpdate
- func (du *DiskUpdate) SetUpdatedAt(t time.Time) *DiskUpdate
- func (du *DiskUpdate) Where(ps ...predicate.Disk) *DiskUpdate
- type DiskUpdateOne
- func (duo *DiskUpdateOne) ClearHostID() *DiskUpdateOne
- func (duo *DiskUpdateOne) ClearOpts() *DiskUpdateOne
- func (duo *DiskUpdateOne) Exec(ctx context.Context) error
- func (duo *DiskUpdateOne) ExecX(ctx context.Context)
- func (duo *DiskUpdateOne) Mutation() *DiskMutation
- func (duo *DiskUpdateOne) Save(ctx context.Context) (*Disk, error)
- func (duo *DiskUpdateOne) SaveX(ctx context.Context) *Disk
- func (duo *DiskUpdateOne) Select(field string, fields ...string) *DiskUpdateOne
- func (duo *DiskUpdateOne) SetCreatedAt(t time.Time) *DiskUpdateOne
- func (duo *DiskUpdateOne) SetDevice(s string) *DiskUpdateOne
- func (duo *DiskUpdateOne) SetFstype(s string) *DiskUpdateOne
- func (duo *DiskUpdateOne) SetHostID(h *Host) *DiskUpdateOne
- func (duo *DiskUpdateOne) SetHostIDID(id string) *DiskUpdateOne
- func (duo *DiskUpdateOne) SetMountpoint(s string) *DiskUpdateOne
- func (duo *DiskUpdateOne) SetNillableCreatedAt(t *time.Time) *DiskUpdateOne
- func (duo *DiskUpdateOne) SetNillableUpdatedAt(t *time.Time) *DiskUpdateOne
- func (duo *DiskUpdateOne) SetOpts(s []string) *DiskUpdateOne
- func (duo *DiskUpdateOne) SetUpdatedAt(t time.Time) *DiskUpdateOne
- type Disks
- type Hook
- type Host
- type HostClient
- func (c *HostClient) Create() *HostCreate
- func (c *HostClient) CreateBulk(builders ...*HostCreate) *HostCreateBulk
- func (c *HostClient) Delete() *HostDelete
- func (c *HostClient) DeleteOne(h *Host) *HostDeleteOne
- func (c *HostClient) DeleteOneID(id string) *HostDeleteOne
- func (c *HostClient) Get(ctx context.Context, id string) (*Host, error)
- func (c *HostClient) GetX(ctx context.Context, id string) *Host
- func (c *HostClient) Hooks() []Hook
- func (c *HostClient) Query() *HostQuery
- func (c *HostClient) QueryCPU(h *Host) *CPUQuery
- func (c *HostClient) QueryDisk(h *Host) *DiskQuery
- func (c *HostClient) QueryNetstat(h *Host) *NetstatQuery
- func (c *HostClient) QueryNetwork(h *Host) *NetworkQuery
- func (c *HostClient) Update() *HostUpdate
- func (c *HostClient) UpdateOne(h *Host) *HostUpdateOne
- func (c *HostClient) UpdateOneID(id string) *HostUpdateOne
- func (c *HostClient) Use(hooks ...Hook)
- type HostCreate
- func (hc *HostCreate) AddCPU(c ...*Cpu) *HostCreate
- func (hc *HostCreate) AddCPUIDs(ids ...int) *HostCreate
- func (hc *HostCreate) AddDisk(d ...*Disk) *HostCreate
- func (hc *HostCreate) AddDiskIDs(ids ...int) *HostCreate
- func (hc *HostCreate) AddNetstat(n ...*Netstat) *HostCreate
- func (hc *HostCreate) AddNetstatIDs(ids ...int) *HostCreate
- func (hc *HostCreate) AddNetwork(n ...*Network) *HostCreate
- func (hc *HostCreate) AddNetworkIDs(ids ...int) *HostCreate
- func (hc *HostCreate) Exec(ctx context.Context) error
- func (hc *HostCreate) ExecX(ctx context.Context)
- func (hc *HostCreate) Mutation() *HostMutation
- func (hc *HostCreate) Save(ctx context.Context) (*Host, error)
- func (hc *HostCreate) SaveX(ctx context.Context) *Host
- func (hc *HostCreate) SetCreatedAt(t time.Time) *HostCreate
- func (hc *HostCreate) SetHostname(s string) *HostCreate
- func (hc *HostCreate) SetID(s string) *HostCreate
- func (hc *HostCreate) SetKernelArch(s string) *HostCreate
- func (hc *HostCreate) SetKernelVersion(s string) *HostCreate
- func (hc *HostCreate) SetNillableCreatedAt(t *time.Time) *HostCreate
- func (hc *HostCreate) SetNillableUpdatedAt(t *time.Time) *HostCreate
- func (hc *HostCreate) SetOs(s string) *HostCreate
- func (hc *HostCreate) SetPlatform(s string) *HostCreate
- func (hc *HostCreate) SetPlatformFamily(s string) *HostCreate
- func (hc *HostCreate) SetPlatformVersion(s string) *HostCreate
- func (hc *HostCreate) SetUpdatedAt(t time.Time) *HostCreate
- func (hc *HostCreate) SetVirtualizationRole(s string) *HostCreate
- func (hc *HostCreate) SetVirtualizationSystem(s string) *HostCreate
- type HostCreateBulk
- type HostDelete
- type HostDeleteOne
- type HostEdges
- type HostGroupBy
- func (hgb *HostGroupBy) Aggregate(fns ...AggregateFunc) *HostGroupBy
- func (hgb *HostGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (hgb *HostGroupBy) BoolX(ctx context.Context) bool
- func (hgb *HostGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (hgb *HostGroupBy) BoolsX(ctx context.Context) []bool
- func (hgb *HostGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (hgb *HostGroupBy) Float64X(ctx context.Context) float64
- func (hgb *HostGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (hgb *HostGroupBy) Float64sX(ctx context.Context) []float64
- func (hgb *HostGroupBy) Int(ctx context.Context) (_ int, err error)
- func (hgb *HostGroupBy) IntX(ctx context.Context) int
- func (hgb *HostGroupBy) Ints(ctx context.Context) ([]int, error)
- func (hgb *HostGroupBy) IntsX(ctx context.Context) []int
- func (hgb *HostGroupBy) Scan(ctx context.Context, v interface{}) error
- func (hgb *HostGroupBy) ScanX(ctx context.Context, v interface{})
- func (hgb *HostGroupBy) String(ctx context.Context) (_ string, err error)
- func (hgb *HostGroupBy) StringX(ctx context.Context) string
- func (hgb *HostGroupBy) Strings(ctx context.Context) ([]string, error)
- func (hgb *HostGroupBy) StringsX(ctx context.Context) []string
- type HostMutation
- func (m *HostMutation) AddCPUIDs(ids ...int)
- func (m *HostMutation) AddDiskIDs(ids ...int)
- func (m *HostMutation) AddField(name string, value ent.Value) error
- func (m *HostMutation) AddNetstatIDs(ids ...int)
- func (m *HostMutation) AddNetworkIDs(ids ...int)
- func (m *HostMutation) AddedEdges() []string
- func (m *HostMutation) AddedField(name string) (ent.Value, bool)
- func (m *HostMutation) AddedFields() []string
- func (m *HostMutation) AddedIDs(name string) []ent.Value
- func (m *HostMutation) CPUCleared() bool
- func (m *HostMutation) CPUIDs() (ids []int)
- func (m *HostMutation) ClearCPU()
- func (m *HostMutation) ClearDisk()
- func (m *HostMutation) ClearEdge(name string) error
- func (m *HostMutation) ClearField(name string) error
- func (m *HostMutation) ClearNetstat()
- func (m *HostMutation) ClearNetwork()
- func (m *HostMutation) ClearedEdges() []string
- func (m *HostMutation) ClearedFields() []string
- func (m HostMutation) Client() *Client
- func (m *HostMutation) CreatedAt() (r time.Time, exists bool)
- func (m *HostMutation) DiskCleared() bool
- func (m *HostMutation) DiskIDs() (ids []int)
- func (m *HostMutation) EdgeCleared(name string) bool
- func (m *HostMutation) Field(name string) (ent.Value, bool)
- func (m *HostMutation) FieldCleared(name string) bool
- func (m *HostMutation) Fields() []string
- func (m *HostMutation) Hostname() (r string, exists bool)
- func (m *HostMutation) ID() (id string, exists bool)
- func (m *HostMutation) IDs(ctx context.Context) ([]string, error)
- func (m *HostMutation) KernelArch() (r string, exists bool)
- func (m *HostMutation) KernelVersion() (r string, exists bool)
- func (m *HostMutation) NetstatCleared() bool
- func (m *HostMutation) NetstatIDs() (ids []int)
- func (m *HostMutation) NetworkCleared() bool
- func (m *HostMutation) NetworkIDs() (ids []int)
- func (m *HostMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *HostMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *HostMutation) OldHostname(ctx context.Context) (v string, err error)
- func (m *HostMutation) OldKernelArch(ctx context.Context) (v string, err error)
- func (m *HostMutation) OldKernelVersion(ctx context.Context) (v string, err error)
- func (m *HostMutation) OldOs(ctx context.Context) (v string, err error)
- func (m *HostMutation) OldPlatform(ctx context.Context) (v string, err error)
- func (m *HostMutation) OldPlatformFamily(ctx context.Context) (v string, err error)
- func (m *HostMutation) OldPlatformVersion(ctx context.Context) (v string, err error)
- func (m *HostMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *HostMutation) OldVirtualizationRole(ctx context.Context) (v string, err error)
- func (m *HostMutation) OldVirtualizationSystem(ctx context.Context) (v string, err error)
- func (m *HostMutation) Op() Op
- func (m *HostMutation) Os() (r string, exists bool)
- func (m *HostMutation) Platform() (r string, exists bool)
- func (m *HostMutation) PlatformFamily() (r string, exists bool)
- func (m *HostMutation) PlatformVersion() (r string, exists bool)
- func (m *HostMutation) RemoveCPUIDs(ids ...int)
- func (m *HostMutation) RemoveDiskIDs(ids ...int)
- func (m *HostMutation) RemoveNetstatIDs(ids ...int)
- func (m *HostMutation) RemoveNetworkIDs(ids ...int)
- func (m *HostMutation) RemovedCPUIDs() (ids []int)
- func (m *HostMutation) RemovedDiskIDs() (ids []int)
- func (m *HostMutation) RemovedEdges() []string
- func (m *HostMutation) RemovedIDs(name string) []ent.Value
- func (m *HostMutation) RemovedNetstatIDs() (ids []int)
- func (m *HostMutation) RemovedNetworkIDs() (ids []int)
- func (m *HostMutation) ResetCPU()
- func (m *HostMutation) ResetCreatedAt()
- func (m *HostMutation) ResetDisk()
- func (m *HostMutation) ResetEdge(name string) error
- func (m *HostMutation) ResetField(name string) error
- func (m *HostMutation) ResetHostname()
- func (m *HostMutation) ResetKernelArch()
- func (m *HostMutation) ResetKernelVersion()
- func (m *HostMutation) ResetNetstat()
- func (m *HostMutation) ResetNetwork()
- func (m *HostMutation) ResetOs()
- func (m *HostMutation) ResetPlatform()
- func (m *HostMutation) ResetPlatformFamily()
- func (m *HostMutation) ResetPlatformVersion()
- func (m *HostMutation) ResetUpdatedAt()
- func (m *HostMutation) ResetVirtualizationRole()
- func (m *HostMutation) ResetVirtualizationSystem()
- func (m *HostMutation) SetCreatedAt(t time.Time)
- func (m *HostMutation) SetField(name string, value ent.Value) error
- func (m *HostMutation) SetHostname(s string)
- func (m *HostMutation) SetID(id string)
- func (m *HostMutation) SetKernelArch(s string)
- func (m *HostMutation) SetKernelVersion(s string)
- func (m *HostMutation) SetOs(s string)
- func (m *HostMutation) SetPlatform(s string)
- func (m *HostMutation) SetPlatformFamily(s string)
- func (m *HostMutation) SetPlatformVersion(s string)
- func (m *HostMutation) SetUpdatedAt(t time.Time)
- func (m *HostMutation) SetVirtualizationRole(s string)
- func (m *HostMutation) SetVirtualizationSystem(s string)
- func (m HostMutation) Tx() (*Tx, error)
- func (m *HostMutation) Type() string
- func (m *HostMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *HostMutation) VirtualizationRole() (r string, exists bool)
- func (m *HostMutation) VirtualizationSystem() (r string, exists bool)
- func (m *HostMutation) Where(ps ...predicate.Host)
- type HostQuery
- func (hq *HostQuery) All(ctx context.Context) ([]*Host, error)
- func (hq *HostQuery) AllX(ctx context.Context) []*Host
- func (hq *HostQuery) Clone() *HostQuery
- func (hq *HostQuery) Count(ctx context.Context) (int, error)
- func (hq *HostQuery) CountX(ctx context.Context) int
- func (hq *HostQuery) Exist(ctx context.Context) (bool, error)
- func (hq *HostQuery) ExistX(ctx context.Context) bool
- func (hq *HostQuery) First(ctx context.Context) (*Host, error)
- func (hq *HostQuery) FirstID(ctx context.Context) (id string, err error)
- func (hq *HostQuery) FirstIDX(ctx context.Context) string
- func (hq *HostQuery) FirstX(ctx context.Context) *Host
- func (hq *HostQuery) GroupBy(field string, fields ...string) *HostGroupBy
- func (hq *HostQuery) IDs(ctx context.Context) ([]string, error)
- func (hq *HostQuery) IDsX(ctx context.Context) []string
- func (hq *HostQuery) Limit(limit int) *HostQuery
- func (hq *HostQuery) Offset(offset int) *HostQuery
- func (hq *HostQuery) Only(ctx context.Context) (*Host, error)
- func (hq *HostQuery) OnlyID(ctx context.Context) (id string, err error)
- func (hq *HostQuery) OnlyIDX(ctx context.Context) string
- func (hq *HostQuery) OnlyX(ctx context.Context) *Host
- func (hq *HostQuery) Order(o ...OrderFunc) *HostQuery
- func (hq *HostQuery) QueryCPU() *CPUQuery
- func (hq *HostQuery) QueryDisk() *DiskQuery
- func (hq *HostQuery) QueryNetstat() *NetstatQuery
- func (hq *HostQuery) QueryNetwork() *NetworkQuery
- func (hq *HostQuery) Select(fields ...string) *HostSelect
- func (hq *HostQuery) Unique(unique bool) *HostQuery
- func (hq *HostQuery) Where(ps ...predicate.Host) *HostQuery
- func (hq *HostQuery) WithCPU(opts ...func(*CPUQuery)) *HostQuery
- func (hq *HostQuery) WithDisk(opts ...func(*DiskQuery)) *HostQuery
- func (hq *HostQuery) WithNetstat(opts ...func(*NetstatQuery)) *HostQuery
- func (hq *HostQuery) WithNetwork(opts ...func(*NetworkQuery)) *HostQuery
- type HostSelect
- func (hs *HostSelect) Bool(ctx context.Context) (_ bool, err error)
- func (hs *HostSelect) BoolX(ctx context.Context) bool
- func (hs *HostSelect) Bools(ctx context.Context) ([]bool, error)
- func (hs *HostSelect) BoolsX(ctx context.Context) []bool
- func (hs *HostSelect) Float64(ctx context.Context) (_ float64, err error)
- func (hs *HostSelect) Float64X(ctx context.Context) float64
- func (hs *HostSelect) Float64s(ctx context.Context) ([]float64, error)
- func (hs *HostSelect) Float64sX(ctx context.Context) []float64
- func (hs *HostSelect) Int(ctx context.Context) (_ int, err error)
- func (hs *HostSelect) IntX(ctx context.Context) int
- func (hs *HostSelect) Ints(ctx context.Context) ([]int, error)
- func (hs *HostSelect) IntsX(ctx context.Context) []int
- func (hs *HostSelect) Scan(ctx context.Context, v interface{}) error
- func (hs *HostSelect) ScanX(ctx context.Context, v interface{})
- func (hs *HostSelect) String(ctx context.Context) (_ string, err error)
- func (hs *HostSelect) StringX(ctx context.Context) string
- func (hs *HostSelect) Strings(ctx context.Context) ([]string, error)
- func (hs *HostSelect) StringsX(ctx context.Context) []string
- type HostUpdate
- func (hu *HostUpdate) AddCPU(c ...*Cpu) *HostUpdate
- func (hu *HostUpdate) AddCPUIDs(ids ...int) *HostUpdate
- func (hu *HostUpdate) AddDisk(d ...*Disk) *HostUpdate
- func (hu *HostUpdate) AddDiskIDs(ids ...int) *HostUpdate
- func (hu *HostUpdate) AddNetstat(n ...*Netstat) *HostUpdate
- func (hu *HostUpdate) AddNetstatIDs(ids ...int) *HostUpdate
- func (hu *HostUpdate) AddNetwork(n ...*Network) *HostUpdate
- func (hu *HostUpdate) AddNetworkIDs(ids ...int) *HostUpdate
- func (hu *HostUpdate) ClearCPU() *HostUpdate
- func (hu *HostUpdate) ClearDisk() *HostUpdate
- func (hu *HostUpdate) ClearNetstat() *HostUpdate
- func (hu *HostUpdate) ClearNetwork() *HostUpdate
- func (hu *HostUpdate) Exec(ctx context.Context) error
- func (hu *HostUpdate) ExecX(ctx context.Context)
- func (hu *HostUpdate) Mutation() *HostMutation
- func (hu *HostUpdate) RemoveCPU(c ...*Cpu) *HostUpdate
- func (hu *HostUpdate) RemoveCPUIDs(ids ...int) *HostUpdate
- func (hu *HostUpdate) RemoveDisk(d ...*Disk) *HostUpdate
- func (hu *HostUpdate) RemoveDiskIDs(ids ...int) *HostUpdate
- func (hu *HostUpdate) RemoveNetstat(n ...*Netstat) *HostUpdate
- func (hu *HostUpdate) RemoveNetstatIDs(ids ...int) *HostUpdate
- func (hu *HostUpdate) RemoveNetwork(n ...*Network) *HostUpdate
- func (hu *HostUpdate) RemoveNetworkIDs(ids ...int) *HostUpdate
- func (hu *HostUpdate) Save(ctx context.Context) (int, error)
- func (hu *HostUpdate) SaveX(ctx context.Context) int
- func (hu *HostUpdate) SetCreatedAt(t time.Time) *HostUpdate
- func (hu *HostUpdate) SetHostname(s string) *HostUpdate
- func (hu *HostUpdate) SetKernelArch(s string) *HostUpdate
- func (hu *HostUpdate) SetKernelVersion(s string) *HostUpdate
- func (hu *HostUpdate) SetNillableCreatedAt(t *time.Time) *HostUpdate
- func (hu *HostUpdate) SetNillableUpdatedAt(t *time.Time) *HostUpdate
- func (hu *HostUpdate) SetOs(s string) *HostUpdate
- func (hu *HostUpdate) SetPlatform(s string) *HostUpdate
- func (hu *HostUpdate) SetPlatformFamily(s string) *HostUpdate
- func (hu *HostUpdate) SetPlatformVersion(s string) *HostUpdate
- func (hu *HostUpdate) SetUpdatedAt(t time.Time) *HostUpdate
- func (hu *HostUpdate) SetVirtualizationRole(s string) *HostUpdate
- func (hu *HostUpdate) SetVirtualizationSystem(s string) *HostUpdate
- func (hu *HostUpdate) Where(ps ...predicate.Host) *HostUpdate
- type HostUpdateOne
- func (huo *HostUpdateOne) AddCPU(c ...*Cpu) *HostUpdateOne
- func (huo *HostUpdateOne) AddCPUIDs(ids ...int) *HostUpdateOne
- func (huo *HostUpdateOne) AddDisk(d ...*Disk) *HostUpdateOne
- func (huo *HostUpdateOne) AddDiskIDs(ids ...int) *HostUpdateOne
- func (huo *HostUpdateOne) AddNetstat(n ...*Netstat) *HostUpdateOne
- func (huo *HostUpdateOne) AddNetstatIDs(ids ...int) *HostUpdateOne
- func (huo *HostUpdateOne) AddNetwork(n ...*Network) *HostUpdateOne
- func (huo *HostUpdateOne) AddNetworkIDs(ids ...int) *HostUpdateOne
- func (huo *HostUpdateOne) ClearCPU() *HostUpdateOne
- func (huo *HostUpdateOne) ClearDisk() *HostUpdateOne
- func (huo *HostUpdateOne) ClearNetstat() *HostUpdateOne
- func (huo *HostUpdateOne) ClearNetwork() *HostUpdateOne
- func (huo *HostUpdateOne) Exec(ctx context.Context) error
- func (huo *HostUpdateOne) ExecX(ctx context.Context)
- func (huo *HostUpdateOne) Mutation() *HostMutation
- func (huo *HostUpdateOne) RemoveCPU(c ...*Cpu) *HostUpdateOne
- func (huo *HostUpdateOne) RemoveCPUIDs(ids ...int) *HostUpdateOne
- func (huo *HostUpdateOne) RemoveDisk(d ...*Disk) *HostUpdateOne
- func (huo *HostUpdateOne) RemoveDiskIDs(ids ...int) *HostUpdateOne
- func (huo *HostUpdateOne) RemoveNetstat(n ...*Netstat) *HostUpdateOne
- func (huo *HostUpdateOne) RemoveNetstatIDs(ids ...int) *HostUpdateOne
- func (huo *HostUpdateOne) RemoveNetwork(n ...*Network) *HostUpdateOne
- func (huo *HostUpdateOne) RemoveNetworkIDs(ids ...int) *HostUpdateOne
- func (huo *HostUpdateOne) Save(ctx context.Context) (*Host, error)
- func (huo *HostUpdateOne) SaveX(ctx context.Context) *Host
- func (huo *HostUpdateOne) Select(field string, fields ...string) *HostUpdateOne
- func (huo *HostUpdateOne) SetCreatedAt(t time.Time) *HostUpdateOne
- func (huo *HostUpdateOne) SetHostname(s string) *HostUpdateOne
- func (huo *HostUpdateOne) SetKernelArch(s string) *HostUpdateOne
- func (huo *HostUpdateOne) SetKernelVersion(s string) *HostUpdateOne
- func (huo *HostUpdateOne) SetNillableCreatedAt(t *time.Time) *HostUpdateOne
- func (huo *HostUpdateOne) SetNillableUpdatedAt(t *time.Time) *HostUpdateOne
- func (huo *HostUpdateOne) SetOs(s string) *HostUpdateOne
- func (huo *HostUpdateOne) SetPlatform(s string) *HostUpdateOne
- func (huo *HostUpdateOne) SetPlatformFamily(s string) *HostUpdateOne
- func (huo *HostUpdateOne) SetPlatformVersion(s string) *HostUpdateOne
- func (huo *HostUpdateOne) SetUpdatedAt(t time.Time) *HostUpdateOne
- func (huo *HostUpdateOne) SetVirtualizationRole(s string) *HostUpdateOne
- func (huo *HostUpdateOne) SetVirtualizationSystem(s string) *HostUpdateOne
- type Hosts
- type MutateFunc
- type Mutation
- type Mutator
- type Netstat
- type NetstatClient
- func (c *NetstatClient) Create() *NetstatCreate
- func (c *NetstatClient) CreateBulk(builders ...*NetstatCreate) *NetstatCreateBulk
- func (c *NetstatClient) Delete() *NetstatDelete
- func (c *NetstatClient) DeleteOne(n *Netstat) *NetstatDeleteOne
- func (c *NetstatClient) DeleteOneID(id int) *NetstatDeleteOne
- func (c *NetstatClient) Get(ctx context.Context, id int) (*Netstat, error)
- func (c *NetstatClient) GetX(ctx context.Context, id int) *Netstat
- func (c *NetstatClient) Hooks() []Hook
- func (c *NetstatClient) Query() *NetstatQuery
- func (c *NetstatClient) QueryHostID(n *Netstat) *HostQuery
- func (c *NetstatClient) Update() *NetstatUpdate
- func (c *NetstatClient) UpdateOne(n *Netstat) *NetstatUpdateOne
- func (c *NetstatClient) UpdateOneID(id int) *NetstatUpdateOne
- func (c *NetstatClient) Use(hooks ...Hook)
- type NetstatCreate
- func (nc *NetstatCreate) Exec(ctx context.Context) error
- func (nc *NetstatCreate) ExecX(ctx context.Context)
- func (nc *NetstatCreate) Mutation() *NetstatMutation
- func (nc *NetstatCreate) Save(ctx context.Context) (*Netstat, error)
- func (nc *NetstatCreate) SaveX(ctx context.Context) *Netstat
- func (nc *NetstatCreate) SetAddr(s string) *NetstatCreate
- func (nc *NetstatCreate) SetCreatedAt(t time.Time) *NetstatCreate
- func (nc *NetstatCreate) SetHostID(h *Host) *NetstatCreate
- func (nc *NetstatCreate) SetHostIDID(id string) *NetstatCreate
- func (nc *NetstatCreate) SetNillableCreatedAt(t *time.Time) *NetstatCreate
- func (nc *NetstatCreate) SetNillableUpdatedAt(t *time.Time) *NetstatCreate
- func (nc *NetstatCreate) SetPort(u uint64) *NetstatCreate
- func (nc *NetstatCreate) SetProcess(s string) *NetstatCreate
- func (nc *NetstatCreate) SetProto(s string) *NetstatCreate
- func (nc *NetstatCreate) SetUpdatedAt(t time.Time) *NetstatCreate
- type NetstatCreateBulk
- type NetstatDelete
- type NetstatDeleteOne
- type NetstatEdges
- type NetstatGroupBy
- func (ngb *NetstatGroupBy) Aggregate(fns ...AggregateFunc) *NetstatGroupBy
- func (ngb *NetstatGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (ngb *NetstatGroupBy) BoolX(ctx context.Context) bool
- func (ngb *NetstatGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (ngb *NetstatGroupBy) BoolsX(ctx context.Context) []bool
- func (ngb *NetstatGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (ngb *NetstatGroupBy) Float64X(ctx context.Context) float64
- func (ngb *NetstatGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (ngb *NetstatGroupBy) Float64sX(ctx context.Context) []float64
- func (ngb *NetstatGroupBy) Int(ctx context.Context) (_ int, err error)
- func (ngb *NetstatGroupBy) IntX(ctx context.Context) int
- func (ngb *NetstatGroupBy) Ints(ctx context.Context) ([]int, error)
- func (ngb *NetstatGroupBy) IntsX(ctx context.Context) []int
- func (ngb *NetstatGroupBy) Scan(ctx context.Context, v interface{}) error
- func (ngb *NetstatGroupBy) ScanX(ctx context.Context, v interface{})
- func (ngb *NetstatGroupBy) String(ctx context.Context) (_ string, err error)
- func (ngb *NetstatGroupBy) StringX(ctx context.Context) string
- func (ngb *NetstatGroupBy) Strings(ctx context.Context) ([]string, error)
- func (ngb *NetstatGroupBy) StringsX(ctx context.Context) []string
- type NetstatMutation
- func (m *NetstatMutation) AddField(name string, value ent.Value) error
- func (m *NetstatMutation) AddPort(u int64)
- func (m *NetstatMutation) AddedEdges() []string
- func (m *NetstatMutation) AddedField(name string) (ent.Value, bool)
- func (m *NetstatMutation) AddedFields() []string
- func (m *NetstatMutation) AddedIDs(name string) []ent.Value
- func (m *NetstatMutation) AddedPort() (r int64, exists bool)
- func (m *NetstatMutation) Addr() (r string, exists bool)
- func (m *NetstatMutation) ClearEdge(name string) error
- func (m *NetstatMutation) ClearField(name string) error
- func (m *NetstatMutation) ClearHostID()
- func (m *NetstatMutation) ClearedEdges() []string
- func (m *NetstatMutation) ClearedFields() []string
- func (m NetstatMutation) Client() *Client
- func (m *NetstatMutation) CreatedAt() (r time.Time, exists bool)
- func (m *NetstatMutation) EdgeCleared(name string) bool
- func (m *NetstatMutation) Field(name string) (ent.Value, bool)
- func (m *NetstatMutation) FieldCleared(name string) bool
- func (m *NetstatMutation) Fields() []string
- func (m *NetstatMutation) HostIDCleared() bool
- func (m *NetstatMutation) HostIDID() (id string, exists bool)
- func (m *NetstatMutation) HostIDIDs() (ids []string)
- func (m *NetstatMutation) ID() (id int, exists bool)
- func (m *NetstatMutation) IDs(ctx context.Context) ([]int, error)
- func (m *NetstatMutation) OldAddr(ctx context.Context) (v string, err error)
- func (m *NetstatMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *NetstatMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *NetstatMutation) OldPort(ctx context.Context) (v uint64, err error)
- func (m *NetstatMutation) OldProcess(ctx context.Context) (v string, err error)
- func (m *NetstatMutation) OldProto(ctx context.Context) (v string, err error)
- func (m *NetstatMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *NetstatMutation) Op() Op
- func (m *NetstatMutation) Port() (r uint64, exists bool)
- func (m *NetstatMutation) Process() (r string, exists bool)
- func (m *NetstatMutation) Proto() (r string, exists bool)
- func (m *NetstatMutation) RemovedEdges() []string
- func (m *NetstatMutation) RemovedIDs(name string) []ent.Value
- func (m *NetstatMutation) ResetAddr()
- func (m *NetstatMutation) ResetCreatedAt()
- func (m *NetstatMutation) ResetEdge(name string) error
- func (m *NetstatMutation) ResetField(name string) error
- func (m *NetstatMutation) ResetHostID()
- func (m *NetstatMutation) ResetPort()
- func (m *NetstatMutation) ResetProcess()
- func (m *NetstatMutation) ResetProto()
- func (m *NetstatMutation) ResetUpdatedAt()
- func (m *NetstatMutation) SetAddr(s string)
- func (m *NetstatMutation) SetCreatedAt(t time.Time)
- func (m *NetstatMutation) SetField(name string, value ent.Value) error
- func (m *NetstatMutation) SetHostIDID(id string)
- func (m *NetstatMutation) SetPort(u uint64)
- func (m *NetstatMutation) SetProcess(s string)
- func (m *NetstatMutation) SetProto(s string)
- func (m *NetstatMutation) SetUpdatedAt(t time.Time)
- func (m NetstatMutation) Tx() (*Tx, error)
- func (m *NetstatMutation) Type() string
- func (m *NetstatMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *NetstatMutation) Where(ps ...predicate.Netstat)
- type NetstatQuery
- func (nq *NetstatQuery) All(ctx context.Context) ([]*Netstat, error)
- func (nq *NetstatQuery) AllX(ctx context.Context) []*Netstat
- func (nq *NetstatQuery) Clone() *NetstatQuery
- func (nq *NetstatQuery) Count(ctx context.Context) (int, error)
- func (nq *NetstatQuery) CountX(ctx context.Context) int
- func (nq *NetstatQuery) Exist(ctx context.Context) (bool, error)
- func (nq *NetstatQuery) ExistX(ctx context.Context) bool
- func (nq *NetstatQuery) First(ctx context.Context) (*Netstat, error)
- func (nq *NetstatQuery) FirstID(ctx context.Context) (id int, err error)
- func (nq *NetstatQuery) FirstIDX(ctx context.Context) int
- func (nq *NetstatQuery) FirstX(ctx context.Context) *Netstat
- func (nq *NetstatQuery) GroupBy(field string, fields ...string) *NetstatGroupBy
- func (nq *NetstatQuery) IDs(ctx context.Context) ([]int, error)
- func (nq *NetstatQuery) IDsX(ctx context.Context) []int
- func (nq *NetstatQuery) Limit(limit int) *NetstatQuery
- func (nq *NetstatQuery) Offset(offset int) *NetstatQuery
- func (nq *NetstatQuery) Only(ctx context.Context) (*Netstat, error)
- func (nq *NetstatQuery) OnlyID(ctx context.Context) (id int, err error)
- func (nq *NetstatQuery) OnlyIDX(ctx context.Context) int
- func (nq *NetstatQuery) OnlyX(ctx context.Context) *Netstat
- func (nq *NetstatQuery) Order(o ...OrderFunc) *NetstatQuery
- func (nq *NetstatQuery) QueryHostID() *HostQuery
- func (nq *NetstatQuery) Select(fields ...string) *NetstatSelect
- func (nq *NetstatQuery) Unique(unique bool) *NetstatQuery
- func (nq *NetstatQuery) Where(ps ...predicate.Netstat) *NetstatQuery
- func (nq *NetstatQuery) WithHostID(opts ...func(*HostQuery)) *NetstatQuery
- type NetstatSelect
- func (ns *NetstatSelect) Bool(ctx context.Context) (_ bool, err error)
- func (ns *NetstatSelect) BoolX(ctx context.Context) bool
- func (ns *NetstatSelect) Bools(ctx context.Context) ([]bool, error)
- func (ns *NetstatSelect) BoolsX(ctx context.Context) []bool
- func (ns *NetstatSelect) Float64(ctx context.Context) (_ float64, err error)
- func (ns *NetstatSelect) Float64X(ctx context.Context) float64
- func (ns *NetstatSelect) Float64s(ctx context.Context) ([]float64, error)
- func (ns *NetstatSelect) Float64sX(ctx context.Context) []float64
- func (ns *NetstatSelect) Int(ctx context.Context) (_ int, err error)
- func (ns *NetstatSelect) IntX(ctx context.Context) int
- func (ns *NetstatSelect) Ints(ctx context.Context) ([]int, error)
- func (ns *NetstatSelect) IntsX(ctx context.Context) []int
- func (ns *NetstatSelect) Scan(ctx context.Context, v interface{}) error
- func (ns *NetstatSelect) ScanX(ctx context.Context, v interface{})
- func (ns *NetstatSelect) String(ctx context.Context) (_ string, err error)
- func (ns *NetstatSelect) StringX(ctx context.Context) string
- func (ns *NetstatSelect) Strings(ctx context.Context) ([]string, error)
- func (ns *NetstatSelect) StringsX(ctx context.Context) []string
- type NetstatUpdate
- func (nu *NetstatUpdate) AddPort(u int64) *NetstatUpdate
- func (nu *NetstatUpdate) ClearHostID() *NetstatUpdate
- func (nu *NetstatUpdate) Exec(ctx context.Context) error
- func (nu *NetstatUpdate) ExecX(ctx context.Context)
- func (nu *NetstatUpdate) Mutation() *NetstatMutation
- func (nu *NetstatUpdate) Save(ctx context.Context) (int, error)
- func (nu *NetstatUpdate) SaveX(ctx context.Context) int
- func (nu *NetstatUpdate) SetAddr(s string) *NetstatUpdate
- func (nu *NetstatUpdate) SetCreatedAt(t time.Time) *NetstatUpdate
- func (nu *NetstatUpdate) SetHostID(h *Host) *NetstatUpdate
- func (nu *NetstatUpdate) SetHostIDID(id string) *NetstatUpdate
- func (nu *NetstatUpdate) SetNillableCreatedAt(t *time.Time) *NetstatUpdate
- func (nu *NetstatUpdate) SetNillableUpdatedAt(t *time.Time) *NetstatUpdate
- func (nu *NetstatUpdate) SetPort(u uint64) *NetstatUpdate
- func (nu *NetstatUpdate) SetProcess(s string) *NetstatUpdate
- func (nu *NetstatUpdate) SetProto(s string) *NetstatUpdate
- func (nu *NetstatUpdate) SetUpdatedAt(t time.Time) *NetstatUpdate
- func (nu *NetstatUpdate) Where(ps ...predicate.Netstat) *NetstatUpdate
- type NetstatUpdateOne
- func (nuo *NetstatUpdateOne) AddPort(u int64) *NetstatUpdateOne
- func (nuo *NetstatUpdateOne) ClearHostID() *NetstatUpdateOne
- func (nuo *NetstatUpdateOne) Exec(ctx context.Context) error
- func (nuo *NetstatUpdateOne) ExecX(ctx context.Context)
- func (nuo *NetstatUpdateOne) Mutation() *NetstatMutation
- func (nuo *NetstatUpdateOne) Save(ctx context.Context) (*Netstat, error)
- func (nuo *NetstatUpdateOne) SaveX(ctx context.Context) *Netstat
- func (nuo *NetstatUpdateOne) Select(field string, fields ...string) *NetstatUpdateOne
- func (nuo *NetstatUpdateOne) SetAddr(s string) *NetstatUpdateOne
- func (nuo *NetstatUpdateOne) SetCreatedAt(t time.Time) *NetstatUpdateOne
- func (nuo *NetstatUpdateOne) SetHostID(h *Host) *NetstatUpdateOne
- func (nuo *NetstatUpdateOne) SetHostIDID(id string) *NetstatUpdateOne
- func (nuo *NetstatUpdateOne) SetNillableCreatedAt(t *time.Time) *NetstatUpdateOne
- func (nuo *NetstatUpdateOne) SetNillableUpdatedAt(t *time.Time) *NetstatUpdateOne
- func (nuo *NetstatUpdateOne) SetPort(u uint64) *NetstatUpdateOne
- func (nuo *NetstatUpdateOne) SetProcess(s string) *NetstatUpdateOne
- func (nuo *NetstatUpdateOne) SetProto(s string) *NetstatUpdateOne
- func (nuo *NetstatUpdateOne) SetUpdatedAt(t time.Time) *NetstatUpdateOne
- type Netstats
- type Network
- type NetworkClient
- func (c *NetworkClient) Create() *NetworkCreate
- func (c *NetworkClient) CreateBulk(builders ...*NetworkCreate) *NetworkCreateBulk
- func (c *NetworkClient) Delete() *NetworkDelete
- func (c *NetworkClient) DeleteOne(n *Network) *NetworkDeleteOne
- func (c *NetworkClient) DeleteOneID(id int) *NetworkDeleteOne
- func (c *NetworkClient) Get(ctx context.Context, id int) (*Network, error)
- func (c *NetworkClient) GetX(ctx context.Context, id int) *Network
- func (c *NetworkClient) Hooks() []Hook
- func (c *NetworkClient) Query() *NetworkQuery
- func (c *NetworkClient) QueryHostID(n *Network) *HostQuery
- func (c *NetworkClient) Update() *NetworkUpdate
- func (c *NetworkClient) UpdateOne(n *Network) *NetworkUpdateOne
- func (c *NetworkClient) UpdateOneID(id int) *NetworkUpdateOne
- func (c *NetworkClient) Use(hooks ...Hook)
- type NetworkCreate
- func (nc *NetworkCreate) Exec(ctx context.Context) error
- func (nc *NetworkCreate) ExecX(ctx context.Context)
- func (nc *NetworkCreate) Mutation() *NetworkMutation
- func (nc *NetworkCreate) Save(ctx context.Context) (*Network, error)
- func (nc *NetworkCreate) SaveX(ctx context.Context) *Network
- func (nc *NetworkCreate) SetAddrs(s []string) *NetworkCreate
- func (nc *NetworkCreate) SetCreatedAt(t time.Time) *NetworkCreate
- func (nc *NetworkCreate) SetFlags(s []string) *NetworkCreate
- func (nc *NetworkCreate) SetHardwareAddr(s string) *NetworkCreate
- func (nc *NetworkCreate) SetHostID(h *Host) *NetworkCreate
- func (nc *NetworkCreate) SetHostIDID(id string) *NetworkCreate
- func (nc *NetworkCreate) SetIndex(i int) *NetworkCreate
- func (nc *NetworkCreate) SetMTU(i int) *NetworkCreate
- func (nc *NetworkCreate) SetName(s string) *NetworkCreate
- func (nc *NetworkCreate) SetNillableCreatedAt(t *time.Time) *NetworkCreate
- func (nc *NetworkCreate) SetNillableUpdatedAt(t *time.Time) *NetworkCreate
- func (nc *NetworkCreate) SetUpdatedAt(t time.Time) *NetworkCreate
- type NetworkCreateBulk
- type NetworkDelete
- type NetworkDeleteOne
- type NetworkEdges
- type NetworkGroupBy
- func (ngb *NetworkGroupBy) Aggregate(fns ...AggregateFunc) *NetworkGroupBy
- func (ngb *NetworkGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (ngb *NetworkGroupBy) BoolX(ctx context.Context) bool
- func (ngb *NetworkGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (ngb *NetworkGroupBy) BoolsX(ctx context.Context) []bool
- func (ngb *NetworkGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (ngb *NetworkGroupBy) Float64X(ctx context.Context) float64
- func (ngb *NetworkGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (ngb *NetworkGroupBy) Float64sX(ctx context.Context) []float64
- func (ngb *NetworkGroupBy) Int(ctx context.Context) (_ int, err error)
- func (ngb *NetworkGroupBy) IntX(ctx context.Context) int
- func (ngb *NetworkGroupBy) Ints(ctx context.Context) ([]int, error)
- func (ngb *NetworkGroupBy) IntsX(ctx context.Context) []int
- func (ngb *NetworkGroupBy) Scan(ctx context.Context, v interface{}) error
- func (ngb *NetworkGroupBy) ScanX(ctx context.Context, v interface{})
- func (ngb *NetworkGroupBy) String(ctx context.Context) (_ string, err error)
- func (ngb *NetworkGroupBy) StringX(ctx context.Context) string
- func (ngb *NetworkGroupBy) Strings(ctx context.Context) ([]string, error)
- func (ngb *NetworkGroupBy) StringsX(ctx context.Context) []string
- type NetworkMutation
- func (m *NetworkMutation) AddField(name string, value ent.Value) error
- func (m *NetworkMutation) AddIndex(i int)
- func (m *NetworkMutation) AddMTU(i int)
- func (m *NetworkMutation) AddedEdges() []string
- func (m *NetworkMutation) AddedField(name string) (ent.Value, bool)
- func (m *NetworkMutation) AddedFields() []string
- func (m *NetworkMutation) AddedIDs(name string) []ent.Value
- func (m *NetworkMutation) AddedIndex() (r int, exists bool)
- func (m *NetworkMutation) AddedMTU() (r int, exists bool)
- func (m *NetworkMutation) Addrs() (r []string, exists bool)
- func (m *NetworkMutation) AddrsCleared() bool
- func (m *NetworkMutation) ClearAddrs()
- func (m *NetworkMutation) ClearEdge(name string) error
- func (m *NetworkMutation) ClearField(name string) error
- func (m *NetworkMutation) ClearFlags()
- func (m *NetworkMutation) ClearHostID()
- func (m *NetworkMutation) ClearedEdges() []string
- func (m *NetworkMutation) ClearedFields() []string
- func (m NetworkMutation) Client() *Client
- func (m *NetworkMutation) CreatedAt() (r time.Time, exists bool)
- func (m *NetworkMutation) EdgeCleared(name string) bool
- func (m *NetworkMutation) Field(name string) (ent.Value, bool)
- func (m *NetworkMutation) FieldCleared(name string) bool
- func (m *NetworkMutation) Fields() []string
- func (m *NetworkMutation) Flags() (r []string, exists bool)
- func (m *NetworkMutation) FlagsCleared() bool
- func (m *NetworkMutation) HardwareAddr() (r string, exists bool)
- func (m *NetworkMutation) HostIDCleared() bool
- func (m *NetworkMutation) HostIDID() (id string, exists bool)
- func (m *NetworkMutation) HostIDIDs() (ids []string)
- func (m *NetworkMutation) ID() (id int, exists bool)
- func (m *NetworkMutation) IDs(ctx context.Context) ([]int, error)
- func (m *NetworkMutation) Index() (r int, exists bool)
- func (m *NetworkMutation) MTU() (r int, exists bool)
- func (m *NetworkMutation) Name() (r string, exists bool)
- func (m *NetworkMutation) OldAddrs(ctx context.Context) (v []string, err error)
- func (m *NetworkMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *NetworkMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *NetworkMutation) OldFlags(ctx context.Context) (v []string, err error)
- func (m *NetworkMutation) OldHardwareAddr(ctx context.Context) (v string, err error)
- func (m *NetworkMutation) OldIndex(ctx context.Context) (v int, err error)
- func (m *NetworkMutation) OldMTU(ctx context.Context) (v int, err error)
- func (m *NetworkMutation) OldName(ctx context.Context) (v string, err error)
- func (m *NetworkMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *NetworkMutation) Op() Op
- func (m *NetworkMutation) RemovedEdges() []string
- func (m *NetworkMutation) RemovedIDs(name string) []ent.Value
- func (m *NetworkMutation) ResetAddrs()
- func (m *NetworkMutation) ResetCreatedAt()
- func (m *NetworkMutation) ResetEdge(name string) error
- func (m *NetworkMutation) ResetField(name string) error
- func (m *NetworkMutation) ResetFlags()
- func (m *NetworkMutation) ResetHardwareAddr()
- func (m *NetworkMutation) ResetHostID()
- func (m *NetworkMutation) ResetIndex()
- func (m *NetworkMutation) ResetMTU()
- func (m *NetworkMutation) ResetName()
- func (m *NetworkMutation) ResetUpdatedAt()
- func (m *NetworkMutation) SetAddrs(s []string)
- func (m *NetworkMutation) SetCreatedAt(t time.Time)
- func (m *NetworkMutation) SetField(name string, value ent.Value) error
- func (m *NetworkMutation) SetFlags(s []string)
- func (m *NetworkMutation) SetHardwareAddr(s string)
- func (m *NetworkMutation) SetHostIDID(id string)
- func (m *NetworkMutation) SetIndex(i int)
- func (m *NetworkMutation) SetMTU(i int)
- func (m *NetworkMutation) SetName(s string)
- func (m *NetworkMutation) SetUpdatedAt(t time.Time)
- func (m NetworkMutation) Tx() (*Tx, error)
- func (m *NetworkMutation) Type() string
- func (m *NetworkMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *NetworkMutation) Where(ps ...predicate.Network)
- type NetworkQuery
- func (nq *NetworkQuery) All(ctx context.Context) ([]*Network, error)
- func (nq *NetworkQuery) AllX(ctx context.Context) []*Network
- func (nq *NetworkQuery) Clone() *NetworkQuery
- func (nq *NetworkQuery) Count(ctx context.Context) (int, error)
- func (nq *NetworkQuery) CountX(ctx context.Context) int
- func (nq *NetworkQuery) Exist(ctx context.Context) (bool, error)
- func (nq *NetworkQuery) ExistX(ctx context.Context) bool
- func (nq *NetworkQuery) First(ctx context.Context) (*Network, error)
- func (nq *NetworkQuery) FirstID(ctx context.Context) (id int, err error)
- func (nq *NetworkQuery) FirstIDX(ctx context.Context) int
- func (nq *NetworkQuery) FirstX(ctx context.Context) *Network
- func (nq *NetworkQuery) GroupBy(field string, fields ...string) *NetworkGroupBy
- func (nq *NetworkQuery) IDs(ctx context.Context) ([]int, error)
- func (nq *NetworkQuery) IDsX(ctx context.Context) []int
- func (nq *NetworkQuery) Limit(limit int) *NetworkQuery
- func (nq *NetworkQuery) Offset(offset int) *NetworkQuery
- func (nq *NetworkQuery) Only(ctx context.Context) (*Network, error)
- func (nq *NetworkQuery) OnlyID(ctx context.Context) (id int, err error)
- func (nq *NetworkQuery) OnlyIDX(ctx context.Context) int
- func (nq *NetworkQuery) OnlyX(ctx context.Context) *Network
- func (nq *NetworkQuery) Order(o ...OrderFunc) *NetworkQuery
- func (nq *NetworkQuery) QueryHostID() *HostQuery
- func (nq *NetworkQuery) Select(fields ...string) *NetworkSelect
- func (nq *NetworkQuery) Unique(unique bool) *NetworkQuery
- func (nq *NetworkQuery) Where(ps ...predicate.Network) *NetworkQuery
- func (nq *NetworkQuery) WithHostID(opts ...func(*HostQuery)) *NetworkQuery
- type NetworkSelect
- func (ns *NetworkSelect) Bool(ctx context.Context) (_ bool, err error)
- func (ns *NetworkSelect) BoolX(ctx context.Context) bool
- func (ns *NetworkSelect) Bools(ctx context.Context) ([]bool, error)
- func (ns *NetworkSelect) BoolsX(ctx context.Context) []bool
- func (ns *NetworkSelect) Float64(ctx context.Context) (_ float64, err error)
- func (ns *NetworkSelect) Float64X(ctx context.Context) float64
- func (ns *NetworkSelect) Float64s(ctx context.Context) ([]float64, error)
- func (ns *NetworkSelect) Float64sX(ctx context.Context) []float64
- func (ns *NetworkSelect) Int(ctx context.Context) (_ int, err error)
- func (ns *NetworkSelect) IntX(ctx context.Context) int
- func (ns *NetworkSelect) Ints(ctx context.Context) ([]int, error)
- func (ns *NetworkSelect) IntsX(ctx context.Context) []int
- func (ns *NetworkSelect) Scan(ctx context.Context, v interface{}) error
- func (ns *NetworkSelect) ScanX(ctx context.Context, v interface{})
- func (ns *NetworkSelect) String(ctx context.Context) (_ string, err error)
- func (ns *NetworkSelect) StringX(ctx context.Context) string
- func (ns *NetworkSelect) Strings(ctx context.Context) ([]string, error)
- func (ns *NetworkSelect) StringsX(ctx context.Context) []string
- type NetworkUpdate
- func (nu *NetworkUpdate) AddIndex(i int) *NetworkUpdate
- func (nu *NetworkUpdate) AddMTU(i int) *NetworkUpdate
- func (nu *NetworkUpdate) ClearAddrs() *NetworkUpdate
- func (nu *NetworkUpdate) ClearFlags() *NetworkUpdate
- func (nu *NetworkUpdate) ClearHostID() *NetworkUpdate
- func (nu *NetworkUpdate) Exec(ctx context.Context) error
- func (nu *NetworkUpdate) ExecX(ctx context.Context)
- func (nu *NetworkUpdate) Mutation() *NetworkMutation
- func (nu *NetworkUpdate) Save(ctx context.Context) (int, error)
- func (nu *NetworkUpdate) SaveX(ctx context.Context) int
- func (nu *NetworkUpdate) SetAddrs(s []string) *NetworkUpdate
- func (nu *NetworkUpdate) SetCreatedAt(t time.Time) *NetworkUpdate
- func (nu *NetworkUpdate) SetFlags(s []string) *NetworkUpdate
- func (nu *NetworkUpdate) SetHardwareAddr(s string) *NetworkUpdate
- func (nu *NetworkUpdate) SetHostID(h *Host) *NetworkUpdate
- func (nu *NetworkUpdate) SetHostIDID(id string) *NetworkUpdate
- func (nu *NetworkUpdate) SetIndex(i int) *NetworkUpdate
- func (nu *NetworkUpdate) SetMTU(i int) *NetworkUpdate
- func (nu *NetworkUpdate) SetName(s string) *NetworkUpdate
- func (nu *NetworkUpdate) SetNillableCreatedAt(t *time.Time) *NetworkUpdate
- func (nu *NetworkUpdate) SetNillableUpdatedAt(t *time.Time) *NetworkUpdate
- func (nu *NetworkUpdate) SetUpdatedAt(t time.Time) *NetworkUpdate
- func (nu *NetworkUpdate) Where(ps ...predicate.Network) *NetworkUpdate
- type NetworkUpdateOne
- func (nuo *NetworkUpdateOne) AddIndex(i int) *NetworkUpdateOne
- func (nuo *NetworkUpdateOne) AddMTU(i int) *NetworkUpdateOne
- func (nuo *NetworkUpdateOne) ClearAddrs() *NetworkUpdateOne
- func (nuo *NetworkUpdateOne) ClearFlags() *NetworkUpdateOne
- func (nuo *NetworkUpdateOne) ClearHostID() *NetworkUpdateOne
- func (nuo *NetworkUpdateOne) Exec(ctx context.Context) error
- func (nuo *NetworkUpdateOne) ExecX(ctx context.Context)
- func (nuo *NetworkUpdateOne) Mutation() *NetworkMutation
- func (nuo *NetworkUpdateOne) Save(ctx context.Context) (*Network, error)
- func (nuo *NetworkUpdateOne) SaveX(ctx context.Context) *Network
- func (nuo *NetworkUpdateOne) Select(field string, fields ...string) *NetworkUpdateOne
- func (nuo *NetworkUpdateOne) SetAddrs(s []string) *NetworkUpdateOne
- func (nuo *NetworkUpdateOne) SetCreatedAt(t time.Time) *NetworkUpdateOne
- func (nuo *NetworkUpdateOne) SetFlags(s []string) *NetworkUpdateOne
- func (nuo *NetworkUpdateOne) SetHardwareAddr(s string) *NetworkUpdateOne
- func (nuo *NetworkUpdateOne) SetHostID(h *Host) *NetworkUpdateOne
- func (nuo *NetworkUpdateOne) SetHostIDID(id string) *NetworkUpdateOne
- func (nuo *NetworkUpdateOne) SetIndex(i int) *NetworkUpdateOne
- func (nuo *NetworkUpdateOne) SetMTU(i int) *NetworkUpdateOne
- func (nuo *NetworkUpdateOne) SetName(s string) *NetworkUpdateOne
- func (nuo *NetworkUpdateOne) SetNillableCreatedAt(t *time.Time) *NetworkUpdateOne
- func (nuo *NetworkUpdateOne) SetNillableUpdatedAt(t *time.Time) *NetworkUpdateOne
- func (nuo *NetworkUpdateOne) SetUpdatedAt(t time.Time) *NetworkUpdateOne
- type Networks
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Query
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Tx
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeCpu = "Cpu" TypeDisk = "Disk" TypeHost = "Host" TypeNetstat = "Netstat" TypeNetwork = "Network" )
Variables ¶
This section is empty.
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 CPUCreate ¶
type CPUCreate struct {
// contains filtered or unexported fields
}
CPUCreate is the builder for creating a Cpu entity.
func (*CPUCreate) Mutation ¶
func (cc *CPUCreate) Mutation() *CPUMutation
Mutation returns the CPUMutation object of the builder.
func (*CPUCreate) SetCreatedAt ¶
SetCreatedAt sets the "created_at" field.
func (*CPUCreate) SetHostIDID ¶
SetHostIDID sets the "host_id" edge to the Host entity by ID.
func (*CPUCreate) SetModelName ¶
SetModelName sets the "model_name" field.
func (*CPUCreate) SetNillableCreatedAt ¶
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*CPUCreate) SetNillableHostIDID ¶
SetNillableHostIDID sets the "host_id" edge to the Host entity by ID if the given value is not nil.
func (*CPUCreate) SetNillableUpdatedAt ¶
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*CPUCreate) SetUpdatedAt ¶
SetUpdatedAt sets the "updated_at" field.
func (*CPUCreate) SetVendorID ¶
SetVendorID sets the "vendor_id" field.
type CPUCreateBulk ¶
type CPUCreateBulk struct {
// contains filtered or unexported fields
}
CPUCreateBulk is the builder for creating many Cpu entities in bulk.
func (*CPUCreateBulk) Exec ¶
func (ccb *CPUCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CPUCreateBulk) ExecX ¶
func (ccb *CPUCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type CPUDelete ¶
type CPUDelete struct {
// contains filtered or unexported fields
}
CPUDelete is the builder for deleting a Cpu entity.
func (*CPUDelete) Exec ¶
Exec executes the deletion query and returns how many vertices were deleted.
type CPUDeleteOne ¶
type CPUDeleteOne struct {
// contains filtered or unexported fields
}
CPUDeleteOne is the builder for deleting a single Cpu entity.
func (*CPUDeleteOne) Exec ¶
func (cdo *CPUDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CPUDeleteOne) ExecX ¶
func (cdo *CPUDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type CPUGroupBy ¶
type CPUGroupBy struct {
// contains filtered or unexported fields
}
CPUGroupBy is the group-by builder for Cpu entities.
func (*CPUGroupBy) Aggregate ¶
func (cgb *CPUGroupBy) Aggregate(fns ...AggregateFunc) *CPUGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CPUGroupBy) Bool ¶
func (cgb *CPUGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*CPUGroupBy) BoolX ¶
func (cgb *CPUGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*CPUGroupBy) Bools ¶
func (cgb *CPUGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*CPUGroupBy) BoolsX ¶
func (cgb *CPUGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*CPUGroupBy) Float64 ¶
func (cgb *CPUGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*CPUGroupBy) Float64X ¶
func (cgb *CPUGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*CPUGroupBy) Float64s ¶
func (cgb *CPUGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*CPUGroupBy) Float64sX ¶
func (cgb *CPUGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*CPUGroupBy) Int ¶
func (cgb *CPUGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*CPUGroupBy) IntX ¶
func (cgb *CPUGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*CPUGroupBy) Ints ¶
func (cgb *CPUGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*CPUGroupBy) IntsX ¶
func (cgb *CPUGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*CPUGroupBy) Scan ¶
func (cgb *CPUGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*CPUGroupBy) ScanX ¶
func (cgb *CPUGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*CPUGroupBy) String ¶
func (cgb *CPUGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*CPUGroupBy) StringX ¶
func (cgb *CPUGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type CPUMutation ¶
type CPUMutation struct {
// contains filtered or unexported fields
}
CPUMutation represents an operation that mutates the Cpu nodes in the graph.
func (*CPUMutation) AddField ¶
func (m *CPUMutation) 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 (*CPUMutation) AddedCPU ¶
func (m *CPUMutation) AddedCPU() (r int, exists bool)
AddedCPU returns the value that was added to the "CPU" field in this mutation.
func (*CPUMutation) AddedEdges ¶
func (m *CPUMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CPUMutation) AddedField ¶
func (m *CPUMutation) 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 (*CPUMutation) AddedFields ¶
func (m *CPUMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CPUMutation) AddedIDs ¶
func (m *CPUMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CPUMutation) CPU ¶
func (m *CPUMutation) CPU() (r int, exists bool)
CPU returns the value of the "CPU" field in the mutation.
func (*CPUMutation) ClearEdge ¶
func (m *CPUMutation) 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 (*CPUMutation) ClearField ¶
func (m *CPUMutation) 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 (*CPUMutation) ClearHostID ¶
func (m *CPUMutation) ClearHostID()
ClearHostID clears the "host_id" edge to the Host entity.
func (*CPUMutation) ClearedEdges ¶
func (m *CPUMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CPUMutation) ClearedFields ¶
func (m *CPUMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CPUMutation) Client ¶
func (m CPUMutation) 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 (*CPUMutation) CreatedAt ¶
func (m *CPUMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*CPUMutation) EdgeCleared ¶
func (m *CPUMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CPUMutation) Family ¶
func (m *CPUMutation) Family() (r string, exists bool)
Family returns the value of the "family" field in the mutation.
func (*CPUMutation) Field ¶
func (m *CPUMutation) 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 (*CPUMutation) FieldCleared ¶
func (m *CPUMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CPUMutation) Fields ¶
func (m *CPUMutation) 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 (*CPUMutation) HostIDCleared ¶
func (m *CPUMutation) HostIDCleared() bool
HostIDCleared reports if the "host_id" edge to the Host entity was cleared.
func (*CPUMutation) HostIDID ¶
func (m *CPUMutation) HostIDID() (id string, exists bool)
HostIDID returns the "host_id" edge ID in the mutation.
func (*CPUMutation) HostIDIDs ¶
func (m *CPUMutation) HostIDIDs() (ids []string)
HostIDIDs returns the "host_id" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use HostIDID instead. It exists only for internal usage by the builders.
func (*CPUMutation) ID ¶
func (m *CPUMutation) 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 (*CPUMutation) IDs ¶
func (m *CPUMutation) 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 (*CPUMutation) Model ¶
func (m *CPUMutation) Model() (r string, exists bool)
Model returns the value of the "model" field in the mutation.
func (*CPUMutation) ModelName ¶
func (m *CPUMutation) ModelName() (r string, exists bool)
ModelName returns the value of the "model_name" field in the mutation.
func (*CPUMutation) OldCPU ¶
func (m *CPUMutation) OldCPU(ctx context.Context) (v int, err error)
OldCPU returns the old "CPU" field's value of the Cpu entity. If the Cpu 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 (*CPUMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Cpu entity. If the Cpu 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 (*CPUMutation) OldFamily ¶
func (m *CPUMutation) OldFamily(ctx context.Context) (v string, err error)
OldFamily returns the old "family" field's value of the Cpu entity. If the Cpu 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 (*CPUMutation) 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 (*CPUMutation) OldModel ¶
func (m *CPUMutation) OldModel(ctx context.Context) (v string, err error)
OldModel returns the old "model" field's value of the Cpu entity. If the Cpu 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 (*CPUMutation) OldModelName ¶
func (m *CPUMutation) OldModelName(ctx context.Context) (v string, err error)
OldModelName returns the old "model_name" field's value of the Cpu entity. If the Cpu 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 (*CPUMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Cpu entity. If the Cpu 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 (*CPUMutation) OldVendorID ¶
func (m *CPUMutation) OldVendorID(ctx context.Context) (v string, err error)
OldVendorID returns the old "vendor_id" field's value of the Cpu entity. If the Cpu 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 (*CPUMutation) RemovedEdges ¶
func (m *CPUMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CPUMutation) RemovedIDs ¶
func (m *CPUMutation) 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 (*CPUMutation) ResetCPU ¶
func (m *CPUMutation) ResetCPU()
ResetCPU resets all changes to the "CPU" field.
func (*CPUMutation) ResetCreatedAt ¶
func (m *CPUMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*CPUMutation) ResetEdge ¶
func (m *CPUMutation) 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 (*CPUMutation) ResetFamily ¶
func (m *CPUMutation) ResetFamily()
ResetFamily resets all changes to the "family" field.
func (*CPUMutation) ResetField ¶
func (m *CPUMutation) 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 (*CPUMutation) ResetHostID ¶
func (m *CPUMutation) ResetHostID()
ResetHostID resets all changes to the "host_id" edge.
func (*CPUMutation) ResetModel ¶
func (m *CPUMutation) ResetModel()
ResetModel resets all changes to the "model" field.
func (*CPUMutation) ResetModelName ¶
func (m *CPUMutation) ResetModelName()
ResetModelName resets all changes to the "model_name" field.
func (*CPUMutation) ResetUpdatedAt ¶
func (m *CPUMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*CPUMutation) ResetVendorID ¶
func (m *CPUMutation) ResetVendorID()
ResetVendorID resets all changes to the "vendor_id" field.
func (*CPUMutation) SetCreatedAt ¶
func (m *CPUMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*CPUMutation) SetFamily ¶
func (m *CPUMutation) SetFamily(s string)
SetFamily sets the "family" field.
func (*CPUMutation) SetField ¶
func (m *CPUMutation) 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 (*CPUMutation) SetHostIDID ¶
func (m *CPUMutation) SetHostIDID(id string)
SetHostIDID sets the "host_id" edge to the Host entity by id.
func (*CPUMutation) SetModel ¶
func (m *CPUMutation) SetModel(s string)
SetModel sets the "model" field.
func (*CPUMutation) SetModelName ¶
func (m *CPUMutation) SetModelName(s string)
SetModelName sets the "model_name" field.
func (*CPUMutation) SetUpdatedAt ¶
func (m *CPUMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*CPUMutation) SetVendorID ¶
func (m *CPUMutation) SetVendorID(s string)
SetVendorID sets the "vendor_id" field.
func (CPUMutation) Tx ¶
func (m CPUMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CPUMutation) Type ¶
func (m *CPUMutation) Type() string
Type returns the node type of this mutation (Cpu).
func (*CPUMutation) UpdatedAt ¶
func (m *CPUMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*CPUMutation) VendorID ¶
func (m *CPUMutation) VendorID() (r string, exists bool)
VendorID returns the value of the "vendor_id" field in the mutation.
func (*CPUMutation) Where ¶
func (m *CPUMutation) Where(ps ...predicate.Cpu)
Where appends a list predicates to the CPUMutation builder.
type CPUQuery ¶
type CPUQuery struct {
// contains filtered or unexported fields
}
CPUQuery is the builder for querying Cpu entities.
func (*CPUQuery) Clone ¶
Clone returns a duplicate of the CPUQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CPUQuery) First ¶
First returns the first Cpu entity from the query. Returns a *NotFoundError when no Cpu was found.
func (*CPUQuery) FirstID ¶
FirstID returns the first Cpu ID from the query. Returns a *NotFoundError when no Cpu ID was found.
func (*CPUQuery) GroupBy ¶
func (cq *CPUQuery) GroupBy(field string, fields ...string) *CPUGroupBy
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 { CPU int `json:"CPU,omitempty"` Count int `json:"count,omitempty"` } client.CPU.Query(). GroupBy(cpu.FieldCPU). Aggregate(ent.Count()). Scan(ctx, &v)
func (*CPUQuery) Only ¶
Only returns a single Cpu entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Cpu entity is found. Returns a *NotFoundError when no Cpu entities are found.
func (*CPUQuery) OnlyID ¶
OnlyID is like Only, but returns the only Cpu ID in the query. Returns a *NotSingularError when more than one Cpu ID is found. Returns a *NotFoundError when no entities are found.
func (*CPUQuery) QueryHostID ¶
QueryHostID chains the current query on the "host_id" edge.
func (*CPUQuery) Select ¶
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CPU int `json:"CPU,omitempty"` } client.CPU.Query(). Select(cpu.FieldCPU). Scan(ctx, &v)
func (*CPUQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*CPUQuery) WithHostID ¶
WithHostID tells the query-builder to eager-load the nodes that are connected to the "host_id" edge. The optional arguments are used to configure the query builder of the edge.
type CPUSelect ¶
type CPUSelect struct { *CPUQuery // contains filtered or unexported fields }
CPUSelect is the builder for selecting fields of CPU entities.
func (*CPUSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CPUSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CPUSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CPUSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CPUSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CPUSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CPUSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CPUUpdate ¶
type CPUUpdate struct {
// contains filtered or unexported fields
}
CPUUpdate is the builder for updating Cpu entities.
func (*CPUUpdate) ClearHostID ¶
ClearHostID clears the "host_id" edge to the Host entity.
func (*CPUUpdate) Mutation ¶
func (cu *CPUUpdate) Mutation() *CPUMutation
Mutation returns the CPUMutation object of the builder.
func (*CPUUpdate) Save ¶
Save executes the query and returns the number of nodes affected by the update operation.
func (*CPUUpdate) SetCreatedAt ¶
SetCreatedAt sets the "created_at" field.
func (*CPUUpdate) SetHostIDID ¶
SetHostIDID sets the "host_id" edge to the Host entity by ID.
func (*CPUUpdate) SetModelName ¶
SetModelName sets the "model_name" field.
func (*CPUUpdate) SetNillableCreatedAt ¶
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*CPUUpdate) SetNillableHostIDID ¶
SetNillableHostIDID sets the "host_id" edge to the Host entity by ID if the given value is not nil.
func (*CPUUpdate) SetNillableUpdatedAt ¶
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*CPUUpdate) SetUpdatedAt ¶
SetUpdatedAt sets the "updated_at" field.
func (*CPUUpdate) SetVendorID ¶
SetVendorID sets the "vendor_id" field.
type CPUUpdateOne ¶
type CPUUpdateOne struct {
// contains filtered or unexported fields
}
CPUUpdateOne is the builder for updating a single Cpu entity.
func (*CPUUpdateOne) AddCPU ¶
func (cuo *CPUUpdateOne) AddCPU(i int) *CPUUpdateOne
AddCPU adds i to the "CPU" field.
func (*CPUUpdateOne) ClearHostID ¶
func (cuo *CPUUpdateOne) ClearHostID() *CPUUpdateOne
ClearHostID clears the "host_id" edge to the Host entity.
func (*CPUUpdateOne) Exec ¶
func (cuo *CPUUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CPUUpdateOne) ExecX ¶
func (cuo *CPUUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CPUUpdateOne) Mutation ¶
func (cuo *CPUUpdateOne) Mutation() *CPUMutation
Mutation returns the CPUMutation object of the builder.
func (*CPUUpdateOne) Save ¶
func (cuo *CPUUpdateOne) Save(ctx context.Context) (*Cpu, error)
Save executes the query and returns the updated Cpu entity.
func (*CPUUpdateOne) SaveX ¶
func (cuo *CPUUpdateOne) SaveX(ctx context.Context) *Cpu
SaveX is like Save, but panics if an error occurs.
func (*CPUUpdateOne) Select ¶
func (cuo *CPUUpdateOne) Select(field string, fields ...string) *CPUUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CPUUpdateOne) SetCPU ¶
func (cuo *CPUUpdateOne) SetCPU(i int) *CPUUpdateOne
SetCPU sets the "CPU" field.
func (*CPUUpdateOne) SetCreatedAt ¶
func (cuo *CPUUpdateOne) SetCreatedAt(t time.Time) *CPUUpdateOne
SetCreatedAt sets the "created_at" field.
func (*CPUUpdateOne) SetFamily ¶
func (cuo *CPUUpdateOne) SetFamily(s string) *CPUUpdateOne
SetFamily sets the "family" field.
func (*CPUUpdateOne) SetHostID ¶
func (cuo *CPUUpdateOne) SetHostID(h *Host) *CPUUpdateOne
SetHostID sets the "host_id" edge to the Host entity.
func (*CPUUpdateOne) SetHostIDID ¶
func (cuo *CPUUpdateOne) SetHostIDID(id string) *CPUUpdateOne
SetHostIDID sets the "host_id" edge to the Host entity by ID.
func (*CPUUpdateOne) SetModel ¶
func (cuo *CPUUpdateOne) SetModel(s string) *CPUUpdateOne
SetModel sets the "model" field.
func (*CPUUpdateOne) SetModelName ¶
func (cuo *CPUUpdateOne) SetModelName(s string) *CPUUpdateOne
SetModelName sets the "model_name" field.
func (*CPUUpdateOne) SetNillableCreatedAt ¶
func (cuo *CPUUpdateOne) SetNillableCreatedAt(t *time.Time) *CPUUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*CPUUpdateOne) SetNillableHostIDID ¶
func (cuo *CPUUpdateOne) SetNillableHostIDID(id *string) *CPUUpdateOne
SetNillableHostIDID sets the "host_id" edge to the Host entity by ID if the given value is not nil.
func (*CPUUpdateOne) SetNillableUpdatedAt ¶
func (cuo *CPUUpdateOne) SetNillableUpdatedAt(t *time.Time) *CPUUpdateOne
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*CPUUpdateOne) SetUpdatedAt ¶
func (cuo *CPUUpdateOne) SetUpdatedAt(t time.Time) *CPUUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*CPUUpdateOne) SetVendorID ¶
func (cuo *CPUUpdateOne) SetVendorID(s string) *CPUUpdateOne
SetVendorID sets the "vendor_id" field.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Cpu is the client for interacting with the Cpu builders. Cpu *CpuClient // Disk is the client for interacting with the Disk builders. Disk *DiskClient // Host is the client for interacting with the Host builders. Host *HostClient // Netstat is the client for interacting with the Netstat builders. Netstat *NetstatClient // Network is the client for interacting with the Network builders. Network *NetworkClient // 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(). Cpu. Query(). Count(ctx)
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 Cpu ¶
type Cpu struct { // ID of the ent. ID int `json:"id,omitempty"` // CPU holds the value of the "CPU" field. CPU int `json:"CPU,omitempty"` // VendorID holds the value of the "vendor_id" field. VendorID string `json:"vendor_id,omitempty"` // Family holds the value of the "family" field. Family string `json:"family,omitempty"` // Model holds the value of the "model" field. Model string `json:"model,omitempty"` // ModelName holds the value of the "model_name" field. ModelName string `json:"model_name,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,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 CpuQuery when eager-loading is set. Edges CpuEdges `json:"edges"` // contains filtered or unexported fields }
Cpu is the model entity for the Cpu schema.
func (*Cpu) QueryHostID ¶
QueryHostID queries the "host_id" edge of the Cpu entity.
func (*Cpu) Unwrap ¶
Unwrap unwraps the Cpu 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 (*Cpu) Update ¶
func (c *Cpu) Update() *CPUUpdateOne
Update returns a builder for updating this Cpu. Note that you need to call Cpu.Unwrap() before calling this method if this Cpu was returned from a transaction, and the transaction was committed or rolled back.
type CpuClient ¶
type CpuClient struct {
// contains filtered or unexported fields
}
CpuClient is a client for the Cpu schema.
func NewCpuClient ¶
func NewCpuClient(c config) *CpuClient
NewCpuClient returns a client for the Cpu from the given config.
func (*CpuClient) CreateBulk ¶
func (c *CpuClient) CreateBulk(builders ...*CPUCreate) *CPUCreateBulk
CreateBulk returns a builder for creating a bulk of Cpu entities.
func (*CpuClient) DeleteOne ¶
func (c *CpuClient) DeleteOne(cp *Cpu) *CPUDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*CpuClient) DeleteOneID ¶
func (c *CpuClient) DeleteOneID(id int) *CPUDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*CpuClient) QueryHostID ¶
QueryHostID queries the host_id edge of a Cpu.
func (*CpuClient) UpdateOne ¶
func (c *CpuClient) UpdateOne(cp *Cpu) *CPUUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CpuClient) UpdateOneID ¶
func (c *CpuClient) UpdateOneID(id int) *CPUUpdateOne
UpdateOneID returns an update builder for the given id.
type CpuEdges ¶
type CpuEdges struct { // HostID holds the value of the host_id edge. HostID *Host `json:"host_id,omitempty"` // contains filtered or unexported fields }
CpuEdges holds the relations/edges for other nodes in the graph.
func (CpuEdges) HostIDOrErr ¶
HostIDOrErr returns the HostID value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type Disk ¶
type Disk struct { // ID of the ent. ID int `json:"id,omitempty"` // Device holds the value of the "device" field. Device string `json:"device,omitempty"` // Mountpoint holds the value of the "Mountpoint" field. Mountpoint string `json:"Mountpoint,omitempty"` // Fstype holds the value of the "Fstype" field. Fstype string `json:"Fstype,omitempty"` // Opts holds the value of the "opts" field. Opts []string `json:"opts,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,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 DiskQuery when eager-loading is set. Edges DiskEdges `json:"edges"` // contains filtered or unexported fields }
Disk is the model entity for the Disk schema.
func (*Disk) QueryHostID ¶
QueryHostID queries the "host_id" edge of the Disk entity.
func (*Disk) Unwrap ¶
Unwrap unwraps the Disk 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 (*Disk) Update ¶
func (d *Disk) Update() *DiskUpdateOne
Update returns a builder for updating this Disk. Note that you need to call Disk.Unwrap() before calling this method if this Disk was returned from a transaction, and the transaction was committed or rolled back.
type DiskClient ¶
type DiskClient struct {
// contains filtered or unexported fields
}
DiskClient is a client for the Disk schema.
func NewDiskClient ¶
func NewDiskClient(c config) *DiskClient
NewDiskClient returns a client for the Disk from the given config.
func (*DiskClient) Create ¶
func (c *DiskClient) Create() *DiskCreate
Create returns a create builder for Disk.
func (*DiskClient) CreateBulk ¶
func (c *DiskClient) CreateBulk(builders ...*DiskCreate) *DiskCreateBulk
CreateBulk returns a builder for creating a bulk of Disk entities.
func (*DiskClient) Delete ¶
func (c *DiskClient) Delete() *DiskDelete
Delete returns a delete builder for Disk.
func (*DiskClient) DeleteOne ¶
func (c *DiskClient) DeleteOne(d *Disk) *DiskDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*DiskClient) DeleteOneID ¶
func (c *DiskClient) DeleteOneID(id int) *DiskDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*DiskClient) GetX ¶
func (c *DiskClient) GetX(ctx context.Context, id int) *Disk
GetX is like Get, but panics if an error occurs.
func (*DiskClient) Query ¶
func (c *DiskClient) Query() *DiskQuery
Query returns a query builder for Disk.
func (*DiskClient) QueryHostID ¶
func (c *DiskClient) QueryHostID(d *Disk) *HostQuery
QueryHostID queries the host_id edge of a Disk.
func (*DiskClient) Update ¶
func (c *DiskClient) Update() *DiskUpdate
Update returns an update builder for Disk.
func (*DiskClient) UpdateOne ¶
func (c *DiskClient) UpdateOne(d *Disk) *DiskUpdateOne
UpdateOne returns an update builder for the given entity.
func (*DiskClient) UpdateOneID ¶
func (c *DiskClient) UpdateOneID(id int) *DiskUpdateOne
UpdateOneID returns an update builder for the given id.
func (*DiskClient) Use ¶
func (c *DiskClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `disk.Hooks(f(g(h())))`.
type DiskCreate ¶
type DiskCreate struct {
// contains filtered or unexported fields
}
DiskCreate is the builder for creating a Disk entity.
func (*DiskCreate) Exec ¶
func (dc *DiskCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*DiskCreate) ExecX ¶
func (dc *DiskCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DiskCreate) Mutation ¶
func (dc *DiskCreate) Mutation() *DiskMutation
Mutation returns the DiskMutation object of the builder.
func (*DiskCreate) Save ¶
func (dc *DiskCreate) Save(ctx context.Context) (*Disk, error)
Save creates the Disk in the database.
func (*DiskCreate) SaveX ¶
func (dc *DiskCreate) SaveX(ctx context.Context) *Disk
SaveX calls Save and panics if Save returns an error.
func (*DiskCreate) SetCreatedAt ¶
func (dc *DiskCreate) SetCreatedAt(t time.Time) *DiskCreate
SetCreatedAt sets the "created_at" field.
func (*DiskCreate) SetDevice ¶
func (dc *DiskCreate) SetDevice(s string) *DiskCreate
SetDevice sets the "device" field.
func (*DiskCreate) SetFstype ¶
func (dc *DiskCreate) SetFstype(s string) *DiskCreate
SetFstype sets the "Fstype" field.
func (*DiskCreate) SetHostID ¶
func (dc *DiskCreate) SetHostID(h *Host) *DiskCreate
SetHostID sets the "host_id" edge to the Host entity.
func (*DiskCreate) SetHostIDID ¶
func (dc *DiskCreate) SetHostIDID(id string) *DiskCreate
SetHostIDID sets the "host_id" edge to the Host entity by ID.
func (*DiskCreate) SetMountpoint ¶
func (dc *DiskCreate) SetMountpoint(s string) *DiskCreate
SetMountpoint sets the "Mountpoint" field.
func (*DiskCreate) SetNillableCreatedAt ¶
func (dc *DiskCreate) SetNillableCreatedAt(t *time.Time) *DiskCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*DiskCreate) SetNillableUpdatedAt ¶
func (dc *DiskCreate) SetNillableUpdatedAt(t *time.Time) *DiskCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*DiskCreate) SetOpts ¶
func (dc *DiskCreate) SetOpts(s []string) *DiskCreate
SetOpts sets the "opts" field.
func (*DiskCreate) SetUpdatedAt ¶
func (dc *DiskCreate) SetUpdatedAt(t time.Time) *DiskCreate
SetUpdatedAt sets the "updated_at" field.
type DiskCreateBulk ¶
type DiskCreateBulk struct {
// contains filtered or unexported fields
}
DiskCreateBulk is the builder for creating many Disk entities in bulk.
func (*DiskCreateBulk) Exec ¶
func (dcb *DiskCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*DiskCreateBulk) ExecX ¶
func (dcb *DiskCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type DiskDelete ¶
type DiskDelete struct {
// contains filtered or unexported fields
}
DiskDelete is the builder for deleting a Disk entity.
func (*DiskDelete) Exec ¶
func (dd *DiskDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*DiskDelete) ExecX ¶
func (dd *DiskDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*DiskDelete) Where ¶
func (dd *DiskDelete) Where(ps ...predicate.Disk) *DiskDelete
Where appends a list predicates to the DiskDelete builder.
type DiskDeleteOne ¶
type DiskDeleteOne struct {
// contains filtered or unexported fields
}
DiskDeleteOne is the builder for deleting a single Disk entity.
func (*DiskDeleteOne) Exec ¶
func (ddo *DiskDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*DiskDeleteOne) ExecX ¶
func (ddo *DiskDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type DiskEdges ¶
type DiskEdges struct { // HostID holds the value of the host_id edge. HostID *Host `json:"host_id,omitempty"` // contains filtered or unexported fields }
DiskEdges holds the relations/edges for other nodes in the graph.
func (DiskEdges) HostIDOrErr ¶
HostIDOrErr returns the HostID value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type DiskGroupBy ¶
type DiskGroupBy struct {
// contains filtered or unexported fields
}
DiskGroupBy is the group-by builder for Disk entities.
func (*DiskGroupBy) Aggregate ¶
func (dgb *DiskGroupBy) Aggregate(fns ...AggregateFunc) *DiskGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*DiskGroupBy) Bool ¶
func (dgb *DiskGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*DiskGroupBy) BoolX ¶
func (dgb *DiskGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*DiskGroupBy) Bools ¶
func (dgb *DiskGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*DiskGroupBy) BoolsX ¶
func (dgb *DiskGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*DiskGroupBy) Float64 ¶
func (dgb *DiskGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*DiskGroupBy) Float64X ¶
func (dgb *DiskGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*DiskGroupBy) Float64s ¶
func (dgb *DiskGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*DiskGroupBy) Float64sX ¶
func (dgb *DiskGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*DiskGroupBy) Int ¶
func (dgb *DiskGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*DiskGroupBy) IntX ¶
func (dgb *DiskGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*DiskGroupBy) Ints ¶
func (dgb *DiskGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*DiskGroupBy) IntsX ¶
func (dgb *DiskGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*DiskGroupBy) Scan ¶
func (dgb *DiskGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*DiskGroupBy) ScanX ¶
func (dgb *DiskGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*DiskGroupBy) String ¶
func (dgb *DiskGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*DiskGroupBy) StringX ¶
func (dgb *DiskGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type DiskMutation ¶
type DiskMutation struct {
// contains filtered or unexported fields
}
DiskMutation represents an operation that mutates the Disk nodes in the graph.
func (*DiskMutation) AddField ¶
func (m *DiskMutation) 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 (*DiskMutation) AddedEdges ¶
func (m *DiskMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*DiskMutation) AddedField ¶
func (m *DiskMutation) 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 (*DiskMutation) AddedFields ¶
func (m *DiskMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*DiskMutation) AddedIDs ¶
func (m *DiskMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*DiskMutation) ClearEdge ¶
func (m *DiskMutation) 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 (*DiskMutation) ClearField ¶
func (m *DiskMutation) 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 (*DiskMutation) ClearHostID ¶
func (m *DiskMutation) ClearHostID()
ClearHostID clears the "host_id" edge to the Host entity.
func (*DiskMutation) ClearOpts ¶
func (m *DiskMutation) ClearOpts()
ClearOpts clears the value of the "opts" field.
func (*DiskMutation) ClearedEdges ¶
func (m *DiskMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*DiskMutation) ClearedFields ¶
func (m *DiskMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (DiskMutation) Client ¶
func (m DiskMutation) 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 (*DiskMutation) CreatedAt ¶
func (m *DiskMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*DiskMutation) Device ¶
func (m *DiskMutation) Device() (r string, exists bool)
Device returns the value of the "device" field in the mutation.
func (*DiskMutation) EdgeCleared ¶
func (m *DiskMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*DiskMutation) Field ¶
func (m *DiskMutation) 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 (*DiskMutation) FieldCleared ¶
func (m *DiskMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*DiskMutation) Fields ¶
func (m *DiskMutation) 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 (*DiskMutation) Fstype ¶
func (m *DiskMutation) Fstype() (r string, exists bool)
Fstype returns the value of the "Fstype" field in the mutation.
func (*DiskMutation) HostIDCleared ¶
func (m *DiskMutation) HostIDCleared() bool
HostIDCleared reports if the "host_id" edge to the Host entity was cleared.
func (*DiskMutation) HostIDID ¶
func (m *DiskMutation) HostIDID() (id string, exists bool)
HostIDID returns the "host_id" edge ID in the mutation.
func (*DiskMutation) HostIDIDs ¶
func (m *DiskMutation) HostIDIDs() (ids []string)
HostIDIDs returns the "host_id" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use HostIDID instead. It exists only for internal usage by the builders.
func (*DiskMutation) ID ¶
func (m *DiskMutation) 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 (*DiskMutation) IDs ¶
func (m *DiskMutation) 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 (*DiskMutation) Mountpoint ¶
func (m *DiskMutation) Mountpoint() (r string, exists bool)
Mountpoint returns the value of the "Mountpoint" field in the mutation.
func (*DiskMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Disk entity. If the Disk 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 (*DiskMutation) OldDevice ¶
func (m *DiskMutation) OldDevice(ctx context.Context) (v string, err error)
OldDevice returns the old "device" field's value of the Disk entity. If the Disk 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 (*DiskMutation) 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 (*DiskMutation) OldFstype ¶
func (m *DiskMutation) OldFstype(ctx context.Context) (v string, err error)
OldFstype returns the old "Fstype" field's value of the Disk entity. If the Disk 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 (*DiskMutation) OldMountpoint ¶
func (m *DiskMutation) OldMountpoint(ctx context.Context) (v string, err error)
OldMountpoint returns the old "Mountpoint" field's value of the Disk entity. If the Disk 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 (*DiskMutation) OldOpts ¶
func (m *DiskMutation) OldOpts(ctx context.Context) (v []string, err error)
OldOpts returns the old "opts" field's value of the Disk entity. If the Disk 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 (*DiskMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Disk entity. If the Disk 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 (*DiskMutation) Opts ¶
func (m *DiskMutation) Opts() (r []string, exists bool)
Opts returns the value of the "opts" field in the mutation.
func (*DiskMutation) OptsCleared ¶
func (m *DiskMutation) OptsCleared() bool
OptsCleared returns if the "opts" field was cleared in this mutation.
func (*DiskMutation) RemovedEdges ¶
func (m *DiskMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*DiskMutation) RemovedIDs ¶
func (m *DiskMutation) 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 (*DiskMutation) ResetCreatedAt ¶
func (m *DiskMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*DiskMutation) ResetDevice ¶
func (m *DiskMutation) ResetDevice()
ResetDevice resets all changes to the "device" field.
func (*DiskMutation) ResetEdge ¶
func (m *DiskMutation) 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 (*DiskMutation) ResetField ¶
func (m *DiskMutation) 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 (*DiskMutation) ResetFstype ¶
func (m *DiskMutation) ResetFstype()
ResetFstype resets all changes to the "Fstype" field.
func (*DiskMutation) ResetHostID ¶
func (m *DiskMutation) ResetHostID()
ResetHostID resets all changes to the "host_id" edge.
func (*DiskMutation) ResetMountpoint ¶
func (m *DiskMutation) ResetMountpoint()
ResetMountpoint resets all changes to the "Mountpoint" field.
func (*DiskMutation) ResetOpts ¶
func (m *DiskMutation) ResetOpts()
ResetOpts resets all changes to the "opts" field.
func (*DiskMutation) ResetUpdatedAt ¶
func (m *DiskMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*DiskMutation) SetCreatedAt ¶
func (m *DiskMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*DiskMutation) SetDevice ¶
func (m *DiskMutation) SetDevice(s string)
SetDevice sets the "device" field.
func (*DiskMutation) SetField ¶
func (m *DiskMutation) 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 (*DiskMutation) SetFstype ¶
func (m *DiskMutation) SetFstype(s string)
SetFstype sets the "Fstype" field.
func (*DiskMutation) SetHostIDID ¶
func (m *DiskMutation) SetHostIDID(id string)
SetHostIDID sets the "host_id" edge to the Host entity by id.
func (*DiskMutation) SetMountpoint ¶
func (m *DiskMutation) SetMountpoint(s string)
SetMountpoint sets the "Mountpoint" field.
func (*DiskMutation) SetOpts ¶
func (m *DiskMutation) SetOpts(s []string)
SetOpts sets the "opts" field.
func (*DiskMutation) SetUpdatedAt ¶
func (m *DiskMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (DiskMutation) Tx ¶
func (m DiskMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*DiskMutation) Type ¶
func (m *DiskMutation) Type() string
Type returns the node type of this mutation (Disk).
func (*DiskMutation) UpdatedAt ¶
func (m *DiskMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*DiskMutation) Where ¶
func (m *DiskMutation) Where(ps ...predicate.Disk)
Where appends a list predicates to the DiskMutation builder.
type DiskQuery ¶
type DiskQuery struct {
// contains filtered or unexported fields
}
DiskQuery is the builder for querying Disk entities.
func (*DiskQuery) Clone ¶
Clone returns a duplicate of the DiskQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*DiskQuery) First ¶
First returns the first Disk entity from the query. Returns a *NotFoundError when no Disk was found.
func (*DiskQuery) FirstID ¶
FirstID returns the first Disk ID from the query. Returns a *NotFoundError when no Disk ID was found.
func (*DiskQuery) GroupBy ¶
func (dq *DiskQuery) GroupBy(field string, fields ...string) *DiskGroupBy
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 { Device string `json:"device,omitempty"` Count int `json:"count,omitempty"` } client.Disk.Query(). GroupBy(disk.FieldDevice). Aggregate(ent.Count()). Scan(ctx, &v)
func (*DiskQuery) Only ¶
Only returns a single Disk entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Disk entity is found. Returns a *NotFoundError when no Disk entities are found.
func (*DiskQuery) OnlyID ¶
OnlyID is like Only, but returns the only Disk ID in the query. Returns a *NotSingularError when more than one Disk ID is found. Returns a *NotFoundError when no entities are found.
func (*DiskQuery) QueryHostID ¶
QueryHostID chains the current query on the "host_id" edge.
func (*DiskQuery) Select ¶
func (dq *DiskQuery) Select(fields ...string) *DiskSelect
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 { Device string `json:"device,omitempty"` } client.Disk.Query(). Select(disk.FieldDevice). Scan(ctx, &v)
func (*DiskQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*DiskQuery) WithHostID ¶
WithHostID tells the query-builder to eager-load the nodes that are connected to the "host_id" edge. The optional arguments are used to configure the query builder of the edge.
type DiskSelect ¶
type DiskSelect struct { *DiskQuery // contains filtered or unexported fields }
DiskSelect is the builder for selecting fields of Disk entities.
func (*DiskSelect) Bool ¶
func (ds *DiskSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*DiskSelect) BoolX ¶
func (ds *DiskSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*DiskSelect) Bools ¶
func (ds *DiskSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*DiskSelect) BoolsX ¶
func (ds *DiskSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*DiskSelect) Float64 ¶
func (ds *DiskSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*DiskSelect) Float64X ¶
func (ds *DiskSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*DiskSelect) Float64s ¶
func (ds *DiskSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*DiskSelect) Float64sX ¶
func (ds *DiskSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*DiskSelect) Int ¶
func (ds *DiskSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*DiskSelect) IntX ¶
func (ds *DiskSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*DiskSelect) Ints ¶
func (ds *DiskSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*DiskSelect) IntsX ¶
func (ds *DiskSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*DiskSelect) Scan ¶
func (ds *DiskSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*DiskSelect) ScanX ¶
func (ds *DiskSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*DiskSelect) String ¶
func (ds *DiskSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*DiskSelect) StringX ¶
func (ds *DiskSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type DiskUpdate ¶
type DiskUpdate struct {
// contains filtered or unexported fields
}
DiskUpdate is the builder for updating Disk entities.
func (*DiskUpdate) ClearHostID ¶
func (du *DiskUpdate) ClearHostID() *DiskUpdate
ClearHostID clears the "host_id" edge to the Host entity.
func (*DiskUpdate) ClearOpts ¶
func (du *DiskUpdate) ClearOpts() *DiskUpdate
ClearOpts clears the value of the "opts" field.
func (*DiskUpdate) Exec ¶
func (du *DiskUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*DiskUpdate) ExecX ¶
func (du *DiskUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DiskUpdate) Mutation ¶
func (du *DiskUpdate) Mutation() *DiskMutation
Mutation returns the DiskMutation object of the builder.
func (*DiskUpdate) Save ¶
func (du *DiskUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*DiskUpdate) SaveX ¶
func (du *DiskUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*DiskUpdate) SetCreatedAt ¶
func (du *DiskUpdate) SetCreatedAt(t time.Time) *DiskUpdate
SetCreatedAt sets the "created_at" field.
func (*DiskUpdate) SetDevice ¶
func (du *DiskUpdate) SetDevice(s string) *DiskUpdate
SetDevice sets the "device" field.
func (*DiskUpdate) SetFstype ¶
func (du *DiskUpdate) SetFstype(s string) *DiskUpdate
SetFstype sets the "Fstype" field.
func (*DiskUpdate) SetHostID ¶
func (du *DiskUpdate) SetHostID(h *Host) *DiskUpdate
SetHostID sets the "host_id" edge to the Host entity.
func (*DiskUpdate) SetHostIDID ¶
func (du *DiskUpdate) SetHostIDID(id string) *DiskUpdate
SetHostIDID sets the "host_id" edge to the Host entity by ID.
func (*DiskUpdate) SetMountpoint ¶
func (du *DiskUpdate) SetMountpoint(s string) *DiskUpdate
SetMountpoint sets the "Mountpoint" field.
func (*DiskUpdate) SetNillableCreatedAt ¶
func (du *DiskUpdate) SetNillableCreatedAt(t *time.Time) *DiskUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*DiskUpdate) SetNillableUpdatedAt ¶
func (du *DiskUpdate) SetNillableUpdatedAt(t *time.Time) *DiskUpdate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*DiskUpdate) SetOpts ¶
func (du *DiskUpdate) SetOpts(s []string) *DiskUpdate
SetOpts sets the "opts" field.
func (*DiskUpdate) SetUpdatedAt ¶
func (du *DiskUpdate) SetUpdatedAt(t time.Time) *DiskUpdate
SetUpdatedAt sets the "updated_at" field.
func (*DiskUpdate) Where ¶
func (du *DiskUpdate) Where(ps ...predicate.Disk) *DiskUpdate
Where appends a list predicates to the DiskUpdate builder.
type DiskUpdateOne ¶
type DiskUpdateOne struct {
// contains filtered or unexported fields
}
DiskUpdateOne is the builder for updating a single Disk entity.
func (*DiskUpdateOne) ClearHostID ¶
func (duo *DiskUpdateOne) ClearHostID() *DiskUpdateOne
ClearHostID clears the "host_id" edge to the Host entity.
func (*DiskUpdateOne) ClearOpts ¶
func (duo *DiskUpdateOne) ClearOpts() *DiskUpdateOne
ClearOpts clears the value of the "opts" field.
func (*DiskUpdateOne) Exec ¶
func (duo *DiskUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*DiskUpdateOne) ExecX ¶
func (duo *DiskUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DiskUpdateOne) Mutation ¶
func (duo *DiskUpdateOne) Mutation() *DiskMutation
Mutation returns the DiskMutation object of the builder.
func (*DiskUpdateOne) Save ¶
func (duo *DiskUpdateOne) Save(ctx context.Context) (*Disk, error)
Save executes the query and returns the updated Disk entity.
func (*DiskUpdateOne) SaveX ¶
func (duo *DiskUpdateOne) SaveX(ctx context.Context) *Disk
SaveX is like Save, but panics if an error occurs.
func (*DiskUpdateOne) Select ¶
func (duo *DiskUpdateOne) Select(field string, fields ...string) *DiskUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*DiskUpdateOne) SetCreatedAt ¶
func (duo *DiskUpdateOne) SetCreatedAt(t time.Time) *DiskUpdateOne
SetCreatedAt sets the "created_at" field.
func (*DiskUpdateOne) SetDevice ¶
func (duo *DiskUpdateOne) SetDevice(s string) *DiskUpdateOne
SetDevice sets the "device" field.
func (*DiskUpdateOne) SetFstype ¶
func (duo *DiskUpdateOne) SetFstype(s string) *DiskUpdateOne
SetFstype sets the "Fstype" field.
func (*DiskUpdateOne) SetHostID ¶
func (duo *DiskUpdateOne) SetHostID(h *Host) *DiskUpdateOne
SetHostID sets the "host_id" edge to the Host entity.
func (*DiskUpdateOne) SetHostIDID ¶
func (duo *DiskUpdateOne) SetHostIDID(id string) *DiskUpdateOne
SetHostIDID sets the "host_id" edge to the Host entity by ID.
func (*DiskUpdateOne) SetMountpoint ¶
func (duo *DiskUpdateOne) SetMountpoint(s string) *DiskUpdateOne
SetMountpoint sets the "Mountpoint" field.
func (*DiskUpdateOne) SetNillableCreatedAt ¶
func (duo *DiskUpdateOne) SetNillableCreatedAt(t *time.Time) *DiskUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*DiskUpdateOne) SetNillableUpdatedAt ¶
func (duo *DiskUpdateOne) SetNillableUpdatedAt(t *time.Time) *DiskUpdateOne
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*DiskUpdateOne) SetOpts ¶
func (duo *DiskUpdateOne) SetOpts(s []string) *DiskUpdateOne
SetOpts sets the "opts" field.
func (*DiskUpdateOne) SetUpdatedAt ¶
func (duo *DiskUpdateOne) SetUpdatedAt(t time.Time) *DiskUpdateOne
SetUpdatedAt sets the "updated_at" field.
type Host ¶
type Host struct { // ID of the ent. ID string `json:"id,omitempty"` // Hostname holds the value of the "hostname" field. Hostname string `json:"hostname,omitempty"` // Os holds the value of the "os" field. Os string `json:"os,omitempty"` // Platform holds the value of the "platform" field. Platform string `json:"platform,omitempty"` // PlatformFamily holds the value of the "platform_family" field. PlatformFamily string `json:"platform_family,omitempty"` // PlatformVersion holds the value of the "platform_version" field. PlatformVersion string `json:"platform_version,omitempty"` // KernelVersion holds the value of the "kernel_version" field. KernelVersion string `json:"kernel_version,omitempty"` // KernelArch holds the value of the "kernel_arch" field. KernelArch string `json:"kernel_arch,omitempty"` // VirtualizationSystem holds the value of the "virtualization_system" field. VirtualizationSystem string `json:"virtualization_system,omitempty"` // VirtualizationRole holds the value of the "virtualization_role" field. VirtualizationRole string `json:"virtualization_role,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,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 HostQuery when eager-loading is set. Edges HostEdges `json:"edges"` // contains filtered or unexported fields }
Host is the model entity for the Host schema.
func (*Host) QueryNetstat ¶
func (h *Host) QueryNetstat() *NetstatQuery
QueryNetstat queries the "netstat" edge of the Host entity.
func (*Host) QueryNetwork ¶
func (h *Host) QueryNetwork() *NetworkQuery
QueryNetwork queries the "network" edge of the Host entity.
func (*Host) Unwrap ¶
Unwrap unwraps the Host 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 (*Host) Update ¶
func (h *Host) Update() *HostUpdateOne
Update returns a builder for updating this Host. Note that you need to call Host.Unwrap() before calling this method if this Host was returned from a transaction, and the transaction was committed or rolled back.
type HostClient ¶
type HostClient struct {
// contains filtered or unexported fields
}
HostClient is a client for the Host schema.
func NewHostClient ¶
func NewHostClient(c config) *HostClient
NewHostClient returns a client for the Host from the given config.
func (*HostClient) Create ¶
func (c *HostClient) Create() *HostCreate
Create returns a create builder for Host.
func (*HostClient) CreateBulk ¶
func (c *HostClient) CreateBulk(builders ...*HostCreate) *HostCreateBulk
CreateBulk returns a builder for creating a bulk of Host entities.
func (*HostClient) Delete ¶
func (c *HostClient) Delete() *HostDelete
Delete returns a delete builder for Host.
func (*HostClient) DeleteOne ¶
func (c *HostClient) DeleteOne(h *Host) *HostDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*HostClient) DeleteOneID ¶
func (c *HostClient) DeleteOneID(id string) *HostDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*HostClient) GetX ¶
func (c *HostClient) GetX(ctx context.Context, id string) *Host
GetX is like Get, but panics if an error occurs.
func (*HostClient) Query ¶
func (c *HostClient) Query() *HostQuery
Query returns a query builder for Host.
func (*HostClient) QueryCPU ¶
func (c *HostClient) QueryCPU(h *Host) *CPUQuery
QueryCPU queries the cpu edge of a Host.
func (*HostClient) QueryDisk ¶
func (c *HostClient) QueryDisk(h *Host) *DiskQuery
QueryDisk queries the disk edge of a Host.
func (*HostClient) QueryNetstat ¶
func (c *HostClient) QueryNetstat(h *Host) *NetstatQuery
QueryNetstat queries the netstat edge of a Host.
func (*HostClient) QueryNetwork ¶
func (c *HostClient) QueryNetwork(h *Host) *NetworkQuery
QueryNetwork queries the network edge of a Host.
func (*HostClient) Update ¶
func (c *HostClient) Update() *HostUpdate
Update returns an update builder for Host.
func (*HostClient) UpdateOne ¶
func (c *HostClient) UpdateOne(h *Host) *HostUpdateOne
UpdateOne returns an update builder for the given entity.
func (*HostClient) UpdateOneID ¶
func (c *HostClient) UpdateOneID(id string) *HostUpdateOne
UpdateOneID returns an update builder for the given id.
func (*HostClient) Use ¶
func (c *HostClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `host.Hooks(f(g(h())))`.
type HostCreate ¶
type HostCreate struct {
// contains filtered or unexported fields
}
HostCreate is the builder for creating a Host entity.
func (*HostCreate) AddCPU ¶
func (hc *HostCreate) AddCPU(c ...*Cpu) *HostCreate
AddCPU adds the "cpu" edges to the Cpu entity.
func (*HostCreate) AddCPUIDs ¶
func (hc *HostCreate) AddCPUIDs(ids ...int) *HostCreate
AddCPUIDs adds the "cpu" edge to the Cpu entity by IDs.
func (*HostCreate) AddDisk ¶
func (hc *HostCreate) AddDisk(d ...*Disk) *HostCreate
AddDisk adds the "disk" edges to the Disk entity.
func (*HostCreate) AddDiskIDs ¶
func (hc *HostCreate) AddDiskIDs(ids ...int) *HostCreate
AddDiskIDs adds the "disk" edge to the Disk entity by IDs.
func (*HostCreate) AddNetstat ¶
func (hc *HostCreate) AddNetstat(n ...*Netstat) *HostCreate
AddNetstat adds the "netstat" edges to the Netstat entity.
func (*HostCreate) AddNetstatIDs ¶
func (hc *HostCreate) AddNetstatIDs(ids ...int) *HostCreate
AddNetstatIDs adds the "netstat" edge to the Netstat entity by IDs.
func (*HostCreate) AddNetwork ¶
func (hc *HostCreate) AddNetwork(n ...*Network) *HostCreate
AddNetwork adds the "network" edges to the Network entity.
func (*HostCreate) AddNetworkIDs ¶
func (hc *HostCreate) AddNetworkIDs(ids ...int) *HostCreate
AddNetworkIDs adds the "network" edge to the Network entity by IDs.
func (*HostCreate) Exec ¶
func (hc *HostCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*HostCreate) ExecX ¶
func (hc *HostCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*HostCreate) Mutation ¶
func (hc *HostCreate) Mutation() *HostMutation
Mutation returns the HostMutation object of the builder.
func (*HostCreate) Save ¶
func (hc *HostCreate) Save(ctx context.Context) (*Host, error)
Save creates the Host in the database.
func (*HostCreate) SaveX ¶
func (hc *HostCreate) SaveX(ctx context.Context) *Host
SaveX calls Save and panics if Save returns an error.
func (*HostCreate) SetCreatedAt ¶
func (hc *HostCreate) SetCreatedAt(t time.Time) *HostCreate
SetCreatedAt sets the "created_at" field.
func (*HostCreate) SetHostname ¶
func (hc *HostCreate) SetHostname(s string) *HostCreate
SetHostname sets the "hostname" field.
func (*HostCreate) SetID ¶
func (hc *HostCreate) SetID(s string) *HostCreate
SetID sets the "id" field.
func (*HostCreate) SetKernelArch ¶
func (hc *HostCreate) SetKernelArch(s string) *HostCreate
SetKernelArch sets the "kernel_arch" field.
func (*HostCreate) SetKernelVersion ¶
func (hc *HostCreate) SetKernelVersion(s string) *HostCreate
SetKernelVersion sets the "kernel_version" field.
func (*HostCreate) SetNillableCreatedAt ¶
func (hc *HostCreate) SetNillableCreatedAt(t *time.Time) *HostCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*HostCreate) SetNillableUpdatedAt ¶
func (hc *HostCreate) SetNillableUpdatedAt(t *time.Time) *HostCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*HostCreate) SetOs ¶
func (hc *HostCreate) SetOs(s string) *HostCreate
SetOs sets the "os" field.
func (*HostCreate) SetPlatform ¶
func (hc *HostCreate) SetPlatform(s string) *HostCreate
SetPlatform sets the "platform" field.
func (*HostCreate) SetPlatformFamily ¶
func (hc *HostCreate) SetPlatformFamily(s string) *HostCreate
SetPlatformFamily sets the "platform_family" field.
func (*HostCreate) SetPlatformVersion ¶
func (hc *HostCreate) SetPlatformVersion(s string) *HostCreate
SetPlatformVersion sets the "platform_version" field.
func (*HostCreate) SetUpdatedAt ¶
func (hc *HostCreate) SetUpdatedAt(t time.Time) *HostCreate
SetUpdatedAt sets the "updated_at" field.
func (*HostCreate) SetVirtualizationRole ¶
func (hc *HostCreate) SetVirtualizationRole(s string) *HostCreate
SetVirtualizationRole sets the "virtualization_role" field.
func (*HostCreate) SetVirtualizationSystem ¶
func (hc *HostCreate) SetVirtualizationSystem(s string) *HostCreate
SetVirtualizationSystem sets the "virtualization_system" field.
type HostCreateBulk ¶
type HostCreateBulk struct {
// contains filtered or unexported fields
}
HostCreateBulk is the builder for creating many Host entities in bulk.
func (*HostCreateBulk) Exec ¶
func (hcb *HostCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*HostCreateBulk) ExecX ¶
func (hcb *HostCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type HostDelete ¶
type HostDelete struct {
// contains filtered or unexported fields
}
HostDelete is the builder for deleting a Host entity.
func (*HostDelete) Exec ¶
func (hd *HostDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*HostDelete) ExecX ¶
func (hd *HostDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*HostDelete) Where ¶
func (hd *HostDelete) Where(ps ...predicate.Host) *HostDelete
Where appends a list predicates to the HostDelete builder.
type HostDeleteOne ¶
type HostDeleteOne struct {
// contains filtered or unexported fields
}
HostDeleteOne is the builder for deleting a single Host entity.
func (*HostDeleteOne) Exec ¶
func (hdo *HostDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*HostDeleteOne) ExecX ¶
func (hdo *HostDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type HostEdges ¶
type HostEdges struct { // CPU holds the value of the cpu edge. CPU []*Cpu `json:"cpu,omitempty"` // Network holds the value of the network edge. Network []*Network `json:"network,omitempty"` // Netstat holds the value of the netstat edge. Netstat []*Netstat `json:"netstat,omitempty"` // Disk holds the value of the disk edge. Disk []*Disk `json:"disk,omitempty"` // contains filtered or unexported fields }
HostEdges holds the relations/edges for other nodes in the graph.
func (HostEdges) CPUOrErr ¶
CPUOrErr returns the CPU value or an error if the edge was not loaded in eager-loading.
func (HostEdges) DiskOrErr ¶
DiskOrErr returns the Disk value or an error if the edge was not loaded in eager-loading.
func (HostEdges) NetstatOrErr ¶
NetstatOrErr returns the Netstat value or an error if the edge was not loaded in eager-loading.
func (HostEdges) NetworkOrErr ¶
NetworkOrErr returns the Network value or an error if the edge was not loaded in eager-loading.
type HostGroupBy ¶
type HostGroupBy struct {
// contains filtered or unexported fields
}
HostGroupBy is the group-by builder for Host entities.
func (*HostGroupBy) Aggregate ¶
func (hgb *HostGroupBy) Aggregate(fns ...AggregateFunc) *HostGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*HostGroupBy) Bool ¶
func (hgb *HostGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*HostGroupBy) BoolX ¶
func (hgb *HostGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*HostGroupBy) Bools ¶
func (hgb *HostGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*HostGroupBy) BoolsX ¶
func (hgb *HostGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*HostGroupBy) Float64 ¶
func (hgb *HostGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*HostGroupBy) Float64X ¶
func (hgb *HostGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*HostGroupBy) Float64s ¶
func (hgb *HostGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*HostGroupBy) Float64sX ¶
func (hgb *HostGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*HostGroupBy) Int ¶
func (hgb *HostGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*HostGroupBy) IntX ¶
func (hgb *HostGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*HostGroupBy) Ints ¶
func (hgb *HostGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*HostGroupBy) IntsX ¶
func (hgb *HostGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*HostGroupBy) Scan ¶
func (hgb *HostGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*HostGroupBy) ScanX ¶
func (hgb *HostGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*HostGroupBy) String ¶
func (hgb *HostGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*HostGroupBy) StringX ¶
func (hgb *HostGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type HostMutation ¶
type HostMutation struct {
// contains filtered or unexported fields
}
HostMutation represents an operation that mutates the Host nodes in the graph.
func (*HostMutation) AddCPUIDs ¶
func (m *HostMutation) AddCPUIDs(ids ...int)
AddCPUIDs adds the "cpu" edge to the Cpu entity by ids.
func (*HostMutation) AddDiskIDs ¶
func (m *HostMutation) AddDiskIDs(ids ...int)
AddDiskIDs adds the "disk" edge to the Disk entity by ids.
func (*HostMutation) AddField ¶
func (m *HostMutation) 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 (*HostMutation) AddNetstatIDs ¶
func (m *HostMutation) AddNetstatIDs(ids ...int)
AddNetstatIDs adds the "netstat" edge to the Netstat entity by ids.
func (*HostMutation) AddNetworkIDs ¶
func (m *HostMutation) AddNetworkIDs(ids ...int)
AddNetworkIDs adds the "network" edge to the Network entity by ids.
func (*HostMutation) AddedEdges ¶
func (m *HostMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*HostMutation) AddedField ¶
func (m *HostMutation) 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 (*HostMutation) AddedFields ¶
func (m *HostMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*HostMutation) AddedIDs ¶
func (m *HostMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*HostMutation) CPUCleared ¶
func (m *HostMutation) CPUCleared() bool
CPUCleared reports if the "cpu" edge to the Cpu entity was cleared.
func (*HostMutation) CPUIDs ¶
func (m *HostMutation) CPUIDs() (ids []int)
CPUIDs returns the "cpu" edge IDs in the mutation.
func (*HostMutation) ClearCPU ¶
func (m *HostMutation) ClearCPU()
ClearCPU clears the "cpu" edge to the Cpu entity.
func (*HostMutation) ClearDisk ¶
func (m *HostMutation) ClearDisk()
ClearDisk clears the "disk" edge to the Disk entity.
func (*HostMutation) ClearEdge ¶
func (m *HostMutation) 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 (*HostMutation) ClearField ¶
func (m *HostMutation) 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 (*HostMutation) ClearNetstat ¶
func (m *HostMutation) ClearNetstat()
ClearNetstat clears the "netstat" edge to the Netstat entity.
func (*HostMutation) ClearNetwork ¶
func (m *HostMutation) ClearNetwork()
ClearNetwork clears the "network" edge to the Network entity.
func (*HostMutation) ClearedEdges ¶
func (m *HostMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*HostMutation) ClearedFields ¶
func (m *HostMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (HostMutation) Client ¶
func (m HostMutation) 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 (*HostMutation) CreatedAt ¶
func (m *HostMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*HostMutation) DiskCleared ¶
func (m *HostMutation) DiskCleared() bool
DiskCleared reports if the "disk" edge to the Disk entity was cleared.
func (*HostMutation) DiskIDs ¶
func (m *HostMutation) DiskIDs() (ids []int)
DiskIDs returns the "disk" edge IDs in the mutation.
func (*HostMutation) EdgeCleared ¶
func (m *HostMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*HostMutation) Field ¶
func (m *HostMutation) 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 (*HostMutation) FieldCleared ¶
func (m *HostMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*HostMutation) Fields ¶
func (m *HostMutation) 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 (*HostMutation) Hostname ¶
func (m *HostMutation) Hostname() (r string, exists bool)
Hostname returns the value of the "hostname" field in the mutation.
func (*HostMutation) ID ¶
func (m *HostMutation) 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 (*HostMutation) IDs ¶
func (m *HostMutation) 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 (*HostMutation) KernelArch ¶
func (m *HostMutation) KernelArch() (r string, exists bool)
KernelArch returns the value of the "kernel_arch" field in the mutation.
func (*HostMutation) KernelVersion ¶
func (m *HostMutation) KernelVersion() (r string, exists bool)
KernelVersion returns the value of the "kernel_version" field in the mutation.
func (*HostMutation) NetstatCleared ¶
func (m *HostMutation) NetstatCleared() bool
NetstatCleared reports if the "netstat" edge to the Netstat entity was cleared.
func (*HostMutation) NetstatIDs ¶
func (m *HostMutation) NetstatIDs() (ids []int)
NetstatIDs returns the "netstat" edge IDs in the mutation.
func (*HostMutation) NetworkCleared ¶
func (m *HostMutation) NetworkCleared() bool
NetworkCleared reports if the "network" edge to the Network entity was cleared.
func (*HostMutation) NetworkIDs ¶
func (m *HostMutation) NetworkIDs() (ids []int)
NetworkIDs returns the "network" edge IDs in the mutation.
func (*HostMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Host entity. If the Host 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 (*HostMutation) 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 (*HostMutation) OldHostname ¶
func (m *HostMutation) OldHostname(ctx context.Context) (v string, err error)
OldHostname returns the old "hostname" field's value of the Host entity. If the Host 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 (*HostMutation) OldKernelArch ¶
func (m *HostMutation) OldKernelArch(ctx context.Context) (v string, err error)
OldKernelArch returns the old "kernel_arch" field's value of the Host entity. If the Host 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 (*HostMutation) OldKernelVersion ¶
func (m *HostMutation) OldKernelVersion(ctx context.Context) (v string, err error)
OldKernelVersion returns the old "kernel_version" field's value of the Host entity. If the Host 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 (*HostMutation) OldOs ¶
func (m *HostMutation) OldOs(ctx context.Context) (v string, err error)
OldOs returns the old "os" field's value of the Host entity. If the Host 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 (*HostMutation) OldPlatform ¶
func (m *HostMutation) OldPlatform(ctx context.Context) (v string, err error)
OldPlatform returns the old "platform" field's value of the Host entity. If the Host 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 (*HostMutation) OldPlatformFamily ¶
func (m *HostMutation) OldPlatformFamily(ctx context.Context) (v string, err error)
OldPlatformFamily returns the old "platform_family" field's value of the Host entity. If the Host 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 (*HostMutation) OldPlatformVersion ¶
func (m *HostMutation) OldPlatformVersion(ctx context.Context) (v string, err error)
OldPlatformVersion returns the old "platform_version" field's value of the Host entity. If the Host 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 (*HostMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Host entity. If the Host 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 (*HostMutation) OldVirtualizationRole ¶
func (m *HostMutation) OldVirtualizationRole(ctx context.Context) (v string, err error)
OldVirtualizationRole returns the old "virtualization_role" field's value of the Host entity. If the Host 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 (*HostMutation) OldVirtualizationSystem ¶
func (m *HostMutation) OldVirtualizationSystem(ctx context.Context) (v string, err error)
OldVirtualizationSystem returns the old "virtualization_system" field's value of the Host entity. If the Host 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 (*HostMutation) Os ¶
func (m *HostMutation) Os() (r string, exists bool)
Os returns the value of the "os" field in the mutation.
func (*HostMutation) Platform ¶
func (m *HostMutation) Platform() (r string, exists bool)
Platform returns the value of the "platform" field in the mutation.
func (*HostMutation) PlatformFamily ¶
func (m *HostMutation) PlatformFamily() (r string, exists bool)
PlatformFamily returns the value of the "platform_family" field in the mutation.
func (*HostMutation) PlatformVersion ¶
func (m *HostMutation) PlatformVersion() (r string, exists bool)
PlatformVersion returns the value of the "platform_version" field in the mutation.
func (*HostMutation) RemoveCPUIDs ¶
func (m *HostMutation) RemoveCPUIDs(ids ...int)
RemoveCPUIDs removes the "cpu" edge to the Cpu entity by IDs.
func (*HostMutation) RemoveDiskIDs ¶
func (m *HostMutation) RemoveDiskIDs(ids ...int)
RemoveDiskIDs removes the "disk" edge to the Disk entity by IDs.
func (*HostMutation) RemoveNetstatIDs ¶
func (m *HostMutation) RemoveNetstatIDs(ids ...int)
RemoveNetstatIDs removes the "netstat" edge to the Netstat entity by IDs.
func (*HostMutation) RemoveNetworkIDs ¶
func (m *HostMutation) RemoveNetworkIDs(ids ...int)
RemoveNetworkIDs removes the "network" edge to the Network entity by IDs.
func (*HostMutation) RemovedCPUIDs ¶
func (m *HostMutation) RemovedCPUIDs() (ids []int)
RemovedCPU returns the removed IDs of the "cpu" edge to the Cpu entity.
func (*HostMutation) RemovedDiskIDs ¶
func (m *HostMutation) RemovedDiskIDs() (ids []int)
RemovedDisk returns the removed IDs of the "disk" edge to the Disk entity.
func (*HostMutation) RemovedEdges ¶
func (m *HostMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*HostMutation) RemovedIDs ¶
func (m *HostMutation) 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 (*HostMutation) RemovedNetstatIDs ¶
func (m *HostMutation) RemovedNetstatIDs() (ids []int)
RemovedNetstat returns the removed IDs of the "netstat" edge to the Netstat entity.
func (*HostMutation) RemovedNetworkIDs ¶
func (m *HostMutation) RemovedNetworkIDs() (ids []int)
RemovedNetwork returns the removed IDs of the "network" edge to the Network entity.
func (*HostMutation) ResetCPU ¶
func (m *HostMutation) ResetCPU()
ResetCPU resets all changes to the "cpu" edge.
func (*HostMutation) ResetCreatedAt ¶
func (m *HostMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*HostMutation) ResetDisk ¶
func (m *HostMutation) ResetDisk()
ResetDisk resets all changes to the "disk" edge.
func (*HostMutation) ResetEdge ¶
func (m *HostMutation) 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 (*HostMutation) ResetField ¶
func (m *HostMutation) 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 (*HostMutation) ResetHostname ¶
func (m *HostMutation) ResetHostname()
ResetHostname resets all changes to the "hostname" field.
func (*HostMutation) ResetKernelArch ¶
func (m *HostMutation) ResetKernelArch()
ResetKernelArch resets all changes to the "kernel_arch" field.
func (*HostMutation) ResetKernelVersion ¶
func (m *HostMutation) ResetKernelVersion()
ResetKernelVersion resets all changes to the "kernel_version" field.
func (*HostMutation) ResetNetstat ¶
func (m *HostMutation) ResetNetstat()
ResetNetstat resets all changes to the "netstat" edge.
func (*HostMutation) ResetNetwork ¶
func (m *HostMutation) ResetNetwork()
ResetNetwork resets all changes to the "network" edge.
func (*HostMutation) ResetOs ¶
func (m *HostMutation) ResetOs()
ResetOs resets all changes to the "os" field.
func (*HostMutation) ResetPlatform ¶
func (m *HostMutation) ResetPlatform()
ResetPlatform resets all changes to the "platform" field.
func (*HostMutation) ResetPlatformFamily ¶
func (m *HostMutation) ResetPlatformFamily()
ResetPlatformFamily resets all changes to the "platform_family" field.
func (*HostMutation) ResetPlatformVersion ¶
func (m *HostMutation) ResetPlatformVersion()
ResetPlatformVersion resets all changes to the "platform_version" field.
func (*HostMutation) ResetUpdatedAt ¶
func (m *HostMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*HostMutation) ResetVirtualizationRole ¶
func (m *HostMutation) ResetVirtualizationRole()
ResetVirtualizationRole resets all changes to the "virtualization_role" field.
func (*HostMutation) ResetVirtualizationSystem ¶
func (m *HostMutation) ResetVirtualizationSystem()
ResetVirtualizationSystem resets all changes to the "virtualization_system" field.
func (*HostMutation) SetCreatedAt ¶
func (m *HostMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*HostMutation) SetField ¶
func (m *HostMutation) 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 (*HostMutation) SetHostname ¶
func (m *HostMutation) SetHostname(s string)
SetHostname sets the "hostname" field.
func (*HostMutation) SetID ¶
func (m *HostMutation) SetID(id string)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Host entities.
func (*HostMutation) SetKernelArch ¶
func (m *HostMutation) SetKernelArch(s string)
SetKernelArch sets the "kernel_arch" field.
func (*HostMutation) SetKernelVersion ¶
func (m *HostMutation) SetKernelVersion(s string)
SetKernelVersion sets the "kernel_version" field.
func (*HostMutation) SetPlatform ¶
func (m *HostMutation) SetPlatform(s string)
SetPlatform sets the "platform" field.
func (*HostMutation) SetPlatformFamily ¶
func (m *HostMutation) SetPlatformFamily(s string)
SetPlatformFamily sets the "platform_family" field.
func (*HostMutation) SetPlatformVersion ¶
func (m *HostMutation) SetPlatformVersion(s string)
SetPlatformVersion sets the "platform_version" field.
func (*HostMutation) SetUpdatedAt ¶
func (m *HostMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*HostMutation) SetVirtualizationRole ¶
func (m *HostMutation) SetVirtualizationRole(s string)
SetVirtualizationRole sets the "virtualization_role" field.
func (*HostMutation) SetVirtualizationSystem ¶
func (m *HostMutation) SetVirtualizationSystem(s string)
SetVirtualizationSystem sets the "virtualization_system" field.
func (HostMutation) Tx ¶
func (m HostMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*HostMutation) Type ¶
func (m *HostMutation) Type() string
Type returns the node type of this mutation (Host).
func (*HostMutation) UpdatedAt ¶
func (m *HostMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*HostMutation) VirtualizationRole ¶
func (m *HostMutation) VirtualizationRole() (r string, exists bool)
VirtualizationRole returns the value of the "virtualization_role" field in the mutation.
func (*HostMutation) VirtualizationSystem ¶
func (m *HostMutation) VirtualizationSystem() (r string, exists bool)
VirtualizationSystem returns the value of the "virtualization_system" field in the mutation.
func (*HostMutation) Where ¶
func (m *HostMutation) Where(ps ...predicate.Host)
Where appends a list predicates to the HostMutation builder.
type HostQuery ¶
type HostQuery struct {
// contains filtered or unexported fields
}
HostQuery is the builder for querying Host entities.
func (*HostQuery) Clone ¶
Clone returns a duplicate of the HostQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*HostQuery) First ¶
First returns the first Host entity from the query. Returns a *NotFoundError when no Host was found.
func (*HostQuery) FirstID ¶
FirstID returns the first Host ID from the query. Returns a *NotFoundError when no Host ID was found.
func (*HostQuery) GroupBy ¶
func (hq *HostQuery) GroupBy(field string, fields ...string) *HostGroupBy
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 { Hostname string `json:"hostname,omitempty"` Count int `json:"count,omitempty"` } client.Host.Query(). GroupBy(host.FieldHostname). Aggregate(ent.Count()). Scan(ctx, &v)
func (*HostQuery) Only ¶
Only returns a single Host entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Host entity is found. Returns a *NotFoundError when no Host entities are found.
func (*HostQuery) OnlyID ¶
OnlyID is like Only, but returns the only Host ID in the query. Returns a *NotSingularError when more than one Host ID is found. Returns a *NotFoundError when no entities are found.
func (*HostQuery) QueryNetstat ¶
func (hq *HostQuery) QueryNetstat() *NetstatQuery
QueryNetstat chains the current query on the "netstat" edge.
func (*HostQuery) QueryNetwork ¶
func (hq *HostQuery) QueryNetwork() *NetworkQuery
QueryNetwork chains the current query on the "network" edge.
func (*HostQuery) Select ¶
func (hq *HostQuery) Select(fields ...string) *HostSelect
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 { Hostname string `json:"hostname,omitempty"` } client.Host.Query(). Select(host.FieldHostname). Scan(ctx, &v)
func (*HostQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*HostQuery) WithCPU ¶
WithCPU tells the query-builder to eager-load the nodes that are connected to the "cpu" edge. The optional arguments are used to configure the query builder of the edge.
func (*HostQuery) WithDisk ¶
WithDisk tells the query-builder to eager-load the nodes that are connected to the "disk" edge. The optional arguments are used to configure the query builder of the edge.
func (*HostQuery) WithNetstat ¶
func (hq *HostQuery) WithNetstat(opts ...func(*NetstatQuery)) *HostQuery
WithNetstat tells the query-builder to eager-load the nodes that are connected to the "netstat" edge. The optional arguments are used to configure the query builder of the edge.
func (*HostQuery) WithNetwork ¶
func (hq *HostQuery) WithNetwork(opts ...func(*NetworkQuery)) *HostQuery
WithNetwork tells the query-builder to eager-load the nodes that are connected to the "network" edge. The optional arguments are used to configure the query builder of the edge.
type HostSelect ¶
type HostSelect struct { *HostQuery // contains filtered or unexported fields }
HostSelect is the builder for selecting fields of Host entities.
func (*HostSelect) Bool ¶
func (hs *HostSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*HostSelect) BoolX ¶
func (hs *HostSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*HostSelect) Bools ¶
func (hs *HostSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*HostSelect) BoolsX ¶
func (hs *HostSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*HostSelect) Float64 ¶
func (hs *HostSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*HostSelect) Float64X ¶
func (hs *HostSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*HostSelect) Float64s ¶
func (hs *HostSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*HostSelect) Float64sX ¶
func (hs *HostSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*HostSelect) Int ¶
func (hs *HostSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*HostSelect) IntX ¶
func (hs *HostSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*HostSelect) Ints ¶
func (hs *HostSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*HostSelect) IntsX ¶
func (hs *HostSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*HostSelect) Scan ¶
func (hs *HostSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*HostSelect) ScanX ¶
func (hs *HostSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*HostSelect) String ¶
func (hs *HostSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*HostSelect) StringX ¶
func (hs *HostSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type HostUpdate ¶
type HostUpdate struct {
// contains filtered or unexported fields
}
HostUpdate is the builder for updating Host entities.
func (*HostUpdate) AddCPU ¶
func (hu *HostUpdate) AddCPU(c ...*Cpu) *HostUpdate
AddCPU adds the "cpu" edges to the Cpu entity.
func (*HostUpdate) AddCPUIDs ¶
func (hu *HostUpdate) AddCPUIDs(ids ...int) *HostUpdate
AddCPUIDs adds the "cpu" edge to the Cpu entity by IDs.
func (*HostUpdate) AddDisk ¶
func (hu *HostUpdate) AddDisk(d ...*Disk) *HostUpdate
AddDisk adds the "disk" edges to the Disk entity.
func (*HostUpdate) AddDiskIDs ¶
func (hu *HostUpdate) AddDiskIDs(ids ...int) *HostUpdate
AddDiskIDs adds the "disk" edge to the Disk entity by IDs.
func (*HostUpdate) AddNetstat ¶
func (hu *HostUpdate) AddNetstat(n ...*Netstat) *HostUpdate
AddNetstat adds the "netstat" edges to the Netstat entity.
func (*HostUpdate) AddNetstatIDs ¶
func (hu *HostUpdate) AddNetstatIDs(ids ...int) *HostUpdate
AddNetstatIDs adds the "netstat" edge to the Netstat entity by IDs.
func (*HostUpdate) AddNetwork ¶
func (hu *HostUpdate) AddNetwork(n ...*Network) *HostUpdate
AddNetwork adds the "network" edges to the Network entity.
func (*HostUpdate) AddNetworkIDs ¶
func (hu *HostUpdate) AddNetworkIDs(ids ...int) *HostUpdate
AddNetworkIDs adds the "network" edge to the Network entity by IDs.
func (*HostUpdate) ClearCPU ¶
func (hu *HostUpdate) ClearCPU() *HostUpdate
ClearCPU clears all "cpu" edges to the Cpu entity.
func (*HostUpdate) ClearDisk ¶
func (hu *HostUpdate) ClearDisk() *HostUpdate
ClearDisk clears all "disk" edges to the Disk entity.
func (*HostUpdate) ClearNetstat ¶
func (hu *HostUpdate) ClearNetstat() *HostUpdate
ClearNetstat clears all "netstat" edges to the Netstat entity.
func (*HostUpdate) ClearNetwork ¶
func (hu *HostUpdate) ClearNetwork() *HostUpdate
ClearNetwork clears all "network" edges to the Network entity.
func (*HostUpdate) Exec ¶
func (hu *HostUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*HostUpdate) ExecX ¶
func (hu *HostUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*HostUpdate) Mutation ¶
func (hu *HostUpdate) Mutation() *HostMutation
Mutation returns the HostMutation object of the builder.
func (*HostUpdate) RemoveCPU ¶
func (hu *HostUpdate) RemoveCPU(c ...*Cpu) *HostUpdate
RemoveCPU removes "cpu" edges to Cpu entities.
func (*HostUpdate) RemoveCPUIDs ¶
func (hu *HostUpdate) RemoveCPUIDs(ids ...int) *HostUpdate
RemoveCPUIDs removes the "cpu" edge to Cpu entities by IDs.
func (*HostUpdate) RemoveDisk ¶
func (hu *HostUpdate) RemoveDisk(d ...*Disk) *HostUpdate
RemoveDisk removes "disk" edges to Disk entities.
func (*HostUpdate) RemoveDiskIDs ¶
func (hu *HostUpdate) RemoveDiskIDs(ids ...int) *HostUpdate
RemoveDiskIDs removes the "disk" edge to Disk entities by IDs.
func (*HostUpdate) RemoveNetstat ¶
func (hu *HostUpdate) RemoveNetstat(n ...*Netstat) *HostUpdate
RemoveNetstat removes "netstat" edges to Netstat entities.
func (*HostUpdate) RemoveNetstatIDs ¶
func (hu *HostUpdate) RemoveNetstatIDs(ids ...int) *HostUpdate
RemoveNetstatIDs removes the "netstat" edge to Netstat entities by IDs.
func (*HostUpdate) RemoveNetwork ¶
func (hu *HostUpdate) RemoveNetwork(n ...*Network) *HostUpdate
RemoveNetwork removes "network" edges to Network entities.
func (*HostUpdate) RemoveNetworkIDs ¶
func (hu *HostUpdate) RemoveNetworkIDs(ids ...int) *HostUpdate
RemoveNetworkIDs removes the "network" edge to Network entities by IDs.
func (*HostUpdate) Save ¶
func (hu *HostUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*HostUpdate) SaveX ¶
func (hu *HostUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*HostUpdate) SetCreatedAt ¶
func (hu *HostUpdate) SetCreatedAt(t time.Time) *HostUpdate
SetCreatedAt sets the "created_at" field.
func (*HostUpdate) SetHostname ¶
func (hu *HostUpdate) SetHostname(s string) *HostUpdate
SetHostname sets the "hostname" field.
func (*HostUpdate) SetKernelArch ¶
func (hu *HostUpdate) SetKernelArch(s string) *HostUpdate
SetKernelArch sets the "kernel_arch" field.
func (*HostUpdate) SetKernelVersion ¶
func (hu *HostUpdate) SetKernelVersion(s string) *HostUpdate
SetKernelVersion sets the "kernel_version" field.
func (*HostUpdate) SetNillableCreatedAt ¶
func (hu *HostUpdate) SetNillableCreatedAt(t *time.Time) *HostUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*HostUpdate) SetNillableUpdatedAt ¶
func (hu *HostUpdate) SetNillableUpdatedAt(t *time.Time) *HostUpdate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*HostUpdate) SetOs ¶
func (hu *HostUpdate) SetOs(s string) *HostUpdate
SetOs sets the "os" field.
func (*HostUpdate) SetPlatform ¶
func (hu *HostUpdate) SetPlatform(s string) *HostUpdate
SetPlatform sets the "platform" field.
func (*HostUpdate) SetPlatformFamily ¶
func (hu *HostUpdate) SetPlatformFamily(s string) *HostUpdate
SetPlatformFamily sets the "platform_family" field.
func (*HostUpdate) SetPlatformVersion ¶
func (hu *HostUpdate) SetPlatformVersion(s string) *HostUpdate
SetPlatformVersion sets the "platform_version" field.
func (*HostUpdate) SetUpdatedAt ¶
func (hu *HostUpdate) SetUpdatedAt(t time.Time) *HostUpdate
SetUpdatedAt sets the "updated_at" field.
func (*HostUpdate) SetVirtualizationRole ¶
func (hu *HostUpdate) SetVirtualizationRole(s string) *HostUpdate
SetVirtualizationRole sets the "virtualization_role" field.
func (*HostUpdate) SetVirtualizationSystem ¶
func (hu *HostUpdate) SetVirtualizationSystem(s string) *HostUpdate
SetVirtualizationSystem sets the "virtualization_system" field.
func (*HostUpdate) Where ¶
func (hu *HostUpdate) Where(ps ...predicate.Host) *HostUpdate
Where appends a list predicates to the HostUpdate builder.
type HostUpdateOne ¶
type HostUpdateOne struct {
// contains filtered or unexported fields
}
HostUpdateOne is the builder for updating a single Host entity.
func (*HostUpdateOne) AddCPU ¶
func (huo *HostUpdateOne) AddCPU(c ...*Cpu) *HostUpdateOne
AddCPU adds the "cpu" edges to the Cpu entity.
func (*HostUpdateOne) AddCPUIDs ¶
func (huo *HostUpdateOne) AddCPUIDs(ids ...int) *HostUpdateOne
AddCPUIDs adds the "cpu" edge to the Cpu entity by IDs.
func (*HostUpdateOne) AddDisk ¶
func (huo *HostUpdateOne) AddDisk(d ...*Disk) *HostUpdateOne
AddDisk adds the "disk" edges to the Disk entity.
func (*HostUpdateOne) AddDiskIDs ¶
func (huo *HostUpdateOne) AddDiskIDs(ids ...int) *HostUpdateOne
AddDiskIDs adds the "disk" edge to the Disk entity by IDs.
func (*HostUpdateOne) AddNetstat ¶
func (huo *HostUpdateOne) AddNetstat(n ...*Netstat) *HostUpdateOne
AddNetstat adds the "netstat" edges to the Netstat entity.
func (*HostUpdateOne) AddNetstatIDs ¶
func (huo *HostUpdateOne) AddNetstatIDs(ids ...int) *HostUpdateOne
AddNetstatIDs adds the "netstat" edge to the Netstat entity by IDs.
func (*HostUpdateOne) AddNetwork ¶
func (huo *HostUpdateOne) AddNetwork(n ...*Network) *HostUpdateOne
AddNetwork adds the "network" edges to the Network entity.
func (*HostUpdateOne) AddNetworkIDs ¶
func (huo *HostUpdateOne) AddNetworkIDs(ids ...int) *HostUpdateOne
AddNetworkIDs adds the "network" edge to the Network entity by IDs.
func (*HostUpdateOne) ClearCPU ¶
func (huo *HostUpdateOne) ClearCPU() *HostUpdateOne
ClearCPU clears all "cpu" edges to the Cpu entity.
func (*HostUpdateOne) ClearDisk ¶
func (huo *HostUpdateOne) ClearDisk() *HostUpdateOne
ClearDisk clears all "disk" edges to the Disk entity.
func (*HostUpdateOne) ClearNetstat ¶
func (huo *HostUpdateOne) ClearNetstat() *HostUpdateOne
ClearNetstat clears all "netstat" edges to the Netstat entity.
func (*HostUpdateOne) ClearNetwork ¶
func (huo *HostUpdateOne) ClearNetwork() *HostUpdateOne
ClearNetwork clears all "network" edges to the Network entity.
func (*HostUpdateOne) Exec ¶
func (huo *HostUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*HostUpdateOne) ExecX ¶
func (huo *HostUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*HostUpdateOne) Mutation ¶
func (huo *HostUpdateOne) Mutation() *HostMutation
Mutation returns the HostMutation object of the builder.
func (*HostUpdateOne) RemoveCPU ¶
func (huo *HostUpdateOne) RemoveCPU(c ...*Cpu) *HostUpdateOne
RemoveCPU removes "cpu" edges to Cpu entities.
func (*HostUpdateOne) RemoveCPUIDs ¶
func (huo *HostUpdateOne) RemoveCPUIDs(ids ...int) *HostUpdateOne
RemoveCPUIDs removes the "cpu" edge to Cpu entities by IDs.
func (*HostUpdateOne) RemoveDisk ¶
func (huo *HostUpdateOne) RemoveDisk(d ...*Disk) *HostUpdateOne
RemoveDisk removes "disk" edges to Disk entities.
func (*HostUpdateOne) RemoveDiskIDs ¶
func (huo *HostUpdateOne) RemoveDiskIDs(ids ...int) *HostUpdateOne
RemoveDiskIDs removes the "disk" edge to Disk entities by IDs.
func (*HostUpdateOne) RemoveNetstat ¶
func (huo *HostUpdateOne) RemoveNetstat(n ...*Netstat) *HostUpdateOne
RemoveNetstat removes "netstat" edges to Netstat entities.
func (*HostUpdateOne) RemoveNetstatIDs ¶
func (huo *HostUpdateOne) RemoveNetstatIDs(ids ...int) *HostUpdateOne
RemoveNetstatIDs removes the "netstat" edge to Netstat entities by IDs.
func (*HostUpdateOne) RemoveNetwork ¶
func (huo *HostUpdateOne) RemoveNetwork(n ...*Network) *HostUpdateOne
RemoveNetwork removes "network" edges to Network entities.
func (*HostUpdateOne) RemoveNetworkIDs ¶
func (huo *HostUpdateOne) RemoveNetworkIDs(ids ...int) *HostUpdateOne
RemoveNetworkIDs removes the "network" edge to Network entities by IDs.
func (*HostUpdateOne) Save ¶
func (huo *HostUpdateOne) Save(ctx context.Context) (*Host, error)
Save executes the query and returns the updated Host entity.
func (*HostUpdateOne) SaveX ¶
func (huo *HostUpdateOne) SaveX(ctx context.Context) *Host
SaveX is like Save, but panics if an error occurs.
func (*HostUpdateOne) Select ¶
func (huo *HostUpdateOne) Select(field string, fields ...string) *HostUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*HostUpdateOne) SetCreatedAt ¶
func (huo *HostUpdateOne) SetCreatedAt(t time.Time) *HostUpdateOne
SetCreatedAt sets the "created_at" field.
func (*HostUpdateOne) SetHostname ¶
func (huo *HostUpdateOne) SetHostname(s string) *HostUpdateOne
SetHostname sets the "hostname" field.
func (*HostUpdateOne) SetKernelArch ¶
func (huo *HostUpdateOne) SetKernelArch(s string) *HostUpdateOne
SetKernelArch sets the "kernel_arch" field.
func (*HostUpdateOne) SetKernelVersion ¶
func (huo *HostUpdateOne) SetKernelVersion(s string) *HostUpdateOne
SetKernelVersion sets the "kernel_version" field.
func (*HostUpdateOne) SetNillableCreatedAt ¶
func (huo *HostUpdateOne) SetNillableCreatedAt(t *time.Time) *HostUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*HostUpdateOne) SetNillableUpdatedAt ¶
func (huo *HostUpdateOne) SetNillableUpdatedAt(t *time.Time) *HostUpdateOne
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*HostUpdateOne) SetOs ¶
func (huo *HostUpdateOne) SetOs(s string) *HostUpdateOne
SetOs sets the "os" field.
func (*HostUpdateOne) SetPlatform ¶
func (huo *HostUpdateOne) SetPlatform(s string) *HostUpdateOne
SetPlatform sets the "platform" field.
func (*HostUpdateOne) SetPlatformFamily ¶
func (huo *HostUpdateOne) SetPlatformFamily(s string) *HostUpdateOne
SetPlatformFamily sets the "platform_family" field.
func (*HostUpdateOne) SetPlatformVersion ¶
func (huo *HostUpdateOne) SetPlatformVersion(s string) *HostUpdateOne
SetPlatformVersion sets the "platform_version" field.
func (*HostUpdateOne) SetUpdatedAt ¶
func (huo *HostUpdateOne) SetUpdatedAt(t time.Time) *HostUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*HostUpdateOne) SetVirtualizationRole ¶
func (huo *HostUpdateOne) SetVirtualizationRole(s string) *HostUpdateOne
SetVirtualizationRole sets the "virtualization_role" field.
func (*HostUpdateOne) SetVirtualizationSystem ¶
func (huo *HostUpdateOne) SetVirtualizationSystem(s string) *HostUpdateOne
SetVirtualizationSystem sets the "virtualization_system" field.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type Netstat ¶
type Netstat struct { // ID of the ent. ID int `json:"id,omitempty"` // Addr holds the value of the "addr" field. Addr string `json:"addr,omitempty"` // Port holds the value of the "port" field. Port uint64 `json:"port,omitempty"` // Proto holds the value of the "proto" field. Proto string `json:"proto,omitempty"` // Process holds the value of the "process" field. Process string `json:"process,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,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 NetstatQuery when eager-loading is set. Edges NetstatEdges `json:"edges"` // contains filtered or unexported fields }
Netstat is the model entity for the Netstat schema.
func (*Netstat) QueryHostID ¶
QueryHostID queries the "host_id" edge of the Netstat entity.
func (*Netstat) Unwrap ¶
Unwrap unwraps the Netstat 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 (*Netstat) Update ¶
func (n *Netstat) Update() *NetstatUpdateOne
Update returns a builder for updating this Netstat. Note that you need to call Netstat.Unwrap() before calling this method if this Netstat was returned from a transaction, and the transaction was committed or rolled back.
type NetstatClient ¶
type NetstatClient struct {
// contains filtered or unexported fields
}
NetstatClient is a client for the Netstat schema.
func NewNetstatClient ¶
func NewNetstatClient(c config) *NetstatClient
NewNetstatClient returns a client for the Netstat from the given config.
func (*NetstatClient) Create ¶
func (c *NetstatClient) Create() *NetstatCreate
Create returns a create builder for Netstat.
func (*NetstatClient) CreateBulk ¶
func (c *NetstatClient) CreateBulk(builders ...*NetstatCreate) *NetstatCreateBulk
CreateBulk returns a builder for creating a bulk of Netstat entities.
func (*NetstatClient) Delete ¶
func (c *NetstatClient) Delete() *NetstatDelete
Delete returns a delete builder for Netstat.
func (*NetstatClient) DeleteOne ¶
func (c *NetstatClient) DeleteOne(n *Netstat) *NetstatDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*NetstatClient) DeleteOneID ¶
func (c *NetstatClient) DeleteOneID(id int) *NetstatDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*NetstatClient) GetX ¶
func (c *NetstatClient) GetX(ctx context.Context, id int) *Netstat
GetX is like Get, but panics if an error occurs.
func (*NetstatClient) Hooks ¶
func (c *NetstatClient) Hooks() []Hook
Hooks returns the client hooks.
func (*NetstatClient) Query ¶
func (c *NetstatClient) Query() *NetstatQuery
Query returns a query builder for Netstat.
func (*NetstatClient) QueryHostID ¶
func (c *NetstatClient) QueryHostID(n *Netstat) *HostQuery
QueryHostID queries the host_id edge of a Netstat.
func (*NetstatClient) Update ¶
func (c *NetstatClient) Update() *NetstatUpdate
Update returns an update builder for Netstat.
func (*NetstatClient) UpdateOne ¶
func (c *NetstatClient) UpdateOne(n *Netstat) *NetstatUpdateOne
UpdateOne returns an update builder for the given entity.
func (*NetstatClient) UpdateOneID ¶
func (c *NetstatClient) UpdateOneID(id int) *NetstatUpdateOne
UpdateOneID returns an update builder for the given id.
func (*NetstatClient) Use ¶
func (c *NetstatClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `netstat.Hooks(f(g(h())))`.
type NetstatCreate ¶
type NetstatCreate struct {
// contains filtered or unexported fields
}
NetstatCreate is the builder for creating a Netstat entity.
func (*NetstatCreate) Exec ¶
func (nc *NetstatCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*NetstatCreate) ExecX ¶
func (nc *NetstatCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NetstatCreate) Mutation ¶
func (nc *NetstatCreate) Mutation() *NetstatMutation
Mutation returns the NetstatMutation object of the builder.
func (*NetstatCreate) Save ¶
func (nc *NetstatCreate) Save(ctx context.Context) (*Netstat, error)
Save creates the Netstat in the database.
func (*NetstatCreate) SaveX ¶
func (nc *NetstatCreate) SaveX(ctx context.Context) *Netstat
SaveX calls Save and panics if Save returns an error.
func (*NetstatCreate) SetAddr ¶
func (nc *NetstatCreate) SetAddr(s string) *NetstatCreate
SetAddr sets the "addr" field.
func (*NetstatCreate) SetCreatedAt ¶
func (nc *NetstatCreate) SetCreatedAt(t time.Time) *NetstatCreate
SetCreatedAt sets the "created_at" field.
func (*NetstatCreate) SetHostID ¶
func (nc *NetstatCreate) SetHostID(h *Host) *NetstatCreate
SetHostID sets the "host_id" edge to the Host entity.
func (*NetstatCreate) SetHostIDID ¶
func (nc *NetstatCreate) SetHostIDID(id string) *NetstatCreate
SetHostIDID sets the "host_id" edge to the Host entity by ID.
func (*NetstatCreate) SetNillableCreatedAt ¶
func (nc *NetstatCreate) SetNillableCreatedAt(t *time.Time) *NetstatCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*NetstatCreate) SetNillableUpdatedAt ¶
func (nc *NetstatCreate) SetNillableUpdatedAt(t *time.Time) *NetstatCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*NetstatCreate) SetPort ¶
func (nc *NetstatCreate) SetPort(u uint64) *NetstatCreate
SetPort sets the "port" field.
func (*NetstatCreate) SetProcess ¶
func (nc *NetstatCreate) SetProcess(s string) *NetstatCreate
SetProcess sets the "process" field.
func (*NetstatCreate) SetProto ¶
func (nc *NetstatCreate) SetProto(s string) *NetstatCreate
SetProto sets the "proto" field.
func (*NetstatCreate) SetUpdatedAt ¶
func (nc *NetstatCreate) SetUpdatedAt(t time.Time) *NetstatCreate
SetUpdatedAt sets the "updated_at" field.
type NetstatCreateBulk ¶
type NetstatCreateBulk struct {
// contains filtered or unexported fields
}
NetstatCreateBulk is the builder for creating many Netstat entities in bulk.
func (*NetstatCreateBulk) Exec ¶
func (ncb *NetstatCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*NetstatCreateBulk) ExecX ¶
func (ncb *NetstatCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type NetstatDelete ¶
type NetstatDelete struct {
// contains filtered or unexported fields
}
NetstatDelete is the builder for deleting a Netstat entity.
func (*NetstatDelete) Exec ¶
func (nd *NetstatDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*NetstatDelete) ExecX ¶
func (nd *NetstatDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*NetstatDelete) Where ¶
func (nd *NetstatDelete) Where(ps ...predicate.Netstat) *NetstatDelete
Where appends a list predicates to the NetstatDelete builder.
type NetstatDeleteOne ¶
type NetstatDeleteOne struct {
// contains filtered or unexported fields
}
NetstatDeleteOne is the builder for deleting a single Netstat entity.
func (*NetstatDeleteOne) Exec ¶
func (ndo *NetstatDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*NetstatDeleteOne) ExecX ¶
func (ndo *NetstatDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type NetstatEdges ¶
type NetstatEdges struct { // HostID holds the value of the host_id edge. HostID *Host `json:"host_id,omitempty"` // contains filtered or unexported fields }
NetstatEdges holds the relations/edges for other nodes in the graph.
func (NetstatEdges) HostIDOrErr ¶
func (e NetstatEdges) HostIDOrErr() (*Host, error)
HostIDOrErr returns the HostID value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type NetstatGroupBy ¶
type NetstatGroupBy struct {
// contains filtered or unexported fields
}
NetstatGroupBy is the group-by builder for Netstat entities.
func (*NetstatGroupBy) Aggregate ¶
func (ngb *NetstatGroupBy) Aggregate(fns ...AggregateFunc) *NetstatGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*NetstatGroupBy) Bool ¶
func (ngb *NetstatGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*NetstatGroupBy) BoolX ¶
func (ngb *NetstatGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*NetstatGroupBy) Bools ¶
func (ngb *NetstatGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*NetstatGroupBy) BoolsX ¶
func (ngb *NetstatGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*NetstatGroupBy) Float64 ¶
func (ngb *NetstatGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*NetstatGroupBy) Float64X ¶
func (ngb *NetstatGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*NetstatGroupBy) Float64s ¶
func (ngb *NetstatGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*NetstatGroupBy) Float64sX ¶
func (ngb *NetstatGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*NetstatGroupBy) Int ¶
func (ngb *NetstatGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*NetstatGroupBy) IntX ¶
func (ngb *NetstatGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*NetstatGroupBy) Ints ¶
func (ngb *NetstatGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*NetstatGroupBy) IntsX ¶
func (ngb *NetstatGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*NetstatGroupBy) Scan ¶
func (ngb *NetstatGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*NetstatGroupBy) ScanX ¶
func (ngb *NetstatGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*NetstatGroupBy) String ¶
func (ngb *NetstatGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*NetstatGroupBy) StringX ¶
func (ngb *NetstatGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type NetstatMutation ¶
type NetstatMutation struct {
// contains filtered or unexported fields
}
NetstatMutation represents an operation that mutates the Netstat nodes in the graph.
func (*NetstatMutation) AddField ¶
func (m *NetstatMutation) 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 (*NetstatMutation) AddPort ¶
func (m *NetstatMutation) AddPort(u int64)
AddPort adds u to the "port" field.
func (*NetstatMutation) AddedEdges ¶
func (m *NetstatMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*NetstatMutation) AddedField ¶
func (m *NetstatMutation) 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 (*NetstatMutation) AddedFields ¶
func (m *NetstatMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*NetstatMutation) AddedIDs ¶
func (m *NetstatMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*NetstatMutation) AddedPort ¶
func (m *NetstatMutation) AddedPort() (r int64, exists bool)
AddedPort returns the value that was added to the "port" field in this mutation.
func (*NetstatMutation) Addr ¶
func (m *NetstatMutation) Addr() (r string, exists bool)
Addr returns the value of the "addr" field in the mutation.
func (*NetstatMutation) ClearEdge ¶
func (m *NetstatMutation) 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 (*NetstatMutation) ClearField ¶
func (m *NetstatMutation) 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 (*NetstatMutation) ClearHostID ¶
func (m *NetstatMutation) ClearHostID()
ClearHostID clears the "host_id" edge to the Host entity.
func (*NetstatMutation) ClearedEdges ¶
func (m *NetstatMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*NetstatMutation) ClearedFields ¶
func (m *NetstatMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (NetstatMutation) Client ¶
func (m NetstatMutation) 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 (*NetstatMutation) CreatedAt ¶
func (m *NetstatMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*NetstatMutation) EdgeCleared ¶
func (m *NetstatMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*NetstatMutation) Field ¶
func (m *NetstatMutation) 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 (*NetstatMutation) FieldCleared ¶
func (m *NetstatMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*NetstatMutation) Fields ¶
func (m *NetstatMutation) 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 (*NetstatMutation) HostIDCleared ¶
func (m *NetstatMutation) HostIDCleared() bool
HostIDCleared reports if the "host_id" edge to the Host entity was cleared.
func (*NetstatMutation) HostIDID ¶
func (m *NetstatMutation) HostIDID() (id string, exists bool)
HostIDID returns the "host_id" edge ID in the mutation.
func (*NetstatMutation) HostIDIDs ¶
func (m *NetstatMutation) HostIDIDs() (ids []string)
HostIDIDs returns the "host_id" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use HostIDID instead. It exists only for internal usage by the builders.
func (*NetstatMutation) ID ¶
func (m *NetstatMutation) 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 (*NetstatMutation) IDs ¶
func (m *NetstatMutation) 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 (*NetstatMutation) OldAddr ¶
func (m *NetstatMutation) OldAddr(ctx context.Context) (v string, err error)
OldAddr returns the old "addr" field's value of the Netstat entity. If the Netstat 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 (*NetstatMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Netstat entity. If the Netstat 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 (*NetstatMutation) 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 (*NetstatMutation) OldPort ¶
func (m *NetstatMutation) OldPort(ctx context.Context) (v uint64, err error)
OldPort returns the old "port" field's value of the Netstat entity. If the Netstat 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 (*NetstatMutation) OldProcess ¶
func (m *NetstatMutation) OldProcess(ctx context.Context) (v string, err error)
OldProcess returns the old "process" field's value of the Netstat entity. If the Netstat 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 (*NetstatMutation) OldProto ¶
func (m *NetstatMutation) OldProto(ctx context.Context) (v string, err error)
OldProto returns the old "proto" field's value of the Netstat entity. If the Netstat 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 (*NetstatMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Netstat entity. If the Netstat 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 (*NetstatMutation) Port ¶
func (m *NetstatMutation) Port() (r uint64, exists bool)
Port returns the value of the "port" field in the mutation.
func (*NetstatMutation) Process ¶
func (m *NetstatMutation) Process() (r string, exists bool)
Process returns the value of the "process" field in the mutation.
func (*NetstatMutation) Proto ¶
func (m *NetstatMutation) Proto() (r string, exists bool)
Proto returns the value of the "proto" field in the mutation.
func (*NetstatMutation) RemovedEdges ¶
func (m *NetstatMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*NetstatMutation) RemovedIDs ¶
func (m *NetstatMutation) 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 (*NetstatMutation) ResetAddr ¶
func (m *NetstatMutation) ResetAddr()
ResetAddr resets all changes to the "addr" field.
func (*NetstatMutation) ResetCreatedAt ¶
func (m *NetstatMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*NetstatMutation) ResetEdge ¶
func (m *NetstatMutation) 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 (*NetstatMutation) ResetField ¶
func (m *NetstatMutation) 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 (*NetstatMutation) ResetHostID ¶
func (m *NetstatMutation) ResetHostID()
ResetHostID resets all changes to the "host_id" edge.
func (*NetstatMutation) ResetPort ¶
func (m *NetstatMutation) ResetPort()
ResetPort resets all changes to the "port" field.
func (*NetstatMutation) ResetProcess ¶
func (m *NetstatMutation) ResetProcess()
ResetProcess resets all changes to the "process" field.
func (*NetstatMutation) ResetProto ¶
func (m *NetstatMutation) ResetProto()
ResetProto resets all changes to the "proto" field.
func (*NetstatMutation) ResetUpdatedAt ¶
func (m *NetstatMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*NetstatMutation) SetAddr ¶
func (m *NetstatMutation) SetAddr(s string)
SetAddr sets the "addr" field.
func (*NetstatMutation) SetCreatedAt ¶
func (m *NetstatMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*NetstatMutation) SetField ¶
func (m *NetstatMutation) 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 (*NetstatMutation) SetHostIDID ¶
func (m *NetstatMutation) SetHostIDID(id string)
SetHostIDID sets the "host_id" edge to the Host entity by id.
func (*NetstatMutation) SetPort ¶
func (m *NetstatMutation) SetPort(u uint64)
SetPort sets the "port" field.
func (*NetstatMutation) SetProcess ¶
func (m *NetstatMutation) SetProcess(s string)
SetProcess sets the "process" field.
func (*NetstatMutation) SetProto ¶
func (m *NetstatMutation) SetProto(s string)
SetProto sets the "proto" field.
func (*NetstatMutation) SetUpdatedAt ¶
func (m *NetstatMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (NetstatMutation) Tx ¶
func (m NetstatMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*NetstatMutation) Type ¶
func (m *NetstatMutation) Type() string
Type returns the node type of this mutation (Netstat).
func (*NetstatMutation) UpdatedAt ¶
func (m *NetstatMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*NetstatMutation) Where ¶
func (m *NetstatMutation) Where(ps ...predicate.Netstat)
Where appends a list predicates to the NetstatMutation builder.
type NetstatQuery ¶
type NetstatQuery struct {
// contains filtered or unexported fields
}
NetstatQuery is the builder for querying Netstat entities.
func (*NetstatQuery) All ¶
func (nq *NetstatQuery) All(ctx context.Context) ([]*Netstat, error)
All executes the query and returns a list of Netstats.
func (*NetstatQuery) AllX ¶
func (nq *NetstatQuery) AllX(ctx context.Context) []*Netstat
AllX is like All, but panics if an error occurs.
func (*NetstatQuery) Clone ¶
func (nq *NetstatQuery) Clone() *NetstatQuery
Clone returns a duplicate of the NetstatQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*NetstatQuery) Count ¶
func (nq *NetstatQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*NetstatQuery) CountX ¶
func (nq *NetstatQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*NetstatQuery) Exist ¶
func (nq *NetstatQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*NetstatQuery) ExistX ¶
func (nq *NetstatQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*NetstatQuery) First ¶
func (nq *NetstatQuery) First(ctx context.Context) (*Netstat, error)
First returns the first Netstat entity from the query. Returns a *NotFoundError when no Netstat was found.
func (*NetstatQuery) FirstID ¶
func (nq *NetstatQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Netstat ID from the query. Returns a *NotFoundError when no Netstat ID was found.
func (*NetstatQuery) FirstIDX ¶
func (nq *NetstatQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*NetstatQuery) FirstX ¶
func (nq *NetstatQuery) FirstX(ctx context.Context) *Netstat
FirstX is like First, but panics if an error occurs.
func (*NetstatQuery) GroupBy ¶
func (nq *NetstatQuery) GroupBy(field string, fields ...string) *NetstatGroupBy
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 { Addr string `json:"addr,omitempty"` Count int `json:"count,omitempty"` } client.Netstat.Query(). GroupBy(netstat.FieldAddr). Aggregate(ent.Count()). Scan(ctx, &v)
func (*NetstatQuery) IDs ¶
func (nq *NetstatQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of Netstat IDs.
func (*NetstatQuery) IDsX ¶
func (nq *NetstatQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*NetstatQuery) Limit ¶
func (nq *NetstatQuery) Limit(limit int) *NetstatQuery
Limit adds a limit step to the query.
func (*NetstatQuery) Offset ¶
func (nq *NetstatQuery) Offset(offset int) *NetstatQuery
Offset adds an offset step to the query.
func (*NetstatQuery) Only ¶
func (nq *NetstatQuery) Only(ctx context.Context) (*Netstat, error)
Only returns a single Netstat entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Netstat entity is found. Returns a *NotFoundError when no Netstat entities are found.
func (*NetstatQuery) OnlyID ¶
func (nq *NetstatQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Netstat ID in the query. Returns a *NotSingularError when more than one Netstat ID is found. Returns a *NotFoundError when no entities are found.
func (*NetstatQuery) OnlyIDX ¶
func (nq *NetstatQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*NetstatQuery) OnlyX ¶
func (nq *NetstatQuery) OnlyX(ctx context.Context) *Netstat
OnlyX is like Only, but panics if an error occurs.
func (*NetstatQuery) Order ¶
func (nq *NetstatQuery) Order(o ...OrderFunc) *NetstatQuery
Order adds an order step to the query.
func (*NetstatQuery) QueryHostID ¶
func (nq *NetstatQuery) QueryHostID() *HostQuery
QueryHostID chains the current query on the "host_id" edge.
func (*NetstatQuery) Select ¶
func (nq *NetstatQuery) Select(fields ...string) *NetstatSelect
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 { Addr string `json:"addr,omitempty"` } client.Netstat.Query(). Select(netstat.FieldAddr). Scan(ctx, &v)
func (*NetstatQuery) Unique ¶
func (nq *NetstatQuery) Unique(unique bool) *NetstatQuery
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 (*NetstatQuery) Where ¶
func (nq *NetstatQuery) Where(ps ...predicate.Netstat) *NetstatQuery
Where adds a new predicate for the NetstatQuery builder.
func (*NetstatQuery) WithHostID ¶
func (nq *NetstatQuery) WithHostID(opts ...func(*HostQuery)) *NetstatQuery
WithHostID tells the query-builder to eager-load the nodes that are connected to the "host_id" edge. The optional arguments are used to configure the query builder of the edge.
type NetstatSelect ¶
type NetstatSelect struct { *NetstatQuery // contains filtered or unexported fields }
NetstatSelect is the builder for selecting fields of Netstat entities.
func (*NetstatSelect) Bool ¶
func (ns *NetstatSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*NetstatSelect) BoolX ¶
func (ns *NetstatSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*NetstatSelect) Bools ¶
func (ns *NetstatSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*NetstatSelect) BoolsX ¶
func (ns *NetstatSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*NetstatSelect) Float64 ¶
func (ns *NetstatSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*NetstatSelect) Float64X ¶
func (ns *NetstatSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*NetstatSelect) Float64s ¶
func (ns *NetstatSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*NetstatSelect) Float64sX ¶
func (ns *NetstatSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*NetstatSelect) Int ¶
func (ns *NetstatSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*NetstatSelect) IntX ¶
func (ns *NetstatSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*NetstatSelect) Ints ¶
func (ns *NetstatSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*NetstatSelect) IntsX ¶
func (ns *NetstatSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*NetstatSelect) Scan ¶
func (ns *NetstatSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*NetstatSelect) ScanX ¶
func (ns *NetstatSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*NetstatSelect) String ¶
func (ns *NetstatSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*NetstatSelect) StringX ¶
func (ns *NetstatSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type NetstatUpdate ¶
type NetstatUpdate struct {
// contains filtered or unexported fields
}
NetstatUpdate is the builder for updating Netstat entities.
func (*NetstatUpdate) AddPort ¶
func (nu *NetstatUpdate) AddPort(u int64) *NetstatUpdate
AddPort adds u to the "port" field.
func (*NetstatUpdate) ClearHostID ¶
func (nu *NetstatUpdate) ClearHostID() *NetstatUpdate
ClearHostID clears the "host_id" edge to the Host entity.
func (*NetstatUpdate) Exec ¶
func (nu *NetstatUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*NetstatUpdate) ExecX ¶
func (nu *NetstatUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NetstatUpdate) Mutation ¶
func (nu *NetstatUpdate) Mutation() *NetstatMutation
Mutation returns the NetstatMutation object of the builder.
func (*NetstatUpdate) Save ¶
func (nu *NetstatUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*NetstatUpdate) SaveX ¶
func (nu *NetstatUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*NetstatUpdate) SetAddr ¶
func (nu *NetstatUpdate) SetAddr(s string) *NetstatUpdate
SetAddr sets the "addr" field.
func (*NetstatUpdate) SetCreatedAt ¶
func (nu *NetstatUpdate) SetCreatedAt(t time.Time) *NetstatUpdate
SetCreatedAt sets the "created_at" field.
func (*NetstatUpdate) SetHostID ¶
func (nu *NetstatUpdate) SetHostID(h *Host) *NetstatUpdate
SetHostID sets the "host_id" edge to the Host entity.
func (*NetstatUpdate) SetHostIDID ¶
func (nu *NetstatUpdate) SetHostIDID(id string) *NetstatUpdate
SetHostIDID sets the "host_id" edge to the Host entity by ID.
func (*NetstatUpdate) SetNillableCreatedAt ¶
func (nu *NetstatUpdate) SetNillableCreatedAt(t *time.Time) *NetstatUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*NetstatUpdate) SetNillableUpdatedAt ¶
func (nu *NetstatUpdate) SetNillableUpdatedAt(t *time.Time) *NetstatUpdate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*NetstatUpdate) SetPort ¶
func (nu *NetstatUpdate) SetPort(u uint64) *NetstatUpdate
SetPort sets the "port" field.
func (*NetstatUpdate) SetProcess ¶
func (nu *NetstatUpdate) SetProcess(s string) *NetstatUpdate
SetProcess sets the "process" field.
func (*NetstatUpdate) SetProto ¶
func (nu *NetstatUpdate) SetProto(s string) *NetstatUpdate
SetProto sets the "proto" field.
func (*NetstatUpdate) SetUpdatedAt ¶
func (nu *NetstatUpdate) SetUpdatedAt(t time.Time) *NetstatUpdate
SetUpdatedAt sets the "updated_at" field.
func (*NetstatUpdate) Where ¶
func (nu *NetstatUpdate) Where(ps ...predicate.Netstat) *NetstatUpdate
Where appends a list predicates to the NetstatUpdate builder.
type NetstatUpdateOne ¶
type NetstatUpdateOne struct {
// contains filtered or unexported fields
}
NetstatUpdateOne is the builder for updating a single Netstat entity.
func (*NetstatUpdateOne) AddPort ¶
func (nuo *NetstatUpdateOne) AddPort(u int64) *NetstatUpdateOne
AddPort adds u to the "port" field.
func (*NetstatUpdateOne) ClearHostID ¶
func (nuo *NetstatUpdateOne) ClearHostID() *NetstatUpdateOne
ClearHostID clears the "host_id" edge to the Host entity.
func (*NetstatUpdateOne) Exec ¶
func (nuo *NetstatUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*NetstatUpdateOne) ExecX ¶
func (nuo *NetstatUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NetstatUpdateOne) Mutation ¶
func (nuo *NetstatUpdateOne) Mutation() *NetstatMutation
Mutation returns the NetstatMutation object of the builder.
func (*NetstatUpdateOne) Save ¶
func (nuo *NetstatUpdateOne) Save(ctx context.Context) (*Netstat, error)
Save executes the query and returns the updated Netstat entity.
func (*NetstatUpdateOne) SaveX ¶
func (nuo *NetstatUpdateOne) SaveX(ctx context.Context) *Netstat
SaveX is like Save, but panics if an error occurs.
func (*NetstatUpdateOne) Select ¶
func (nuo *NetstatUpdateOne) Select(field string, fields ...string) *NetstatUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*NetstatUpdateOne) SetAddr ¶
func (nuo *NetstatUpdateOne) SetAddr(s string) *NetstatUpdateOne
SetAddr sets the "addr" field.
func (*NetstatUpdateOne) SetCreatedAt ¶
func (nuo *NetstatUpdateOne) SetCreatedAt(t time.Time) *NetstatUpdateOne
SetCreatedAt sets the "created_at" field.
func (*NetstatUpdateOne) SetHostID ¶
func (nuo *NetstatUpdateOne) SetHostID(h *Host) *NetstatUpdateOne
SetHostID sets the "host_id" edge to the Host entity.
func (*NetstatUpdateOne) SetHostIDID ¶
func (nuo *NetstatUpdateOne) SetHostIDID(id string) *NetstatUpdateOne
SetHostIDID sets the "host_id" edge to the Host entity by ID.
func (*NetstatUpdateOne) SetNillableCreatedAt ¶
func (nuo *NetstatUpdateOne) SetNillableCreatedAt(t *time.Time) *NetstatUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*NetstatUpdateOne) SetNillableUpdatedAt ¶
func (nuo *NetstatUpdateOne) SetNillableUpdatedAt(t *time.Time) *NetstatUpdateOne
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*NetstatUpdateOne) SetPort ¶
func (nuo *NetstatUpdateOne) SetPort(u uint64) *NetstatUpdateOne
SetPort sets the "port" field.
func (*NetstatUpdateOne) SetProcess ¶
func (nuo *NetstatUpdateOne) SetProcess(s string) *NetstatUpdateOne
SetProcess sets the "process" field.
func (*NetstatUpdateOne) SetProto ¶
func (nuo *NetstatUpdateOne) SetProto(s string) *NetstatUpdateOne
SetProto sets the "proto" field.
func (*NetstatUpdateOne) SetUpdatedAt ¶
func (nuo *NetstatUpdateOne) SetUpdatedAt(t time.Time) *NetstatUpdateOne
SetUpdatedAt sets the "updated_at" field.
type Network ¶
type Network struct { // ID of the ent. ID int `json:"id,omitempty"` // Index holds the value of the "Index" field. Index int `json:"Index,omitempty"` // MTU holds the value of the "MTU" field. MTU int `json:"MTU,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // HardwareAddr holds the value of the "HardwareAddr" field. HardwareAddr string `json:"HardwareAddr,omitempty"` // Flags holds the value of the "Flags" field. Flags []string `json:"Flags,omitempty"` // Addrs holds the value of the "addrs" field. Addrs []string `json:"addrs,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,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 NetworkQuery when eager-loading is set. Edges NetworkEdges `json:"edges"` // contains filtered or unexported fields }
Network is the model entity for the Network schema.
func (*Network) QueryHostID ¶
QueryHostID queries the "host_id" edge of the Network entity.
func (*Network) Unwrap ¶
Unwrap unwraps the Network 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 (*Network) Update ¶
func (n *Network) Update() *NetworkUpdateOne
Update returns a builder for updating this Network. Note that you need to call Network.Unwrap() before calling this method if this Network was returned from a transaction, and the transaction was committed or rolled back.
type NetworkClient ¶
type NetworkClient struct {
// contains filtered or unexported fields
}
NetworkClient is a client for the Network schema.
func NewNetworkClient ¶
func NewNetworkClient(c config) *NetworkClient
NewNetworkClient returns a client for the Network from the given config.
func (*NetworkClient) Create ¶
func (c *NetworkClient) Create() *NetworkCreate
Create returns a create builder for Network.
func (*NetworkClient) CreateBulk ¶
func (c *NetworkClient) CreateBulk(builders ...*NetworkCreate) *NetworkCreateBulk
CreateBulk returns a builder for creating a bulk of Network entities.
func (*NetworkClient) Delete ¶
func (c *NetworkClient) Delete() *NetworkDelete
Delete returns a delete builder for Network.
func (*NetworkClient) DeleteOne ¶
func (c *NetworkClient) DeleteOne(n *Network) *NetworkDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*NetworkClient) DeleteOneID ¶
func (c *NetworkClient) DeleteOneID(id int) *NetworkDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*NetworkClient) GetX ¶
func (c *NetworkClient) GetX(ctx context.Context, id int) *Network
GetX is like Get, but panics if an error occurs.
func (*NetworkClient) Hooks ¶
func (c *NetworkClient) Hooks() []Hook
Hooks returns the client hooks.
func (*NetworkClient) Query ¶
func (c *NetworkClient) Query() *NetworkQuery
Query returns a query builder for Network.
func (*NetworkClient) QueryHostID ¶
func (c *NetworkClient) QueryHostID(n *Network) *HostQuery
QueryHostID queries the host_id edge of a Network.
func (*NetworkClient) Update ¶
func (c *NetworkClient) Update() *NetworkUpdate
Update returns an update builder for Network.
func (*NetworkClient) UpdateOne ¶
func (c *NetworkClient) UpdateOne(n *Network) *NetworkUpdateOne
UpdateOne returns an update builder for the given entity.
func (*NetworkClient) UpdateOneID ¶
func (c *NetworkClient) UpdateOneID(id int) *NetworkUpdateOne
UpdateOneID returns an update builder for the given id.
func (*NetworkClient) Use ¶
func (c *NetworkClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `network.Hooks(f(g(h())))`.
type NetworkCreate ¶
type NetworkCreate struct {
// contains filtered or unexported fields
}
NetworkCreate is the builder for creating a Network entity.
func (*NetworkCreate) Exec ¶
func (nc *NetworkCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*NetworkCreate) ExecX ¶
func (nc *NetworkCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NetworkCreate) Mutation ¶
func (nc *NetworkCreate) Mutation() *NetworkMutation
Mutation returns the NetworkMutation object of the builder.
func (*NetworkCreate) Save ¶
func (nc *NetworkCreate) Save(ctx context.Context) (*Network, error)
Save creates the Network in the database.
func (*NetworkCreate) SaveX ¶
func (nc *NetworkCreate) SaveX(ctx context.Context) *Network
SaveX calls Save and panics if Save returns an error.
func (*NetworkCreate) SetAddrs ¶
func (nc *NetworkCreate) SetAddrs(s []string) *NetworkCreate
SetAddrs sets the "addrs" field.
func (*NetworkCreate) SetCreatedAt ¶
func (nc *NetworkCreate) SetCreatedAt(t time.Time) *NetworkCreate
SetCreatedAt sets the "created_at" field.
func (*NetworkCreate) SetFlags ¶
func (nc *NetworkCreate) SetFlags(s []string) *NetworkCreate
SetFlags sets the "Flags" field.
func (*NetworkCreate) SetHardwareAddr ¶
func (nc *NetworkCreate) SetHardwareAddr(s string) *NetworkCreate
SetHardwareAddr sets the "HardwareAddr" field.
func (*NetworkCreate) SetHostID ¶
func (nc *NetworkCreate) SetHostID(h *Host) *NetworkCreate
SetHostID sets the "host_id" edge to the Host entity.
func (*NetworkCreate) SetHostIDID ¶
func (nc *NetworkCreate) SetHostIDID(id string) *NetworkCreate
SetHostIDID sets the "host_id" edge to the Host entity by ID.
func (*NetworkCreate) SetIndex ¶
func (nc *NetworkCreate) SetIndex(i int) *NetworkCreate
SetIndex sets the "Index" field.
func (*NetworkCreate) SetMTU ¶
func (nc *NetworkCreate) SetMTU(i int) *NetworkCreate
SetMTU sets the "MTU" field.
func (*NetworkCreate) SetName ¶
func (nc *NetworkCreate) SetName(s string) *NetworkCreate
SetName sets the "name" field.
func (*NetworkCreate) SetNillableCreatedAt ¶
func (nc *NetworkCreate) SetNillableCreatedAt(t *time.Time) *NetworkCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*NetworkCreate) SetNillableUpdatedAt ¶
func (nc *NetworkCreate) SetNillableUpdatedAt(t *time.Time) *NetworkCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*NetworkCreate) SetUpdatedAt ¶
func (nc *NetworkCreate) SetUpdatedAt(t time.Time) *NetworkCreate
SetUpdatedAt sets the "updated_at" field.
type NetworkCreateBulk ¶
type NetworkCreateBulk struct {
// contains filtered or unexported fields
}
NetworkCreateBulk is the builder for creating many Network entities in bulk.
func (*NetworkCreateBulk) Exec ¶
func (ncb *NetworkCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*NetworkCreateBulk) ExecX ¶
func (ncb *NetworkCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type NetworkDelete ¶
type NetworkDelete struct {
// contains filtered or unexported fields
}
NetworkDelete is the builder for deleting a Network entity.
func (*NetworkDelete) Exec ¶
func (nd *NetworkDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*NetworkDelete) ExecX ¶
func (nd *NetworkDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*NetworkDelete) Where ¶
func (nd *NetworkDelete) Where(ps ...predicate.Network) *NetworkDelete
Where appends a list predicates to the NetworkDelete builder.
type NetworkDeleteOne ¶
type NetworkDeleteOne struct {
// contains filtered or unexported fields
}
NetworkDeleteOne is the builder for deleting a single Network entity.
func (*NetworkDeleteOne) Exec ¶
func (ndo *NetworkDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*NetworkDeleteOne) ExecX ¶
func (ndo *NetworkDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type NetworkEdges ¶
type NetworkEdges struct { // HostID holds the value of the host_id edge. HostID *Host `json:"host_id,omitempty"` // contains filtered or unexported fields }
NetworkEdges holds the relations/edges for other nodes in the graph.
func (NetworkEdges) HostIDOrErr ¶
func (e NetworkEdges) HostIDOrErr() (*Host, error)
HostIDOrErr returns the HostID value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type NetworkGroupBy ¶
type NetworkGroupBy struct {
// contains filtered or unexported fields
}
NetworkGroupBy is the group-by builder for Network entities.
func (*NetworkGroupBy) Aggregate ¶
func (ngb *NetworkGroupBy) Aggregate(fns ...AggregateFunc) *NetworkGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*NetworkGroupBy) Bool ¶
func (ngb *NetworkGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*NetworkGroupBy) BoolX ¶
func (ngb *NetworkGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*NetworkGroupBy) Bools ¶
func (ngb *NetworkGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*NetworkGroupBy) BoolsX ¶
func (ngb *NetworkGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*NetworkGroupBy) Float64 ¶
func (ngb *NetworkGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*NetworkGroupBy) Float64X ¶
func (ngb *NetworkGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*NetworkGroupBy) Float64s ¶
func (ngb *NetworkGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*NetworkGroupBy) Float64sX ¶
func (ngb *NetworkGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*NetworkGroupBy) Int ¶
func (ngb *NetworkGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*NetworkGroupBy) IntX ¶
func (ngb *NetworkGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*NetworkGroupBy) Ints ¶
func (ngb *NetworkGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*NetworkGroupBy) IntsX ¶
func (ngb *NetworkGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*NetworkGroupBy) Scan ¶
func (ngb *NetworkGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*NetworkGroupBy) ScanX ¶
func (ngb *NetworkGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*NetworkGroupBy) String ¶
func (ngb *NetworkGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*NetworkGroupBy) StringX ¶
func (ngb *NetworkGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type NetworkMutation ¶
type NetworkMutation struct {
// contains filtered or unexported fields
}
NetworkMutation represents an operation that mutates the Network nodes in the graph.
func (*NetworkMutation) AddField ¶
func (m *NetworkMutation) 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 (*NetworkMutation) AddIndex ¶
func (m *NetworkMutation) AddIndex(i int)
AddIndex adds i to the "Index" field.
func (*NetworkMutation) AddMTU ¶
func (m *NetworkMutation) AddMTU(i int)
AddMTU adds i to the "MTU" field.
func (*NetworkMutation) AddedEdges ¶
func (m *NetworkMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*NetworkMutation) AddedField ¶
func (m *NetworkMutation) 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 (*NetworkMutation) AddedFields ¶
func (m *NetworkMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*NetworkMutation) AddedIDs ¶
func (m *NetworkMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*NetworkMutation) AddedIndex ¶
func (m *NetworkMutation) AddedIndex() (r int, exists bool)
AddedIndex returns the value that was added to the "Index" field in this mutation.
func (*NetworkMutation) AddedMTU ¶
func (m *NetworkMutation) AddedMTU() (r int, exists bool)
AddedMTU returns the value that was added to the "MTU" field in this mutation.
func (*NetworkMutation) Addrs ¶
func (m *NetworkMutation) Addrs() (r []string, exists bool)
Addrs returns the value of the "addrs" field in the mutation.
func (*NetworkMutation) AddrsCleared ¶
func (m *NetworkMutation) AddrsCleared() bool
AddrsCleared returns if the "addrs" field was cleared in this mutation.
func (*NetworkMutation) ClearAddrs ¶
func (m *NetworkMutation) ClearAddrs()
ClearAddrs clears the value of the "addrs" field.
func (*NetworkMutation) ClearEdge ¶
func (m *NetworkMutation) 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 (*NetworkMutation) ClearField ¶
func (m *NetworkMutation) 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 (*NetworkMutation) ClearFlags ¶
func (m *NetworkMutation) ClearFlags()
ClearFlags clears the value of the "Flags" field.
func (*NetworkMutation) ClearHostID ¶
func (m *NetworkMutation) ClearHostID()
ClearHostID clears the "host_id" edge to the Host entity.
func (*NetworkMutation) ClearedEdges ¶
func (m *NetworkMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*NetworkMutation) ClearedFields ¶
func (m *NetworkMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (NetworkMutation) Client ¶
func (m NetworkMutation) 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 (*NetworkMutation) CreatedAt ¶
func (m *NetworkMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*NetworkMutation) EdgeCleared ¶
func (m *NetworkMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*NetworkMutation) Field ¶
func (m *NetworkMutation) 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 (*NetworkMutation) FieldCleared ¶
func (m *NetworkMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*NetworkMutation) Fields ¶
func (m *NetworkMutation) 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 (*NetworkMutation) Flags ¶
func (m *NetworkMutation) Flags() (r []string, exists bool)
Flags returns the value of the "Flags" field in the mutation.
func (*NetworkMutation) FlagsCleared ¶
func (m *NetworkMutation) FlagsCleared() bool
FlagsCleared returns if the "Flags" field was cleared in this mutation.
func (*NetworkMutation) HardwareAddr ¶
func (m *NetworkMutation) HardwareAddr() (r string, exists bool)
HardwareAddr returns the value of the "HardwareAddr" field in the mutation.
func (*NetworkMutation) HostIDCleared ¶
func (m *NetworkMutation) HostIDCleared() bool
HostIDCleared reports if the "host_id" edge to the Host entity was cleared.
func (*NetworkMutation) HostIDID ¶
func (m *NetworkMutation) HostIDID() (id string, exists bool)
HostIDID returns the "host_id" edge ID in the mutation.
func (*NetworkMutation) HostIDIDs ¶
func (m *NetworkMutation) HostIDIDs() (ids []string)
HostIDIDs returns the "host_id" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use HostIDID instead. It exists only for internal usage by the builders.
func (*NetworkMutation) ID ¶
func (m *NetworkMutation) 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 (*NetworkMutation) IDs ¶
func (m *NetworkMutation) 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 (*NetworkMutation) Index ¶
func (m *NetworkMutation) Index() (r int, exists bool)
Index returns the value of the "Index" field in the mutation.
func (*NetworkMutation) MTU ¶
func (m *NetworkMutation) MTU() (r int, exists bool)
MTU returns the value of the "MTU" field in the mutation.
func (*NetworkMutation) Name ¶
func (m *NetworkMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*NetworkMutation) OldAddrs ¶
func (m *NetworkMutation) OldAddrs(ctx context.Context) (v []string, err error)
OldAddrs returns the old "addrs" field's value of the Network entity. If the Network 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 (*NetworkMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Network entity. If the Network 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 (*NetworkMutation) 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 (*NetworkMutation) OldFlags ¶
func (m *NetworkMutation) OldFlags(ctx context.Context) (v []string, err error)
OldFlags returns the old "Flags" field's value of the Network entity. If the Network 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 (*NetworkMutation) OldHardwareAddr ¶
func (m *NetworkMutation) OldHardwareAddr(ctx context.Context) (v string, err error)
OldHardwareAddr returns the old "HardwareAddr" field's value of the Network entity. If the Network 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 (*NetworkMutation) OldIndex ¶
func (m *NetworkMutation) OldIndex(ctx context.Context) (v int, err error)
OldIndex returns the old "Index" field's value of the Network entity. If the Network 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 (*NetworkMutation) OldMTU ¶
func (m *NetworkMutation) OldMTU(ctx context.Context) (v int, err error)
OldMTU returns the old "MTU" field's value of the Network entity. If the Network 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 (*NetworkMutation) OldName ¶
func (m *NetworkMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Network entity. If the Network 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 (*NetworkMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Network entity. If the Network 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 (*NetworkMutation) RemovedEdges ¶
func (m *NetworkMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*NetworkMutation) RemovedIDs ¶
func (m *NetworkMutation) 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 (*NetworkMutation) ResetAddrs ¶
func (m *NetworkMutation) ResetAddrs()
ResetAddrs resets all changes to the "addrs" field.
func (*NetworkMutation) ResetCreatedAt ¶
func (m *NetworkMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*NetworkMutation) ResetEdge ¶
func (m *NetworkMutation) 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 (*NetworkMutation) ResetField ¶
func (m *NetworkMutation) 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 (*NetworkMutation) ResetFlags ¶
func (m *NetworkMutation) ResetFlags()
ResetFlags resets all changes to the "Flags" field.
func (*NetworkMutation) ResetHardwareAddr ¶
func (m *NetworkMutation) ResetHardwareAddr()
ResetHardwareAddr resets all changes to the "HardwareAddr" field.
func (*NetworkMutation) ResetHostID ¶
func (m *NetworkMutation) ResetHostID()
ResetHostID resets all changes to the "host_id" edge.
func (*NetworkMutation) ResetIndex ¶
func (m *NetworkMutation) ResetIndex()
ResetIndex resets all changes to the "Index" field.
func (*NetworkMutation) ResetMTU ¶
func (m *NetworkMutation) ResetMTU()
ResetMTU resets all changes to the "MTU" field.
func (*NetworkMutation) ResetName ¶
func (m *NetworkMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*NetworkMutation) ResetUpdatedAt ¶
func (m *NetworkMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*NetworkMutation) SetAddrs ¶
func (m *NetworkMutation) SetAddrs(s []string)
SetAddrs sets the "addrs" field.
func (*NetworkMutation) SetCreatedAt ¶
func (m *NetworkMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*NetworkMutation) SetField ¶
func (m *NetworkMutation) 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 (*NetworkMutation) SetFlags ¶
func (m *NetworkMutation) SetFlags(s []string)
SetFlags sets the "Flags" field.
func (*NetworkMutation) SetHardwareAddr ¶
func (m *NetworkMutation) SetHardwareAddr(s string)
SetHardwareAddr sets the "HardwareAddr" field.
func (*NetworkMutation) SetHostIDID ¶
func (m *NetworkMutation) SetHostIDID(id string)
SetHostIDID sets the "host_id" edge to the Host entity by id.
func (*NetworkMutation) SetIndex ¶
func (m *NetworkMutation) SetIndex(i int)
SetIndex sets the "Index" field.
func (*NetworkMutation) SetMTU ¶
func (m *NetworkMutation) SetMTU(i int)
SetMTU sets the "MTU" field.
func (*NetworkMutation) SetName ¶
func (m *NetworkMutation) SetName(s string)
SetName sets the "name" field.
func (*NetworkMutation) SetUpdatedAt ¶
func (m *NetworkMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (NetworkMutation) Tx ¶
func (m NetworkMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*NetworkMutation) Type ¶
func (m *NetworkMutation) Type() string
Type returns the node type of this mutation (Network).
func (*NetworkMutation) UpdatedAt ¶
func (m *NetworkMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*NetworkMutation) Where ¶
func (m *NetworkMutation) Where(ps ...predicate.Network)
Where appends a list predicates to the NetworkMutation builder.
type NetworkQuery ¶
type NetworkQuery struct {
// contains filtered or unexported fields
}
NetworkQuery is the builder for querying Network entities.
func (*NetworkQuery) All ¶
func (nq *NetworkQuery) All(ctx context.Context) ([]*Network, error)
All executes the query and returns a list of Networks.
func (*NetworkQuery) AllX ¶
func (nq *NetworkQuery) AllX(ctx context.Context) []*Network
AllX is like All, but panics if an error occurs.
func (*NetworkQuery) Clone ¶
func (nq *NetworkQuery) Clone() *NetworkQuery
Clone returns a duplicate of the NetworkQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*NetworkQuery) Count ¶
func (nq *NetworkQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*NetworkQuery) CountX ¶
func (nq *NetworkQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*NetworkQuery) Exist ¶
func (nq *NetworkQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*NetworkQuery) ExistX ¶
func (nq *NetworkQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*NetworkQuery) First ¶
func (nq *NetworkQuery) First(ctx context.Context) (*Network, error)
First returns the first Network entity from the query. Returns a *NotFoundError when no Network was found.
func (*NetworkQuery) FirstID ¶
func (nq *NetworkQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Network ID from the query. Returns a *NotFoundError when no Network ID was found.
func (*NetworkQuery) FirstIDX ¶
func (nq *NetworkQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*NetworkQuery) FirstX ¶
func (nq *NetworkQuery) FirstX(ctx context.Context) *Network
FirstX is like First, but panics if an error occurs.
func (*NetworkQuery) GroupBy ¶
func (nq *NetworkQuery) GroupBy(field string, fields ...string) *NetworkGroupBy
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 { Index int `json:"Index,omitempty"` Count int `json:"count,omitempty"` } client.Network.Query(). GroupBy(network.FieldIndex). Aggregate(ent.Count()). Scan(ctx, &v)
func (*NetworkQuery) IDs ¶
func (nq *NetworkQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of Network IDs.
func (*NetworkQuery) IDsX ¶
func (nq *NetworkQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*NetworkQuery) Limit ¶
func (nq *NetworkQuery) Limit(limit int) *NetworkQuery
Limit adds a limit step to the query.
func (*NetworkQuery) Offset ¶
func (nq *NetworkQuery) Offset(offset int) *NetworkQuery
Offset adds an offset step to the query.
func (*NetworkQuery) Only ¶
func (nq *NetworkQuery) Only(ctx context.Context) (*Network, error)
Only returns a single Network entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Network entity is found. Returns a *NotFoundError when no Network entities are found.
func (*NetworkQuery) OnlyID ¶
func (nq *NetworkQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Network ID in the query. Returns a *NotSingularError when more than one Network ID is found. Returns a *NotFoundError when no entities are found.
func (*NetworkQuery) OnlyIDX ¶
func (nq *NetworkQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*NetworkQuery) OnlyX ¶
func (nq *NetworkQuery) OnlyX(ctx context.Context) *Network
OnlyX is like Only, but panics if an error occurs.
func (*NetworkQuery) Order ¶
func (nq *NetworkQuery) Order(o ...OrderFunc) *NetworkQuery
Order adds an order step to the query.
func (*NetworkQuery) QueryHostID ¶
func (nq *NetworkQuery) QueryHostID() *HostQuery
QueryHostID chains the current query on the "host_id" edge.
func (*NetworkQuery) Select ¶
func (nq *NetworkQuery) Select(fields ...string) *NetworkSelect
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 { Index int `json:"Index,omitempty"` } client.Network.Query(). Select(network.FieldIndex). Scan(ctx, &v)
func (*NetworkQuery) Unique ¶
func (nq *NetworkQuery) Unique(unique bool) *NetworkQuery
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 (*NetworkQuery) Where ¶
func (nq *NetworkQuery) Where(ps ...predicate.Network) *NetworkQuery
Where adds a new predicate for the NetworkQuery builder.
func (*NetworkQuery) WithHostID ¶
func (nq *NetworkQuery) WithHostID(opts ...func(*HostQuery)) *NetworkQuery
WithHostID tells the query-builder to eager-load the nodes that are connected to the "host_id" edge. The optional arguments are used to configure the query builder of the edge.
type NetworkSelect ¶
type NetworkSelect struct { *NetworkQuery // contains filtered or unexported fields }
NetworkSelect is the builder for selecting fields of Network entities.
func (*NetworkSelect) Bool ¶
func (ns *NetworkSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*NetworkSelect) BoolX ¶
func (ns *NetworkSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*NetworkSelect) Bools ¶
func (ns *NetworkSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*NetworkSelect) BoolsX ¶
func (ns *NetworkSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*NetworkSelect) Float64 ¶
func (ns *NetworkSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*NetworkSelect) Float64X ¶
func (ns *NetworkSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*NetworkSelect) Float64s ¶
func (ns *NetworkSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*NetworkSelect) Float64sX ¶
func (ns *NetworkSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*NetworkSelect) Int ¶
func (ns *NetworkSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*NetworkSelect) IntX ¶
func (ns *NetworkSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*NetworkSelect) Ints ¶
func (ns *NetworkSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*NetworkSelect) IntsX ¶
func (ns *NetworkSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*NetworkSelect) Scan ¶
func (ns *NetworkSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*NetworkSelect) ScanX ¶
func (ns *NetworkSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*NetworkSelect) String ¶
func (ns *NetworkSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*NetworkSelect) StringX ¶
func (ns *NetworkSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type NetworkUpdate ¶
type NetworkUpdate struct {
// contains filtered or unexported fields
}
NetworkUpdate is the builder for updating Network entities.
func (*NetworkUpdate) AddIndex ¶
func (nu *NetworkUpdate) AddIndex(i int) *NetworkUpdate
AddIndex adds i to the "Index" field.
func (*NetworkUpdate) AddMTU ¶
func (nu *NetworkUpdate) AddMTU(i int) *NetworkUpdate
AddMTU adds i to the "MTU" field.
func (*NetworkUpdate) ClearAddrs ¶
func (nu *NetworkUpdate) ClearAddrs() *NetworkUpdate
ClearAddrs clears the value of the "addrs" field.
func (*NetworkUpdate) ClearFlags ¶
func (nu *NetworkUpdate) ClearFlags() *NetworkUpdate
ClearFlags clears the value of the "Flags" field.
func (*NetworkUpdate) ClearHostID ¶
func (nu *NetworkUpdate) ClearHostID() *NetworkUpdate
ClearHostID clears the "host_id" edge to the Host entity.
func (*NetworkUpdate) Exec ¶
func (nu *NetworkUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*NetworkUpdate) ExecX ¶
func (nu *NetworkUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NetworkUpdate) Mutation ¶
func (nu *NetworkUpdate) Mutation() *NetworkMutation
Mutation returns the NetworkMutation object of the builder.
func (*NetworkUpdate) Save ¶
func (nu *NetworkUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*NetworkUpdate) SaveX ¶
func (nu *NetworkUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*NetworkUpdate) SetAddrs ¶
func (nu *NetworkUpdate) SetAddrs(s []string) *NetworkUpdate
SetAddrs sets the "addrs" field.
func (*NetworkUpdate) SetCreatedAt ¶
func (nu *NetworkUpdate) SetCreatedAt(t time.Time) *NetworkUpdate
SetCreatedAt sets the "created_at" field.
func (*NetworkUpdate) SetFlags ¶
func (nu *NetworkUpdate) SetFlags(s []string) *NetworkUpdate
SetFlags sets the "Flags" field.
func (*NetworkUpdate) SetHardwareAddr ¶
func (nu *NetworkUpdate) SetHardwareAddr(s string) *NetworkUpdate
SetHardwareAddr sets the "HardwareAddr" field.
func (*NetworkUpdate) SetHostID ¶
func (nu *NetworkUpdate) SetHostID(h *Host) *NetworkUpdate
SetHostID sets the "host_id" edge to the Host entity.
func (*NetworkUpdate) SetHostIDID ¶
func (nu *NetworkUpdate) SetHostIDID(id string) *NetworkUpdate
SetHostIDID sets the "host_id" edge to the Host entity by ID.
func (*NetworkUpdate) SetIndex ¶
func (nu *NetworkUpdate) SetIndex(i int) *NetworkUpdate
SetIndex sets the "Index" field.
func (*NetworkUpdate) SetMTU ¶
func (nu *NetworkUpdate) SetMTU(i int) *NetworkUpdate
SetMTU sets the "MTU" field.
func (*NetworkUpdate) SetName ¶
func (nu *NetworkUpdate) SetName(s string) *NetworkUpdate
SetName sets the "name" field.
func (*NetworkUpdate) SetNillableCreatedAt ¶
func (nu *NetworkUpdate) SetNillableCreatedAt(t *time.Time) *NetworkUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*NetworkUpdate) SetNillableUpdatedAt ¶
func (nu *NetworkUpdate) SetNillableUpdatedAt(t *time.Time) *NetworkUpdate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*NetworkUpdate) SetUpdatedAt ¶
func (nu *NetworkUpdate) SetUpdatedAt(t time.Time) *NetworkUpdate
SetUpdatedAt sets the "updated_at" field.
func (*NetworkUpdate) Where ¶
func (nu *NetworkUpdate) Where(ps ...predicate.Network) *NetworkUpdate
Where appends a list predicates to the NetworkUpdate builder.
type NetworkUpdateOne ¶
type NetworkUpdateOne struct {
// contains filtered or unexported fields
}
NetworkUpdateOne is the builder for updating a single Network entity.
func (*NetworkUpdateOne) AddIndex ¶
func (nuo *NetworkUpdateOne) AddIndex(i int) *NetworkUpdateOne
AddIndex adds i to the "Index" field.
func (*NetworkUpdateOne) AddMTU ¶
func (nuo *NetworkUpdateOne) AddMTU(i int) *NetworkUpdateOne
AddMTU adds i to the "MTU" field.
func (*NetworkUpdateOne) ClearAddrs ¶
func (nuo *NetworkUpdateOne) ClearAddrs() *NetworkUpdateOne
ClearAddrs clears the value of the "addrs" field.
func (*NetworkUpdateOne) ClearFlags ¶
func (nuo *NetworkUpdateOne) ClearFlags() *NetworkUpdateOne
ClearFlags clears the value of the "Flags" field.
func (*NetworkUpdateOne) ClearHostID ¶
func (nuo *NetworkUpdateOne) ClearHostID() *NetworkUpdateOne
ClearHostID clears the "host_id" edge to the Host entity.
func (*NetworkUpdateOne) Exec ¶
func (nuo *NetworkUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*NetworkUpdateOne) ExecX ¶
func (nuo *NetworkUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NetworkUpdateOne) Mutation ¶
func (nuo *NetworkUpdateOne) Mutation() *NetworkMutation
Mutation returns the NetworkMutation object of the builder.
func (*NetworkUpdateOne) Save ¶
func (nuo *NetworkUpdateOne) Save(ctx context.Context) (*Network, error)
Save executes the query and returns the updated Network entity.
func (*NetworkUpdateOne) SaveX ¶
func (nuo *NetworkUpdateOne) SaveX(ctx context.Context) *Network
SaveX is like Save, but panics if an error occurs.
func (*NetworkUpdateOne) Select ¶
func (nuo *NetworkUpdateOne) Select(field string, fields ...string) *NetworkUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*NetworkUpdateOne) SetAddrs ¶
func (nuo *NetworkUpdateOne) SetAddrs(s []string) *NetworkUpdateOne
SetAddrs sets the "addrs" field.
func (*NetworkUpdateOne) SetCreatedAt ¶
func (nuo *NetworkUpdateOne) SetCreatedAt(t time.Time) *NetworkUpdateOne
SetCreatedAt sets the "created_at" field.
func (*NetworkUpdateOne) SetFlags ¶
func (nuo *NetworkUpdateOne) SetFlags(s []string) *NetworkUpdateOne
SetFlags sets the "Flags" field.
func (*NetworkUpdateOne) SetHardwareAddr ¶
func (nuo *NetworkUpdateOne) SetHardwareAddr(s string) *NetworkUpdateOne
SetHardwareAddr sets the "HardwareAddr" field.
func (*NetworkUpdateOne) SetHostID ¶
func (nuo *NetworkUpdateOne) SetHostID(h *Host) *NetworkUpdateOne
SetHostID sets the "host_id" edge to the Host entity.
func (*NetworkUpdateOne) SetHostIDID ¶
func (nuo *NetworkUpdateOne) SetHostIDID(id string) *NetworkUpdateOne
SetHostIDID sets the "host_id" edge to the Host entity by ID.
func (*NetworkUpdateOne) SetIndex ¶
func (nuo *NetworkUpdateOne) SetIndex(i int) *NetworkUpdateOne
SetIndex sets the "Index" field.
func (*NetworkUpdateOne) SetMTU ¶
func (nuo *NetworkUpdateOne) SetMTU(i int) *NetworkUpdateOne
SetMTU sets the "MTU" field.
func (*NetworkUpdateOne) SetName ¶
func (nuo *NetworkUpdateOne) SetName(s string) *NetworkUpdateOne
SetName sets the "name" field.
func (*NetworkUpdateOne) SetNillableCreatedAt ¶
func (nuo *NetworkUpdateOne) SetNillableCreatedAt(t *time.Time) *NetworkUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*NetworkUpdateOne) SetNillableUpdatedAt ¶
func (nuo *NetworkUpdateOne) SetNillableUpdatedAt(t *time.Time) *NetworkUpdateOne
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*NetworkUpdateOne) SetUpdatedAt ¶
func (nuo *NetworkUpdateOne) SetUpdatedAt(t time.Time) *NetworkUpdateOne
SetUpdatedAt sets the "updated_at" field.
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 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 Tx ¶
type Tx struct { // Cpu is the client for interacting with the Cpu builders. Cpu *CpuClient // Disk is the client for interacting with the Disk builders. Disk *DiskClient // Host is the client for interacting with the Host builders. Host *HostClient // Netstat is the client for interacting with the Netstat builders. Netstat *NetstatClient // Network is the client for interacting with the Network builders. Network *NetworkClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
Source Files ¶
- client.go
- config.go
- context.go
- cpu.go
- cpu_create.go
- cpu_delete.go
- cpu_query.go
- cpu_update.go
- disk.go
- disk_create.go
- disk_delete.go
- disk_query.go
- disk_update.go
- ent.go
- generate.go
- host.go
- host_create.go
- host_delete.go
- host_query.go
- host_update.go
- mutation.go
- netstat.go
- netstat_create.go
- netstat_delete.go
- netstat_query.go
- netstat_update.go
- network.go
- network_create.go
- network_delete.go
- network_query.go
- network_update.go
- runtime.go
- tx.go