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 Action
- type ActionClient
- func (c *ActionClient) Create() *ActionCreate
- func (c *ActionClient) CreateBulk(builders ...*ActionCreate) *ActionCreateBulk
- func (c *ActionClient) Delete() *ActionDelete
- func (c *ActionClient) DeleteOne(a *Action) *ActionDeleteOne
- func (c *ActionClient) DeleteOneID(id int) *ActionDeleteOne
- func (c *ActionClient) Get(ctx context.Context, id int) (*Action, error)
- func (c *ActionClient) GetX(ctx context.Context, id int) *Action
- func (c *ActionClient) Hooks() []Hook
- func (c *ActionClient) Query() *ActionQuery
- func (c *ActionClient) QueryTargeting(a *Action) *HostQuery
- func (c *ActionClient) Update() *ActionUpdate
- func (c *ActionClient) UpdateOne(a *Action) *ActionUpdateOne
- func (c *ActionClient) UpdateOneID(id int) *ActionUpdateOne
- func (c *ActionClient) Use(hooks ...Hook)
- type ActionCreate
- func (ac *ActionCreate) Mutation() *ActionMutation
- func (ac *ActionCreate) Save(ctx context.Context) (*Action, error)
- func (ac *ActionCreate) SaveX(ctx context.Context) *Action
- func (ac *ActionCreate) SetArgs(s string) *ActionCreate
- func (ac *ActionCreate) SetMode(s string) *ActionCreate
- func (ac *ActionCreate) SetNillableQueued(b *bool) *ActionCreate
- func (ac *ActionCreate) SetNillableResponded(b *bool) *ActionCreate
- func (ac *ActionCreate) SetNillableResult(s *string) *ActionCreate
- func (ac *ActionCreate) SetNillableTargetingID(id *int) *ActionCreate
- func (ac *ActionCreate) SetQueued(b bool) *ActionCreate
- func (ac *ActionCreate) SetResponded(b bool) *ActionCreate
- func (ac *ActionCreate) SetResult(s string) *ActionCreate
- func (ac *ActionCreate) SetTargeting(h *Host) *ActionCreate
- func (ac *ActionCreate) SetTargetingID(id int) *ActionCreate
- func (ac *ActionCreate) SetUUID(s string) *ActionCreate
- type ActionCreateBulk
- type ActionDelete
- type ActionDeleteOne
- type ActionEdges
- type ActionGroupBy
- func (agb *ActionGroupBy) Aggregate(fns ...AggregateFunc) *ActionGroupBy
- func (agb *ActionGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (agb *ActionGroupBy) BoolX(ctx context.Context) bool
- func (agb *ActionGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (agb *ActionGroupBy) BoolsX(ctx context.Context) []bool
- func (agb *ActionGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (agb *ActionGroupBy) Float64X(ctx context.Context) float64
- func (agb *ActionGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (agb *ActionGroupBy) Float64sX(ctx context.Context) []float64
- func (agb *ActionGroupBy) Int(ctx context.Context) (_ int, err error)
- func (agb *ActionGroupBy) IntX(ctx context.Context) int
- func (agb *ActionGroupBy) Ints(ctx context.Context) ([]int, error)
- func (agb *ActionGroupBy) IntsX(ctx context.Context) []int
- func (agb *ActionGroupBy) Scan(ctx context.Context, v interface{}) error
- func (agb *ActionGroupBy) ScanX(ctx context.Context, v interface{})
- func (agb *ActionGroupBy) String(ctx context.Context) (_ string, err error)
- func (agb *ActionGroupBy) StringX(ctx context.Context) string
- func (agb *ActionGroupBy) Strings(ctx context.Context) ([]string, error)
- func (agb *ActionGroupBy) StringsX(ctx context.Context) []string
- type ActionMutation
- func (m *ActionMutation) AddField(name string, value ent.Value) error
- func (m *ActionMutation) AddedEdges() []string
- func (m *ActionMutation) AddedField(name string) (ent.Value, bool)
- func (m *ActionMutation) AddedFields() []string
- func (m *ActionMutation) AddedIDs(name string) []ent.Value
- func (m *ActionMutation) Args() (r string, exists bool)
- func (m *ActionMutation) ClearEdge(name string) error
- func (m *ActionMutation) ClearField(name string) error
- func (m *ActionMutation) ClearTargeting()
- func (m *ActionMutation) ClearedEdges() []string
- func (m *ActionMutation) ClearedFields() []string
- func (m ActionMutation) Client() *Client
- func (m *ActionMutation) EdgeCleared(name string) bool
- func (m *ActionMutation) Field(name string) (ent.Value, bool)
- func (m *ActionMutation) FieldCleared(name string) bool
- func (m *ActionMutation) Fields() []string
- func (m *ActionMutation) ID() (id int, exists bool)
- func (m *ActionMutation) Mode() (r string, exists bool)
- func (m *ActionMutation) OldArgs(ctx context.Context) (v string, err error)
- func (m *ActionMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ActionMutation) OldMode(ctx context.Context) (v string, err error)
- func (m *ActionMutation) OldQueued(ctx context.Context) (v bool, err error)
- func (m *ActionMutation) OldResponded(ctx context.Context) (v bool, err error)
- func (m *ActionMutation) OldResult(ctx context.Context) (v string, err error)
- func (m *ActionMutation) OldUUID(ctx context.Context) (v string, err error)
- func (m *ActionMutation) Op() Op
- func (m *ActionMutation) Queued() (r bool, exists bool)
- func (m *ActionMutation) RemovedEdges() []string
- func (m *ActionMutation) RemovedIDs(name string) []ent.Value
- func (m *ActionMutation) ResetArgs()
- func (m *ActionMutation) ResetEdge(name string) error
- func (m *ActionMutation) ResetField(name string) error
- func (m *ActionMutation) ResetMode()
- func (m *ActionMutation) ResetQueued()
- func (m *ActionMutation) ResetResponded()
- func (m *ActionMutation) ResetResult()
- func (m *ActionMutation) ResetTargeting()
- func (m *ActionMutation) ResetUUID()
- func (m *ActionMutation) Responded() (r bool, exists bool)
- func (m *ActionMutation) Result() (r string, exists bool)
- func (m *ActionMutation) SetArgs(s string)
- func (m *ActionMutation) SetField(name string, value ent.Value) error
- func (m *ActionMutation) SetMode(s string)
- func (m *ActionMutation) SetQueued(b bool)
- func (m *ActionMutation) SetResponded(b bool)
- func (m *ActionMutation) SetResult(s string)
- func (m *ActionMutation) SetTargetingID(id int)
- func (m *ActionMutation) SetUUID(s string)
- func (m *ActionMutation) TargetingCleared() bool
- func (m *ActionMutation) TargetingID() (id int, exists bool)
- func (m *ActionMutation) TargetingIDs() (ids []int)
- func (m ActionMutation) Tx() (*Tx, error)
- func (m *ActionMutation) Type() string
- func (m *ActionMutation) UUID() (r string, exists bool)
- type ActionQuery
- func (aq *ActionQuery) All(ctx context.Context) ([]*Action, error)
- func (aq *ActionQuery) AllX(ctx context.Context) []*Action
- func (aq *ActionQuery) Clone() *ActionQuery
- func (aq *ActionQuery) Count(ctx context.Context) (int, error)
- func (aq *ActionQuery) CountX(ctx context.Context) int
- func (aq *ActionQuery) Exist(ctx context.Context) (bool, error)
- func (aq *ActionQuery) ExistX(ctx context.Context) bool
- func (aq *ActionQuery) First(ctx context.Context) (*Action, error)
- func (aq *ActionQuery) FirstID(ctx context.Context) (id int, err error)
- func (aq *ActionQuery) FirstIDX(ctx context.Context) int
- func (aq *ActionQuery) FirstX(ctx context.Context) *Action
- func (aq *ActionQuery) GroupBy(field string, fields ...string) *ActionGroupBy
- func (aq *ActionQuery) IDs(ctx context.Context) ([]int, error)
- func (aq *ActionQuery) IDsX(ctx context.Context) []int
- func (aq *ActionQuery) Limit(limit int) *ActionQuery
- func (aq *ActionQuery) Offset(offset int) *ActionQuery
- func (aq *ActionQuery) Only(ctx context.Context) (*Action, error)
- func (aq *ActionQuery) OnlyID(ctx context.Context) (id int, err error)
- func (aq *ActionQuery) OnlyIDX(ctx context.Context) int
- func (aq *ActionQuery) OnlyX(ctx context.Context) *Action
- func (aq *ActionQuery) Order(o ...OrderFunc) *ActionQuery
- func (aq *ActionQuery) QueryTargeting() *HostQuery
- func (aq *ActionQuery) Select(field string, fields ...string) *ActionSelect
- func (aq *ActionQuery) Where(ps ...predicate.Action) *ActionQuery
- func (aq *ActionQuery) WithTargeting(opts ...func(*HostQuery)) *ActionQuery
- type ActionSelect
- func (as *ActionSelect) Bool(ctx context.Context) (_ bool, err error)
- func (as *ActionSelect) BoolX(ctx context.Context) bool
- func (as *ActionSelect) Bools(ctx context.Context) ([]bool, error)
- func (as *ActionSelect) BoolsX(ctx context.Context) []bool
- func (as *ActionSelect) Float64(ctx context.Context) (_ float64, err error)
- func (as *ActionSelect) Float64X(ctx context.Context) float64
- func (as *ActionSelect) Float64s(ctx context.Context) ([]float64, error)
- func (as *ActionSelect) Float64sX(ctx context.Context) []float64
- func (as *ActionSelect) Int(ctx context.Context) (_ int, err error)
- func (as *ActionSelect) IntX(ctx context.Context) int
- func (as *ActionSelect) Ints(ctx context.Context) ([]int, error)
- func (as *ActionSelect) IntsX(ctx context.Context) []int
- func (as *ActionSelect) Scan(ctx context.Context, v interface{}) error
- func (as *ActionSelect) ScanX(ctx context.Context, v interface{})
- func (as *ActionSelect) String(ctx context.Context) (_ string, err error)
- func (as *ActionSelect) StringX(ctx context.Context) string
- func (as *ActionSelect) Strings(ctx context.Context) ([]string, error)
- func (as *ActionSelect) StringsX(ctx context.Context) []string
- type ActionUpdate
- func (au *ActionUpdate) ClearTargeting() *ActionUpdate
- func (au *ActionUpdate) Exec(ctx context.Context) error
- func (au *ActionUpdate) ExecX(ctx context.Context)
- func (au *ActionUpdate) Mutation() *ActionMutation
- func (au *ActionUpdate) Save(ctx context.Context) (int, error)
- func (au *ActionUpdate) SaveX(ctx context.Context) int
- func (au *ActionUpdate) SetArgs(s string) *ActionUpdate
- func (au *ActionUpdate) SetMode(s string) *ActionUpdate
- func (au *ActionUpdate) SetNillableQueued(b *bool) *ActionUpdate
- func (au *ActionUpdate) SetNillableResponded(b *bool) *ActionUpdate
- func (au *ActionUpdate) SetNillableResult(s *string) *ActionUpdate
- func (au *ActionUpdate) SetNillableTargetingID(id *int) *ActionUpdate
- func (au *ActionUpdate) SetQueued(b bool) *ActionUpdate
- func (au *ActionUpdate) SetResponded(b bool) *ActionUpdate
- func (au *ActionUpdate) SetResult(s string) *ActionUpdate
- func (au *ActionUpdate) SetTargeting(h *Host) *ActionUpdate
- func (au *ActionUpdate) SetTargetingID(id int) *ActionUpdate
- func (au *ActionUpdate) SetUUID(s string) *ActionUpdate
- func (au *ActionUpdate) Where(ps ...predicate.Action) *ActionUpdate
- type ActionUpdateOne
- func (auo *ActionUpdateOne) ClearTargeting() *ActionUpdateOne
- func (auo *ActionUpdateOne) Exec(ctx context.Context) error
- func (auo *ActionUpdateOne) ExecX(ctx context.Context)
- func (auo *ActionUpdateOne) Mutation() *ActionMutation
- func (auo *ActionUpdateOne) Save(ctx context.Context) (*Action, error)
- func (auo *ActionUpdateOne) SaveX(ctx context.Context) *Action
- func (auo *ActionUpdateOne) SetArgs(s string) *ActionUpdateOne
- func (auo *ActionUpdateOne) SetMode(s string) *ActionUpdateOne
- func (auo *ActionUpdateOne) SetNillableQueued(b *bool) *ActionUpdateOne
- func (auo *ActionUpdateOne) SetNillableResponded(b *bool) *ActionUpdateOne
- func (auo *ActionUpdateOne) SetNillableResult(s *string) *ActionUpdateOne
- func (auo *ActionUpdateOne) SetNillableTargetingID(id *int) *ActionUpdateOne
- func (auo *ActionUpdateOne) SetQueued(b bool) *ActionUpdateOne
- func (auo *ActionUpdateOne) SetResponded(b bool) *ActionUpdateOne
- func (auo *ActionUpdateOne) SetResult(s string) *ActionUpdateOne
- func (auo *ActionUpdateOne) SetTargeting(h *Host) *ActionUpdateOne
- func (auo *ActionUpdateOne) SetTargetingID(id int) *ActionUpdateOne
- func (auo *ActionUpdateOne) SetUUID(s string) *ActionUpdateOne
- type Actions
- type AggregateFunc
- type Bot
- type BotClient
- func (c *BotClient) Create() *BotCreate
- func (c *BotClient) CreateBulk(builders ...*BotCreate) *BotCreateBulk
- func (c *BotClient) Delete() *BotDelete
- func (c *BotClient) DeleteOne(b *Bot) *BotDeleteOne
- func (c *BotClient) DeleteOneID(id int) *BotDeleteOne
- func (c *BotClient) Get(ctx context.Context, id int) (*Bot, error)
- func (c *BotClient) GetX(ctx context.Context, id int) *Bot
- func (c *BotClient) Hooks() []Hook
- func (c *BotClient) Query() *BotQuery
- func (c *BotClient) QueryInfecting(b *Bot) *HostQuery
- func (c *BotClient) Update() *BotUpdate
- func (c *BotClient) UpdateOne(b *Bot) *BotUpdateOne
- func (c *BotClient) UpdateOneID(id int) *BotUpdateOne
- func (c *BotClient) Use(hooks ...Hook)
- type BotCreate
- func (bc *BotCreate) Mutation() *BotMutation
- func (bc *BotCreate) Save(ctx context.Context) (*Bot, error)
- func (bc *BotCreate) SaveX(ctx context.Context) *Bot
- func (bc *BotCreate) SetDelta(i int) *BotCreate
- func (bc *BotCreate) SetInfecting(h *Host) *BotCreate
- func (bc *BotCreate) SetInfectingID(id int) *BotCreate
- func (bc *BotCreate) SetInterval(i int) *BotCreate
- func (bc *BotCreate) SetLastSeen(i int) *BotCreate
- func (bc *BotCreate) SetNillableInfectingID(id *int) *BotCreate
- func (bc *BotCreate) SetNillableLastSeen(i *int) *BotCreate
- func (bc *BotCreate) SetUUID(s string) *BotCreate
- type BotCreateBulk
- type BotDelete
- type BotDeleteOne
- type BotEdges
- type BotGroupBy
- func (bgb *BotGroupBy) Aggregate(fns ...AggregateFunc) *BotGroupBy
- func (bgb *BotGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (bgb *BotGroupBy) BoolX(ctx context.Context) bool
- func (bgb *BotGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (bgb *BotGroupBy) BoolsX(ctx context.Context) []bool
- func (bgb *BotGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (bgb *BotGroupBy) Float64X(ctx context.Context) float64
- func (bgb *BotGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (bgb *BotGroupBy) Float64sX(ctx context.Context) []float64
- func (bgb *BotGroupBy) Int(ctx context.Context) (_ int, err error)
- func (bgb *BotGroupBy) IntX(ctx context.Context) int
- func (bgb *BotGroupBy) Ints(ctx context.Context) ([]int, error)
- func (bgb *BotGroupBy) IntsX(ctx context.Context) []int
- func (bgb *BotGroupBy) Scan(ctx context.Context, v interface{}) error
- func (bgb *BotGroupBy) ScanX(ctx context.Context, v interface{})
- func (bgb *BotGroupBy) String(ctx context.Context) (_ string, err error)
- func (bgb *BotGroupBy) StringX(ctx context.Context) string
- func (bgb *BotGroupBy) Strings(ctx context.Context) ([]string, error)
- func (bgb *BotGroupBy) StringsX(ctx context.Context) []string
- type BotMutation
- func (m *BotMutation) AddDelta(i int)
- func (m *BotMutation) AddField(name string, value ent.Value) error
- func (m *BotMutation) AddInterval(i int)
- func (m *BotMutation) AddLastSeen(i int)
- func (m *BotMutation) AddedDelta() (r int, exists bool)
- func (m *BotMutation) AddedEdges() []string
- func (m *BotMutation) AddedField(name string) (ent.Value, bool)
- func (m *BotMutation) AddedFields() []string
- func (m *BotMutation) AddedIDs(name string) []ent.Value
- func (m *BotMutation) AddedInterval() (r int, exists bool)
- func (m *BotMutation) AddedLastSeen() (r int, exists bool)
- func (m *BotMutation) ClearEdge(name string) error
- func (m *BotMutation) ClearField(name string) error
- func (m *BotMutation) ClearInfecting()
- func (m *BotMutation) ClearedEdges() []string
- func (m *BotMutation) ClearedFields() []string
- func (m BotMutation) Client() *Client
- func (m *BotMutation) Delta() (r int, exists bool)
- func (m *BotMutation) EdgeCleared(name string) bool
- func (m *BotMutation) Field(name string) (ent.Value, bool)
- func (m *BotMutation) FieldCleared(name string) bool
- func (m *BotMutation) Fields() []string
- func (m *BotMutation) ID() (id int, exists bool)
- func (m *BotMutation) InfectingCleared() bool
- func (m *BotMutation) InfectingID() (id int, exists bool)
- func (m *BotMutation) InfectingIDs() (ids []int)
- func (m *BotMutation) Interval() (r int, exists bool)
- func (m *BotMutation) LastSeen() (r int, exists bool)
- func (m *BotMutation) OldDelta(ctx context.Context) (v int, err error)
- func (m *BotMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *BotMutation) OldInterval(ctx context.Context) (v int, err error)
- func (m *BotMutation) OldLastSeen(ctx context.Context) (v int, err error)
- func (m *BotMutation) OldUUID(ctx context.Context) (v string, err error)
- func (m *BotMutation) Op() Op
- func (m *BotMutation) RemovedEdges() []string
- func (m *BotMutation) RemovedIDs(name string) []ent.Value
- func (m *BotMutation) ResetDelta()
- func (m *BotMutation) ResetEdge(name string) error
- func (m *BotMutation) ResetField(name string) error
- func (m *BotMutation) ResetInfecting()
- func (m *BotMutation) ResetInterval()
- func (m *BotMutation) ResetLastSeen()
- func (m *BotMutation) ResetUUID()
- func (m *BotMutation) SetDelta(i int)
- func (m *BotMutation) SetField(name string, value ent.Value) error
- func (m *BotMutation) SetInfectingID(id int)
- func (m *BotMutation) SetInterval(i int)
- func (m *BotMutation) SetLastSeen(i int)
- func (m *BotMutation) SetUUID(s string)
- func (m BotMutation) Tx() (*Tx, error)
- func (m *BotMutation) Type() string
- func (m *BotMutation) UUID() (r string, exists bool)
- type BotQuery
- func (bq *BotQuery) All(ctx context.Context) ([]*Bot, error)
- func (bq *BotQuery) AllX(ctx context.Context) []*Bot
- func (bq *BotQuery) Clone() *BotQuery
- func (bq *BotQuery) Count(ctx context.Context) (int, error)
- func (bq *BotQuery) CountX(ctx context.Context) int
- func (bq *BotQuery) Exist(ctx context.Context) (bool, error)
- func (bq *BotQuery) ExistX(ctx context.Context) bool
- func (bq *BotQuery) First(ctx context.Context) (*Bot, error)
- func (bq *BotQuery) FirstID(ctx context.Context) (id int, err error)
- func (bq *BotQuery) FirstIDX(ctx context.Context) int
- func (bq *BotQuery) FirstX(ctx context.Context) *Bot
- func (bq *BotQuery) GroupBy(field string, fields ...string) *BotGroupBy
- func (bq *BotQuery) IDs(ctx context.Context) ([]int, error)
- func (bq *BotQuery) IDsX(ctx context.Context) []int
- func (bq *BotQuery) Limit(limit int) *BotQuery
- func (bq *BotQuery) Offset(offset int) *BotQuery
- func (bq *BotQuery) Only(ctx context.Context) (*Bot, error)
- func (bq *BotQuery) OnlyID(ctx context.Context) (id int, err error)
- func (bq *BotQuery) OnlyIDX(ctx context.Context) int
- func (bq *BotQuery) OnlyX(ctx context.Context) *Bot
- func (bq *BotQuery) Order(o ...OrderFunc) *BotQuery
- func (bq *BotQuery) QueryInfecting() *HostQuery
- func (bq *BotQuery) Select(field string, fields ...string) *BotSelect
- func (bq *BotQuery) Where(ps ...predicate.Bot) *BotQuery
- func (bq *BotQuery) WithInfecting(opts ...func(*HostQuery)) *BotQuery
- type BotSelect
- func (bs *BotSelect) Bool(ctx context.Context) (_ bool, err error)
- func (bs *BotSelect) BoolX(ctx context.Context) bool
- func (bs *BotSelect) Bools(ctx context.Context) ([]bool, error)
- func (bs *BotSelect) BoolsX(ctx context.Context) []bool
- func (bs *BotSelect) Float64(ctx context.Context) (_ float64, err error)
- func (bs *BotSelect) Float64X(ctx context.Context) float64
- func (bs *BotSelect) Float64s(ctx context.Context) ([]float64, error)
- func (bs *BotSelect) Float64sX(ctx context.Context) []float64
- func (bs *BotSelect) Int(ctx context.Context) (_ int, err error)
- func (bs *BotSelect) IntX(ctx context.Context) int
- func (bs *BotSelect) Ints(ctx context.Context) ([]int, error)
- func (bs *BotSelect) IntsX(ctx context.Context) []int
- func (bs *BotSelect) Scan(ctx context.Context, v interface{}) error
- func (bs *BotSelect) ScanX(ctx context.Context, v interface{})
- func (bs *BotSelect) String(ctx context.Context) (_ string, err error)
- func (bs *BotSelect) StringX(ctx context.Context) string
- func (bs *BotSelect) Strings(ctx context.Context) ([]string, error)
- func (bs *BotSelect) StringsX(ctx context.Context) []string
- type BotUpdate
- func (bu *BotUpdate) AddDelta(i int) *BotUpdate
- func (bu *BotUpdate) AddInterval(i int) *BotUpdate
- func (bu *BotUpdate) AddLastSeen(i int) *BotUpdate
- func (bu *BotUpdate) ClearInfecting() *BotUpdate
- func (bu *BotUpdate) Exec(ctx context.Context) error
- func (bu *BotUpdate) ExecX(ctx context.Context)
- func (bu *BotUpdate) Mutation() *BotMutation
- func (bu *BotUpdate) Save(ctx context.Context) (int, error)
- func (bu *BotUpdate) SaveX(ctx context.Context) int
- func (bu *BotUpdate) SetDelta(i int) *BotUpdate
- func (bu *BotUpdate) SetInfecting(h *Host) *BotUpdate
- func (bu *BotUpdate) SetInfectingID(id int) *BotUpdate
- func (bu *BotUpdate) SetInterval(i int) *BotUpdate
- func (bu *BotUpdate) SetLastSeen(i int) *BotUpdate
- func (bu *BotUpdate) SetNillableInfectingID(id *int) *BotUpdate
- func (bu *BotUpdate) SetNillableLastSeen(i *int) *BotUpdate
- func (bu *BotUpdate) SetUUID(s string) *BotUpdate
- func (bu *BotUpdate) Where(ps ...predicate.Bot) *BotUpdate
- type BotUpdateOne
- func (buo *BotUpdateOne) AddDelta(i int) *BotUpdateOne
- func (buo *BotUpdateOne) AddInterval(i int) *BotUpdateOne
- func (buo *BotUpdateOne) AddLastSeen(i int) *BotUpdateOne
- func (buo *BotUpdateOne) ClearInfecting() *BotUpdateOne
- func (buo *BotUpdateOne) Exec(ctx context.Context) error
- func (buo *BotUpdateOne) ExecX(ctx context.Context)
- func (buo *BotUpdateOne) Mutation() *BotMutation
- func (buo *BotUpdateOne) Save(ctx context.Context) (*Bot, error)
- func (buo *BotUpdateOne) SaveX(ctx context.Context) *Bot
- func (buo *BotUpdateOne) SetDelta(i int) *BotUpdateOne
- func (buo *BotUpdateOne) SetInfecting(h *Host) *BotUpdateOne
- func (buo *BotUpdateOne) SetInfectingID(id int) *BotUpdateOne
- func (buo *BotUpdateOne) SetInterval(i int) *BotUpdateOne
- func (buo *BotUpdateOne) SetLastSeen(i int) *BotUpdateOne
- func (buo *BotUpdateOne) SetNillableInfectingID(id *int) *BotUpdateOne
- func (buo *BotUpdateOne) SetNillableLastSeen(i *int) *BotUpdateOne
- func (buo *BotUpdateOne) SetUUID(s string) *BotUpdateOne
- type Bots
- type Client
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Group
- type GroupClient
- func (c *GroupClient) Create() *GroupCreate
- func (c *GroupClient) CreateBulk(builders ...*GroupCreate) *GroupCreateBulk
- func (c *GroupClient) Delete() *GroupDelete
- func (c *GroupClient) DeleteOne(gr *Group) *GroupDeleteOne
- func (c *GroupClient) DeleteOneID(id int) *GroupDeleteOne
- func (c *GroupClient) Get(ctx context.Context, id int) (*Group, error)
- func (c *GroupClient) GetX(ctx context.Context, id int) *Group
- func (c *GroupClient) Hooks() []Hook
- func (c *GroupClient) Query() *GroupQuery
- func (c *GroupClient) QueryMembers(gr *Group) *HostQuery
- func (c *GroupClient) Update() *GroupUpdate
- func (c *GroupClient) UpdateOne(gr *Group) *GroupUpdateOne
- func (c *GroupClient) UpdateOneID(id int) *GroupUpdateOne
- func (c *GroupClient) Use(hooks ...Hook)
- type GroupCreate
- func (gc *GroupCreate) AddMemberIDs(ids ...int) *GroupCreate
- func (gc *GroupCreate) AddMembers(h ...*Host) *GroupCreate
- func (gc *GroupCreate) Mutation() *GroupMutation
- func (gc *GroupCreate) Save(ctx context.Context) (*Group, error)
- func (gc *GroupCreate) SaveX(ctx context.Context) *Group
- func (gc *GroupCreate) SetDesc(s string) *GroupCreate
- func (gc *GroupCreate) SetName(s string) *GroupCreate
- type GroupCreateBulk
- type GroupDelete
- type GroupDeleteOne
- type GroupEdges
- type GroupGroupBy
- func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy
- func (ggb *GroupGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (ggb *GroupGroupBy) BoolX(ctx context.Context) bool
- func (ggb *GroupGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (ggb *GroupGroupBy) BoolsX(ctx context.Context) []bool
- func (ggb *GroupGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (ggb *GroupGroupBy) Float64X(ctx context.Context) float64
- func (ggb *GroupGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (ggb *GroupGroupBy) Float64sX(ctx context.Context) []float64
- func (ggb *GroupGroupBy) Int(ctx context.Context) (_ int, err error)
- func (ggb *GroupGroupBy) IntX(ctx context.Context) int
- func (ggb *GroupGroupBy) Ints(ctx context.Context) ([]int, error)
- func (ggb *GroupGroupBy) IntsX(ctx context.Context) []int
- func (ggb *GroupGroupBy) Scan(ctx context.Context, v interface{}) error
- func (ggb *GroupGroupBy) ScanX(ctx context.Context, v interface{})
- func (ggb *GroupGroupBy) String(ctx context.Context) (_ string, err error)
- func (ggb *GroupGroupBy) StringX(ctx context.Context) string
- func (ggb *GroupGroupBy) Strings(ctx context.Context) ([]string, error)
- func (ggb *GroupGroupBy) StringsX(ctx context.Context) []string
- type GroupMutation
- func (m *GroupMutation) AddField(name string, value ent.Value) error
- func (m *GroupMutation) AddMemberIDs(ids ...int)
- func (m *GroupMutation) AddedEdges() []string
- func (m *GroupMutation) AddedField(name string) (ent.Value, bool)
- func (m *GroupMutation) AddedFields() []string
- func (m *GroupMutation) AddedIDs(name string) []ent.Value
- func (m *GroupMutation) ClearEdge(name string) error
- func (m *GroupMutation) ClearField(name string) error
- func (m *GroupMutation) ClearMembers()
- func (m *GroupMutation) ClearedEdges() []string
- func (m *GroupMutation) ClearedFields() []string
- func (m GroupMutation) Client() *Client
- func (m *GroupMutation) Desc() (r string, exists bool)
- func (m *GroupMutation) EdgeCleared(name string) bool
- func (m *GroupMutation) Field(name string) (ent.Value, bool)
- func (m *GroupMutation) FieldCleared(name string) bool
- func (m *GroupMutation) Fields() []string
- func (m *GroupMutation) ID() (id int, exists bool)
- func (m *GroupMutation) MembersCleared() bool
- func (m *GroupMutation) MembersIDs() (ids []int)
- func (m *GroupMutation) Name() (r string, exists bool)
- func (m *GroupMutation) OldDesc(ctx context.Context) (v string, err error)
- func (m *GroupMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *GroupMutation) OldName(ctx context.Context) (v string, err error)
- func (m *GroupMutation) Op() Op
- func (m *GroupMutation) RemoveMemberIDs(ids ...int)
- func (m *GroupMutation) RemovedEdges() []string
- func (m *GroupMutation) RemovedIDs(name string) []ent.Value
- func (m *GroupMutation) RemovedMembersIDs() (ids []int)
- func (m *GroupMutation) ResetDesc()
- func (m *GroupMutation) ResetEdge(name string) error
- func (m *GroupMutation) ResetField(name string) error
- func (m *GroupMutation) ResetMembers()
- func (m *GroupMutation) ResetName()
- func (m *GroupMutation) SetDesc(s string)
- func (m *GroupMutation) SetField(name string, value ent.Value) error
- func (m *GroupMutation) SetName(s string)
- func (m GroupMutation) Tx() (*Tx, error)
- func (m *GroupMutation) Type() string
- type GroupQuery
- func (gq *GroupQuery) All(ctx context.Context) ([]*Group, error)
- func (gq *GroupQuery) AllX(ctx context.Context) []*Group
- func (gq *GroupQuery) Clone() *GroupQuery
- func (gq *GroupQuery) Count(ctx context.Context) (int, error)
- func (gq *GroupQuery) CountX(ctx context.Context) int
- func (gq *GroupQuery) Exist(ctx context.Context) (bool, error)
- func (gq *GroupQuery) ExistX(ctx context.Context) bool
- func (gq *GroupQuery) First(ctx context.Context) (*Group, error)
- func (gq *GroupQuery) FirstID(ctx context.Context) (id int, err error)
- func (gq *GroupQuery) FirstIDX(ctx context.Context) int
- func (gq *GroupQuery) FirstX(ctx context.Context) *Group
- func (gq *GroupQuery) GroupBy(field string, fields ...string) *GroupGroupBy
- func (gq *GroupQuery) IDs(ctx context.Context) ([]int, error)
- func (gq *GroupQuery) IDsX(ctx context.Context) []int
- func (gq *GroupQuery) Limit(limit int) *GroupQuery
- func (gq *GroupQuery) Offset(offset int) *GroupQuery
- func (gq *GroupQuery) Only(ctx context.Context) (*Group, error)
- func (gq *GroupQuery) OnlyID(ctx context.Context) (id int, err error)
- func (gq *GroupQuery) OnlyIDX(ctx context.Context) int
- func (gq *GroupQuery) OnlyX(ctx context.Context) *Group
- func (gq *GroupQuery) Order(o ...OrderFunc) *GroupQuery
- func (gq *GroupQuery) QueryMembers() *HostQuery
- func (gq *GroupQuery) Select(field string, fields ...string) *GroupSelect
- func (gq *GroupQuery) Where(ps ...predicate.Group) *GroupQuery
- func (gq *GroupQuery) WithMembers(opts ...func(*HostQuery)) *GroupQuery
- type GroupSelect
- func (gs *GroupSelect) Bool(ctx context.Context) (_ bool, err error)
- func (gs *GroupSelect) BoolX(ctx context.Context) bool
- func (gs *GroupSelect) Bools(ctx context.Context) ([]bool, error)
- func (gs *GroupSelect) BoolsX(ctx context.Context) []bool
- func (gs *GroupSelect) Float64(ctx context.Context) (_ float64, err error)
- func (gs *GroupSelect) Float64X(ctx context.Context) float64
- func (gs *GroupSelect) Float64s(ctx context.Context) ([]float64, error)
- func (gs *GroupSelect) Float64sX(ctx context.Context) []float64
- func (gs *GroupSelect) Int(ctx context.Context) (_ int, err error)
- func (gs *GroupSelect) IntX(ctx context.Context) int
- func (gs *GroupSelect) Ints(ctx context.Context) ([]int, error)
- func (gs *GroupSelect) IntsX(ctx context.Context) []int
- func (gs *GroupSelect) Scan(ctx context.Context, v interface{}) error
- func (gs *GroupSelect) ScanX(ctx context.Context, v interface{})
- func (gs *GroupSelect) String(ctx context.Context) (_ string, err error)
- func (gs *GroupSelect) StringX(ctx context.Context) string
- func (gs *GroupSelect) Strings(ctx context.Context) ([]string, error)
- func (gs *GroupSelect) StringsX(ctx context.Context) []string
- type GroupUpdate
- func (gu *GroupUpdate) AddMemberIDs(ids ...int) *GroupUpdate
- func (gu *GroupUpdate) AddMembers(h ...*Host) *GroupUpdate
- func (gu *GroupUpdate) ClearMembers() *GroupUpdate
- func (gu *GroupUpdate) Exec(ctx context.Context) error
- func (gu *GroupUpdate) ExecX(ctx context.Context)
- func (gu *GroupUpdate) Mutation() *GroupMutation
- func (gu *GroupUpdate) RemoveMemberIDs(ids ...int) *GroupUpdate
- func (gu *GroupUpdate) RemoveMembers(h ...*Host) *GroupUpdate
- func (gu *GroupUpdate) Save(ctx context.Context) (int, error)
- func (gu *GroupUpdate) SaveX(ctx context.Context) int
- func (gu *GroupUpdate) SetDesc(s string) *GroupUpdate
- func (gu *GroupUpdate) SetName(s string) *GroupUpdate
- func (gu *GroupUpdate) Where(ps ...predicate.Group) *GroupUpdate
- type GroupUpdateOne
- func (guo *GroupUpdateOne) AddMemberIDs(ids ...int) *GroupUpdateOne
- func (guo *GroupUpdateOne) AddMembers(h ...*Host) *GroupUpdateOne
- func (guo *GroupUpdateOne) ClearMembers() *GroupUpdateOne
- func (guo *GroupUpdateOne) Exec(ctx context.Context) error
- func (guo *GroupUpdateOne) ExecX(ctx context.Context)
- func (guo *GroupUpdateOne) Mutation() *GroupMutation
- func (guo *GroupUpdateOne) RemoveMemberIDs(ids ...int) *GroupUpdateOne
- func (guo *GroupUpdateOne) RemoveMembers(h ...*Host) *GroupUpdateOne
- func (guo *GroupUpdateOne) Save(ctx context.Context) (*Group, error)
- func (guo *GroupUpdateOne) SaveX(ctx context.Context) *Group
- func (guo *GroupUpdateOne) SetDesc(s string) *GroupUpdateOne
- func (guo *GroupUpdateOne) SetName(s string) *GroupUpdateOne
- type Groups
- 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 int) *HostDeleteOne
- func (c *HostClient) Get(ctx context.Context, id int) (*Host, error)
- func (c *HostClient) GetX(ctx context.Context, id int) *Host
- func (c *HostClient) Hooks() []Hook
- func (c *HostClient) Query() *HostQuery
- func (c *HostClient) QueryActions(h *Host) *ActionQuery
- func (c *HostClient) QueryBots(h *Host) *BotQuery
- func (c *HostClient) QueryMember(h *Host) *GroupQuery
- func (c *HostClient) Update() *HostUpdate
- func (c *HostClient) UpdateOne(h *Host) *HostUpdateOne
- func (c *HostClient) UpdateOneID(id int) *HostUpdateOne
- func (c *HostClient) Use(hooks ...Hook)
- type HostCreate
- func (hc *HostCreate) AddActionIDs(ids ...int) *HostCreate
- func (hc *HostCreate) AddActions(a ...*Action) *HostCreate
- func (hc *HostCreate) AddBotIDs(ids ...int) *HostCreate
- func (hc *HostCreate) AddBots(b ...*Bot) *HostCreate
- func (hc *HostCreate) AddMember(g ...*Group) *HostCreate
- func (hc *HostCreate) AddMemberIDs(ids ...int) *HostCreate
- 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) SetHostname(s string) *HostCreate
- func (hc *HostCreate) SetInterface(s string) *HostCreate
- func (hc *HostCreate) SetLastSeen(i int) *HostCreate
- func (hc *HostCreate) SetNillableLastSeen(i *int) *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) ActionsCleared() bool
- func (m *HostMutation) ActionsIDs() (ids []int)
- func (m *HostMutation) AddActionIDs(ids ...int)
- func (m *HostMutation) AddBotIDs(ids ...int)
- func (m *HostMutation) AddField(name string, value ent.Value) error
- func (m *HostMutation) AddLastSeen(i int)
- func (m *HostMutation) AddMemberIDs(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) AddedLastSeen() (r int, exists bool)
- func (m *HostMutation) BotsCleared() bool
- func (m *HostMutation) BotsIDs() (ids []int)
- func (m *HostMutation) ClearActions()
- func (m *HostMutation) ClearBots()
- func (m *HostMutation) ClearEdge(name string) error
- func (m *HostMutation) ClearField(name string) error
- func (m *HostMutation) ClearMember()
- func (m *HostMutation) ClearedEdges() []string
- func (m *HostMutation) ClearedFields() []string
- func (m HostMutation) Client() *Client
- 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 int, exists bool)
- func (m *HostMutation) Interface() (r string, exists bool)
- func (m *HostMutation) LastSeen() (r int, exists bool)
- func (m *HostMutation) MemberCleared() bool
- func (m *HostMutation) MemberIDs() (ids []int)
- 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) OldInterface(ctx context.Context) (v string, err error)
- func (m *HostMutation) OldLastSeen(ctx context.Context) (v int, err error)
- func (m *HostMutation) Op() Op
- func (m *HostMutation) RemoveActionIDs(ids ...int)
- func (m *HostMutation) RemoveBotIDs(ids ...int)
- func (m *HostMutation) RemoveMemberIDs(ids ...int)
- func (m *HostMutation) RemovedActionsIDs() (ids []int)
- func (m *HostMutation) RemovedBotsIDs() (ids []int)
- func (m *HostMutation) RemovedEdges() []string
- func (m *HostMutation) RemovedIDs(name string) []ent.Value
- func (m *HostMutation) RemovedMemberIDs() (ids []int)
- func (m *HostMutation) ResetActions()
- func (m *HostMutation) ResetBots()
- func (m *HostMutation) ResetEdge(name string) error
- func (m *HostMutation) ResetField(name string) error
- func (m *HostMutation) ResetHostname()
- func (m *HostMutation) ResetInterface()
- func (m *HostMutation) ResetLastSeen()
- func (m *HostMutation) ResetMember()
- func (m *HostMutation) SetField(name string, value ent.Value) error
- func (m *HostMutation) SetHostname(s string)
- func (m *HostMutation) SetInterface(s string)
- func (m *HostMutation) SetLastSeen(i int)
- func (m HostMutation) Tx() (*Tx, error)
- func (m *HostMutation) Type() string
- 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 int, err error)
- func (hq *HostQuery) FirstIDX(ctx context.Context) int
- func (hq *HostQuery) FirstX(ctx context.Context) *Host
- func (hq *HostQuery) GroupBy(field string, fields ...string) *HostGroupBy
- func (hq *HostQuery) IDs(ctx context.Context) ([]int, error)
- func (hq *HostQuery) IDsX(ctx context.Context) []int
- 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 int, err error)
- func (hq *HostQuery) OnlyIDX(ctx context.Context) int
- func (hq *HostQuery) OnlyX(ctx context.Context) *Host
- func (hq *HostQuery) Order(o ...OrderFunc) *HostQuery
- func (hq *HostQuery) QueryActions() *ActionQuery
- func (hq *HostQuery) QueryBots() *BotQuery
- func (hq *HostQuery) QueryMember() *GroupQuery
- func (hq *HostQuery) Select(field string, fields ...string) *HostSelect
- func (hq *HostQuery) Where(ps ...predicate.Host) *HostQuery
- func (hq *HostQuery) WithActions(opts ...func(*ActionQuery)) *HostQuery
- func (hq *HostQuery) WithBots(opts ...func(*BotQuery)) *HostQuery
- func (hq *HostQuery) WithMember(opts ...func(*GroupQuery)) *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) AddActionIDs(ids ...int) *HostUpdate
- func (hu *HostUpdate) AddActions(a ...*Action) *HostUpdate
- func (hu *HostUpdate) AddBotIDs(ids ...int) *HostUpdate
- func (hu *HostUpdate) AddBots(b ...*Bot) *HostUpdate
- func (hu *HostUpdate) AddLastSeen(i int) *HostUpdate
- func (hu *HostUpdate) AddMember(g ...*Group) *HostUpdate
- func (hu *HostUpdate) AddMemberIDs(ids ...int) *HostUpdate
- func (hu *HostUpdate) ClearActions() *HostUpdate
- func (hu *HostUpdate) ClearBots() *HostUpdate
- func (hu *HostUpdate) ClearMember() *HostUpdate
- func (hu *HostUpdate) Exec(ctx context.Context) error
- func (hu *HostUpdate) ExecX(ctx context.Context)
- func (hu *HostUpdate) Mutation() *HostMutation
- func (hu *HostUpdate) RemoveActionIDs(ids ...int) *HostUpdate
- func (hu *HostUpdate) RemoveActions(a ...*Action) *HostUpdate
- func (hu *HostUpdate) RemoveBotIDs(ids ...int) *HostUpdate
- func (hu *HostUpdate) RemoveBots(b ...*Bot) *HostUpdate
- func (hu *HostUpdate) RemoveMember(g ...*Group) *HostUpdate
- func (hu *HostUpdate) RemoveMemberIDs(ids ...int) *HostUpdate
- func (hu *HostUpdate) Save(ctx context.Context) (int, error)
- func (hu *HostUpdate) SaveX(ctx context.Context) int
- func (hu *HostUpdate) SetHostname(s string) *HostUpdate
- func (hu *HostUpdate) SetInterface(s string) *HostUpdate
- func (hu *HostUpdate) SetLastSeen(i int) *HostUpdate
- func (hu *HostUpdate) SetNillableLastSeen(i *int) *HostUpdate
- func (hu *HostUpdate) Where(ps ...predicate.Host) *HostUpdate
- type HostUpdateOne
- func (huo *HostUpdateOne) AddActionIDs(ids ...int) *HostUpdateOne
- func (huo *HostUpdateOne) AddActions(a ...*Action) *HostUpdateOne
- func (huo *HostUpdateOne) AddBotIDs(ids ...int) *HostUpdateOne
- func (huo *HostUpdateOne) AddBots(b ...*Bot) *HostUpdateOne
- func (huo *HostUpdateOne) AddLastSeen(i int) *HostUpdateOne
- func (huo *HostUpdateOne) AddMember(g ...*Group) *HostUpdateOne
- func (huo *HostUpdateOne) AddMemberIDs(ids ...int) *HostUpdateOne
- func (huo *HostUpdateOne) ClearActions() *HostUpdateOne
- func (huo *HostUpdateOne) ClearBots() *HostUpdateOne
- func (huo *HostUpdateOne) ClearMember() *HostUpdateOne
- func (huo *HostUpdateOne) Exec(ctx context.Context) error
- func (huo *HostUpdateOne) ExecX(ctx context.Context)
- func (huo *HostUpdateOne) Mutation() *HostMutation
- func (huo *HostUpdateOne) RemoveActionIDs(ids ...int) *HostUpdateOne
- func (huo *HostUpdateOne) RemoveActions(a ...*Action) *HostUpdateOne
- func (huo *HostUpdateOne) RemoveBotIDs(ids ...int) *HostUpdateOne
- func (huo *HostUpdateOne) RemoveBots(b ...*Bot) *HostUpdateOne
- func (huo *HostUpdateOne) RemoveMember(g ...*Group) *HostUpdateOne
- func (huo *HostUpdateOne) RemoveMemberIDs(ids ...int) *HostUpdateOne
- func (huo *HostUpdateOne) Save(ctx context.Context) (*Host, error)
- func (huo *HostUpdateOne) SaveX(ctx context.Context) *Host
- func (huo *HostUpdateOne) SetHostname(s string) *HostUpdateOne
- func (huo *HostUpdateOne) SetInterface(s string) *HostUpdateOne
- func (huo *HostUpdateOne) SetLastSeen(i int) *HostUpdateOne
- func (huo *HostUpdateOne) SetNillableLastSeen(i *int) *HostUpdateOne
- type Hosts
- type MutateFunc
- type Mutation
- type Mutator
- 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 User
- type UserClient
- func (c *UserClient) Create() *UserCreate
- func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
- func (c *UserClient) Delete() *UserDelete
- func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
- func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id int) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id int) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserGroupBy
- func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (ugb *UserGroupBy) BoolX(ctx context.Context) bool
- func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (ugb *UserGroupBy) Float64X(ctx context.Context) float64
- func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (ugb *UserGroupBy) IntX(ctx context.Context) int
- func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (ugb *UserGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error
- func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{})
- func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (ugb *UserGroupBy) StringX(ctx context.Context) string
- func (ugb *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (ugb *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddedEdges() []string
- func (m *UserMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserMutation) AddedFields() []string
- func (m *UserMutation) AddedIDs(name string) []ent.Value
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) Field(name string) (ent.Value, bool)
- func (m *UserMutation) FieldCleared(name string) bool
- func (m *UserMutation) Fields() []string
- func (m *UserMutation) ID() (id int, exists bool)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) Password() (r string, exists bool)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetPassword()
- func (m *UserMutation) ResetUsername()
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetPassword(s string)
- func (m *UserMutation) SetUsername(s string)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) Username() (r string, exists bool)
- type UserQuery
- func (uq *UserQuery) All(ctx context.Context) ([]*User, error)
- func (uq *UserQuery) AllX(ctx context.Context) []*User
- func (uq *UserQuery) Clone() *UserQuery
- func (uq *UserQuery) Count(ctx context.Context) (int, error)
- func (uq *UserQuery) CountX(ctx context.Context) int
- func (uq *UserQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UserQuery) ExistX(ctx context.Context) bool
- func (uq *UserQuery) First(ctx context.Context) (*User, error)
- func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) int
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) ([]int, error)
- func (uq *UserQuery) IDsX(ctx context.Context) []int
- func (uq *UserQuery) Limit(limit int) *UserQuery
- func (uq *UserQuery) Offset(offset int) *UserQuery
- func (uq *UserQuery) Only(ctx context.Context) (*User, error)
- func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) int
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery
- func (uq *UserQuery) Select(field string, fields ...string) *UserSelect
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- type UserSelect
- func (us *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (us *UserSelect) BoolX(ctx context.Context) bool
- func (us *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (us *UserSelect) BoolsX(ctx context.Context) []bool
- func (us *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (us *UserSelect) Float64X(ctx context.Context) float64
- func (us *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (us *UserSelect) Float64sX(ctx context.Context) []float64
- func (us *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (us *UserSelect) IntX(ctx context.Context) int
- func (us *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (us *UserSelect) IntsX(ctx context.Context) []int
- func (us *UserSelect) Scan(ctx context.Context, v interface{}) error
- func (us *UserSelect) ScanX(ctx context.Context, v interface{})
- func (us *UserSelect) String(ctx context.Context) (_ string, err error)
- func (us *UserSelect) StringX(ctx context.Context) string
- func (us *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (us *UserSelect) StringsX(ctx context.Context) []string
- type UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetPassword(s string) *UserUpdate
- func (uu *UserUpdate) SetUsername(s string) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne
- type Users
- 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. TypeAction = "Action" TypeBot = "Bot" TypeGroup = "Group" TypeHost = "Host" TypeUser = "User" )
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 validaton error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type Action ¶
type Action struct { // ID of the ent. ID int `json:"id,omitempty"` // UUID holds the value of the "uuid" field. UUID string `json:"uuid,omitempty"` // Mode holds the value of the "mode" field. Mode string `json:"mode,omitempty"` // Args holds the value of the "args" field. Args string `json:"args,omitempty"` // Queued holds the value of the "queued" field. Queued bool `json:"queued,omitempty"` // Responded holds the value of the "responded" field. Responded bool `json:"responded,omitempty"` // Result holds the value of the "result" field. Result string `json:"result,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ActionQuery when eager-loading is set. Edges ActionEdges `json:"edges"` // contains filtered or unexported fields }
Action is the model entity for the Action schema.
func (*Action) QueryTargeting ¶
QueryTargeting queries the "targeting" edge of the Action entity.
func (*Action) Unwrap ¶
Unwrap unwraps the Action 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 (*Action) Update ¶
func (a *Action) Update() *ActionUpdateOne
Update returns a builder for updating this Action. Note that you need to call Action.Unwrap() before calling this method if this Action was returned from a transaction, and the transaction was committed or rolled back.
type ActionClient ¶
type ActionClient struct {
// contains filtered or unexported fields
}
ActionClient is a client for the Action schema.
func NewActionClient ¶
func NewActionClient(c config) *ActionClient
NewActionClient returns a client for the Action from the given config.
func (*ActionClient) Create ¶
func (c *ActionClient) Create() *ActionCreate
Create returns a create builder for Action.
func (*ActionClient) CreateBulk ¶
func (c *ActionClient) CreateBulk(builders ...*ActionCreate) *ActionCreateBulk
CreateBulk returns a builder for creating a bulk of Action entities.
func (*ActionClient) Delete ¶
func (c *ActionClient) Delete() *ActionDelete
Delete returns a delete builder for Action.
func (*ActionClient) DeleteOne ¶
func (c *ActionClient) DeleteOne(a *Action) *ActionDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*ActionClient) DeleteOneID ¶
func (c *ActionClient) DeleteOneID(id int) *ActionDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*ActionClient) GetX ¶
func (c *ActionClient) GetX(ctx context.Context, id int) *Action
GetX is like Get, but panics if an error occurs.
func (*ActionClient) Query ¶
func (c *ActionClient) Query() *ActionQuery
Query returns a query builder for Action.
func (*ActionClient) QueryTargeting ¶
func (c *ActionClient) QueryTargeting(a *Action) *HostQuery
QueryTargeting queries the targeting edge of a Action.
func (*ActionClient) Update ¶
func (c *ActionClient) Update() *ActionUpdate
Update returns an update builder for Action.
func (*ActionClient) UpdateOne ¶
func (c *ActionClient) UpdateOne(a *Action) *ActionUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ActionClient) UpdateOneID ¶
func (c *ActionClient) UpdateOneID(id int) *ActionUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ActionClient) Use ¶
func (c *ActionClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `action.Hooks(f(g(h())))`.
type ActionCreate ¶
type ActionCreate struct {
// contains filtered or unexported fields
}
ActionCreate is the builder for creating a Action entity.
func (*ActionCreate) Mutation ¶
func (ac *ActionCreate) Mutation() *ActionMutation
Mutation returns the ActionMutation object of the builder.
func (*ActionCreate) Save ¶
func (ac *ActionCreate) Save(ctx context.Context) (*Action, error)
Save creates the Action in the database.
func (*ActionCreate) SaveX ¶
func (ac *ActionCreate) SaveX(ctx context.Context) *Action
SaveX calls Save and panics if Save returns an error.
func (*ActionCreate) SetArgs ¶
func (ac *ActionCreate) SetArgs(s string) *ActionCreate
SetArgs sets the "args" field.
func (*ActionCreate) SetMode ¶
func (ac *ActionCreate) SetMode(s string) *ActionCreate
SetMode sets the "mode" field.
func (*ActionCreate) SetNillableQueued ¶
func (ac *ActionCreate) SetNillableQueued(b *bool) *ActionCreate
SetNillableQueued sets the "queued" field if the given value is not nil.
func (*ActionCreate) SetNillableResponded ¶
func (ac *ActionCreate) SetNillableResponded(b *bool) *ActionCreate
SetNillableResponded sets the "responded" field if the given value is not nil.
func (*ActionCreate) SetNillableResult ¶
func (ac *ActionCreate) SetNillableResult(s *string) *ActionCreate
SetNillableResult sets the "result" field if the given value is not nil.
func (*ActionCreate) SetNillableTargetingID ¶
func (ac *ActionCreate) SetNillableTargetingID(id *int) *ActionCreate
SetNillableTargetingID sets the "targeting" edge to the Host entity by ID if the given value is not nil.
func (*ActionCreate) SetQueued ¶
func (ac *ActionCreate) SetQueued(b bool) *ActionCreate
SetQueued sets the "queued" field.
func (*ActionCreate) SetResponded ¶
func (ac *ActionCreate) SetResponded(b bool) *ActionCreate
SetResponded sets the "responded" field.
func (*ActionCreate) SetResult ¶
func (ac *ActionCreate) SetResult(s string) *ActionCreate
SetResult sets the "result" field.
func (*ActionCreate) SetTargeting ¶
func (ac *ActionCreate) SetTargeting(h *Host) *ActionCreate
SetTargeting sets the "targeting" edge to the Host entity.
func (*ActionCreate) SetTargetingID ¶
func (ac *ActionCreate) SetTargetingID(id int) *ActionCreate
SetTargetingID sets the "targeting" edge to the Host entity by ID.
func (*ActionCreate) SetUUID ¶
func (ac *ActionCreate) SetUUID(s string) *ActionCreate
SetUUID sets the "uuid" field.
type ActionCreateBulk ¶
type ActionCreateBulk struct {
// contains filtered or unexported fields
}
ActionCreateBulk is the builder for creating many Action entities in bulk.
type ActionDelete ¶
type ActionDelete struct {
// contains filtered or unexported fields
}
ActionDelete is the builder for deleting a Action entity.
func (*ActionDelete) Exec ¶
func (ad *ActionDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ActionDelete) ExecX ¶
func (ad *ActionDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ActionDelete) Where ¶
func (ad *ActionDelete) Where(ps ...predicate.Action) *ActionDelete
Where adds a new predicate to the ActionDelete builder.
type ActionDeleteOne ¶
type ActionDeleteOne struct {
// contains filtered or unexported fields
}
ActionDeleteOne is the builder for deleting a single Action entity.
func (*ActionDeleteOne) Exec ¶
func (ado *ActionDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ActionDeleteOne) ExecX ¶
func (ado *ActionDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ActionEdges ¶
type ActionEdges struct { // Targeting holds the value of the targeting edge. Targeting *Host `json:"targeting,omitempty"` // contains filtered or unexported fields }
ActionEdges holds the relations/edges for other nodes in the graph.
func (ActionEdges) TargetingOrErr ¶
func (e ActionEdges) TargetingOrErr() (*Host, error)
TargetingOrErr returns the Targeting value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type ActionGroupBy ¶
type ActionGroupBy struct {
// contains filtered or unexported fields
}
ActionGroupBy is the group-by builder for Action entities.
func (*ActionGroupBy) Aggregate ¶
func (agb *ActionGroupBy) Aggregate(fns ...AggregateFunc) *ActionGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ActionGroupBy) Bool ¶
func (agb *ActionGroupBy) 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 (*ActionGroupBy) BoolX ¶
func (agb *ActionGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*ActionGroupBy) Bools ¶
func (agb *ActionGroupBy) 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 (*ActionGroupBy) BoolsX ¶
func (agb *ActionGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*ActionGroupBy) Float64 ¶
func (agb *ActionGroupBy) 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 (*ActionGroupBy) Float64X ¶
func (agb *ActionGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*ActionGroupBy) Float64s ¶
func (agb *ActionGroupBy) 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 (*ActionGroupBy) Float64sX ¶
func (agb *ActionGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*ActionGroupBy) Int ¶
func (agb *ActionGroupBy) 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 (*ActionGroupBy) IntX ¶
func (agb *ActionGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*ActionGroupBy) Ints ¶
func (agb *ActionGroupBy) 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 (*ActionGroupBy) IntsX ¶
func (agb *ActionGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*ActionGroupBy) Scan ¶
func (agb *ActionGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*ActionGroupBy) ScanX ¶
func (agb *ActionGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*ActionGroupBy) String ¶
func (agb *ActionGroupBy) 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 (*ActionGroupBy) StringX ¶
func (agb *ActionGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type ActionMutation ¶
type ActionMutation struct {
// contains filtered or unexported fields
}
ActionMutation represents an operation that mutates the Action nodes in the graph.
func (*ActionMutation) AddField ¶
func (m *ActionMutation) 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 (*ActionMutation) AddedEdges ¶
func (m *ActionMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ActionMutation) AddedField ¶
func (m *ActionMutation) 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 (*ActionMutation) AddedFields ¶
func (m *ActionMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ActionMutation) AddedIDs ¶
func (m *ActionMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ActionMutation) Args ¶
func (m *ActionMutation) Args() (r string, exists bool)
Args returns the value of the "args" field in the mutation.
func (*ActionMutation) ClearEdge ¶
func (m *ActionMutation) 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 (*ActionMutation) ClearField ¶
func (m *ActionMutation) 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 (*ActionMutation) ClearTargeting ¶
func (m *ActionMutation) ClearTargeting()
ClearTargeting clears the "targeting" edge to the Host entity.
func (*ActionMutation) ClearedEdges ¶
func (m *ActionMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ActionMutation) ClearedFields ¶
func (m *ActionMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ActionMutation) Client ¶
func (m ActionMutation) 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 (*ActionMutation) EdgeCleared ¶
func (m *ActionMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ActionMutation) Field ¶
func (m *ActionMutation) 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 (*ActionMutation) FieldCleared ¶
func (m *ActionMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ActionMutation) Fields ¶
func (m *ActionMutation) 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 (*ActionMutation) ID ¶
func (m *ActionMutation) 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.
func (*ActionMutation) Mode ¶
func (m *ActionMutation) Mode() (r string, exists bool)
Mode returns the value of the "mode" field in the mutation.
func (*ActionMutation) OldArgs ¶
func (m *ActionMutation) OldArgs(ctx context.Context) (v string, err error)
OldArgs returns the old "args" field's value of the Action entity. If the Action 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 (*ActionMutation) 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 (*ActionMutation) OldMode ¶
func (m *ActionMutation) OldMode(ctx context.Context) (v string, err error)
OldMode returns the old "mode" field's value of the Action entity. If the Action 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 (*ActionMutation) OldQueued ¶
func (m *ActionMutation) OldQueued(ctx context.Context) (v bool, err error)
OldQueued returns the old "queued" field's value of the Action entity. If the Action 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 (*ActionMutation) OldResponded ¶
func (m *ActionMutation) OldResponded(ctx context.Context) (v bool, err error)
OldResponded returns the old "responded" field's value of the Action entity. If the Action 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 (*ActionMutation) OldResult ¶
func (m *ActionMutation) OldResult(ctx context.Context) (v string, err error)
OldResult returns the old "result" field's value of the Action entity. If the Action 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 (*ActionMutation) OldUUID ¶
func (m *ActionMutation) OldUUID(ctx context.Context) (v string, err error)
OldUUID returns the old "uuid" field's value of the Action entity. If the Action 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 (*ActionMutation) Queued ¶
func (m *ActionMutation) Queued() (r bool, exists bool)
Queued returns the value of the "queued" field in the mutation.
func (*ActionMutation) RemovedEdges ¶
func (m *ActionMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ActionMutation) RemovedIDs ¶
func (m *ActionMutation) 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 (*ActionMutation) ResetArgs ¶
func (m *ActionMutation) ResetArgs()
ResetArgs resets all changes to the "args" field.
func (*ActionMutation) ResetEdge ¶
func (m *ActionMutation) 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 (*ActionMutation) ResetField ¶
func (m *ActionMutation) 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 (*ActionMutation) ResetMode ¶
func (m *ActionMutation) ResetMode()
ResetMode resets all changes to the "mode" field.
func (*ActionMutation) ResetQueued ¶
func (m *ActionMutation) ResetQueued()
ResetQueued resets all changes to the "queued" field.
func (*ActionMutation) ResetResponded ¶
func (m *ActionMutation) ResetResponded()
ResetResponded resets all changes to the "responded" field.
func (*ActionMutation) ResetResult ¶
func (m *ActionMutation) ResetResult()
ResetResult resets all changes to the "result" field.
func (*ActionMutation) ResetTargeting ¶
func (m *ActionMutation) ResetTargeting()
ResetTargeting resets all changes to the "targeting" edge.
func (*ActionMutation) ResetUUID ¶
func (m *ActionMutation) ResetUUID()
ResetUUID resets all changes to the "uuid" field.
func (*ActionMutation) Responded ¶
func (m *ActionMutation) Responded() (r bool, exists bool)
Responded returns the value of the "responded" field in the mutation.
func (*ActionMutation) Result ¶
func (m *ActionMutation) Result() (r string, exists bool)
Result returns the value of the "result" field in the mutation.
func (*ActionMutation) SetArgs ¶
func (m *ActionMutation) SetArgs(s string)
SetArgs sets the "args" field.
func (*ActionMutation) SetField ¶
func (m *ActionMutation) 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 (*ActionMutation) SetMode ¶
func (m *ActionMutation) SetMode(s string)
SetMode sets the "mode" field.
func (*ActionMutation) SetQueued ¶
func (m *ActionMutation) SetQueued(b bool)
SetQueued sets the "queued" field.
func (*ActionMutation) SetResponded ¶
func (m *ActionMutation) SetResponded(b bool)
SetResponded sets the "responded" field.
func (*ActionMutation) SetResult ¶
func (m *ActionMutation) SetResult(s string)
SetResult sets the "result" field.
func (*ActionMutation) SetTargetingID ¶
func (m *ActionMutation) SetTargetingID(id int)
SetTargetingID sets the "targeting" edge to the Host entity by id.
func (*ActionMutation) SetUUID ¶
func (m *ActionMutation) SetUUID(s string)
SetUUID sets the "uuid" field.
func (*ActionMutation) TargetingCleared ¶
func (m *ActionMutation) TargetingCleared() bool
TargetingCleared returns if the "targeting" edge to the Host entity was cleared.
func (*ActionMutation) TargetingID ¶
func (m *ActionMutation) TargetingID() (id int, exists bool)
TargetingID returns the "targeting" edge ID in the mutation.
func (*ActionMutation) TargetingIDs ¶
func (m *ActionMutation) TargetingIDs() (ids []int)
TargetingIDs returns the "targeting" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TargetingID instead. It exists only for internal usage by the builders.
func (ActionMutation) Tx ¶
func (m ActionMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ActionMutation) Type ¶
func (m *ActionMutation) Type() string
Type returns the node type of this mutation (Action).
func (*ActionMutation) UUID ¶
func (m *ActionMutation) UUID() (r string, exists bool)
UUID returns the value of the "uuid" field in the mutation.
type ActionQuery ¶
type ActionQuery struct {
// contains filtered or unexported fields
}
ActionQuery is the builder for querying Action entities.
func (*ActionQuery) All ¶
func (aq *ActionQuery) All(ctx context.Context) ([]*Action, error)
All executes the query and returns a list of Actions.
func (*ActionQuery) AllX ¶
func (aq *ActionQuery) AllX(ctx context.Context) []*Action
AllX is like All, but panics if an error occurs.
func (*ActionQuery) Clone ¶
func (aq *ActionQuery) Clone() *ActionQuery
Clone returns a duplicate of the ActionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ActionQuery) Count ¶
func (aq *ActionQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ActionQuery) CountX ¶
func (aq *ActionQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ActionQuery) Exist ¶
func (aq *ActionQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ActionQuery) ExistX ¶
func (aq *ActionQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ActionQuery) First ¶
func (aq *ActionQuery) First(ctx context.Context) (*Action, error)
First returns the first Action entity from the query. Returns a *NotFoundError when no Action was found.
func (*ActionQuery) FirstID ¶
func (aq *ActionQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Action ID from the query. Returns a *NotFoundError when no Action ID was found.
func (*ActionQuery) FirstIDX ¶
func (aq *ActionQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ActionQuery) FirstX ¶
func (aq *ActionQuery) FirstX(ctx context.Context) *Action
FirstX is like First, but panics if an error occurs.
func (*ActionQuery) GroupBy ¶
func (aq *ActionQuery) GroupBy(field string, fields ...string) *ActionGroupBy
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 { UUID string `json:"uuid,omitempty"` Count int `json:"count,omitempty"` } client.Action.Query(). GroupBy(action.FieldUUID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ActionQuery) IDs ¶
func (aq *ActionQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of Action IDs.
func (*ActionQuery) IDsX ¶
func (aq *ActionQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ActionQuery) Limit ¶
func (aq *ActionQuery) Limit(limit int) *ActionQuery
Limit adds a limit step to the query.
func (*ActionQuery) Offset ¶
func (aq *ActionQuery) Offset(offset int) *ActionQuery
Offset adds an offset step to the query.
func (*ActionQuery) Only ¶
func (aq *ActionQuery) Only(ctx context.Context) (*Action, error)
Only returns a single Action entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one Action entity is not found. Returns a *NotFoundError when no Action entities are found.
func (*ActionQuery) OnlyID ¶
func (aq *ActionQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Action ID in the query. Returns a *NotSingularError when exactly one Action ID is not found. Returns a *NotFoundError when no entities are found.
func (*ActionQuery) OnlyIDX ¶
func (aq *ActionQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ActionQuery) OnlyX ¶
func (aq *ActionQuery) OnlyX(ctx context.Context) *Action
OnlyX is like Only, but panics if an error occurs.
func (*ActionQuery) Order ¶
func (aq *ActionQuery) Order(o ...OrderFunc) *ActionQuery
Order adds an order step to the query.
func (*ActionQuery) QueryTargeting ¶
func (aq *ActionQuery) QueryTargeting() *HostQuery
QueryTargeting chains the current query on the "targeting" edge.
func (*ActionQuery) Select ¶
func (aq *ActionQuery) Select(field string, fields ...string) *ActionSelect
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 { UUID string `json:"uuid,omitempty"` } client.Action.Query(). Select(action.FieldUUID). Scan(ctx, &v)
func (*ActionQuery) Where ¶
func (aq *ActionQuery) Where(ps ...predicate.Action) *ActionQuery
Where adds a new predicate for the ActionQuery builder.
func (*ActionQuery) WithTargeting ¶
func (aq *ActionQuery) WithTargeting(opts ...func(*HostQuery)) *ActionQuery
WithTargeting tells the query-builder to eager-load the nodes that are connected to the "targeting" edge. The optional arguments are used to configure the query builder of the edge.
type ActionSelect ¶
type ActionSelect struct { *ActionQuery // contains filtered or unexported fields }
ActionSelect is the builder for selecting fields of Action entities.
func (*ActionSelect) Bool ¶
func (as *ActionSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ActionSelect) BoolX ¶
func (as *ActionSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*ActionSelect) Bools ¶
func (as *ActionSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ActionSelect) BoolsX ¶
func (as *ActionSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*ActionSelect) Float64 ¶
func (as *ActionSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ActionSelect) Float64X ¶
func (as *ActionSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*ActionSelect) Float64s ¶
func (as *ActionSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ActionSelect) Float64sX ¶
func (as *ActionSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*ActionSelect) Int ¶
func (as *ActionSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ActionSelect) IntX ¶
func (as *ActionSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*ActionSelect) Ints ¶
func (as *ActionSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ActionSelect) IntsX ¶
func (as *ActionSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*ActionSelect) Scan ¶
func (as *ActionSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*ActionSelect) ScanX ¶
func (as *ActionSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*ActionSelect) String ¶
func (as *ActionSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*ActionSelect) StringX ¶
func (as *ActionSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type ActionUpdate ¶
type ActionUpdate struct {
// contains filtered or unexported fields
}
ActionUpdate is the builder for updating Action entities.
func (*ActionUpdate) ClearTargeting ¶
func (au *ActionUpdate) ClearTargeting() *ActionUpdate
ClearTargeting clears the "targeting" edge to the Host entity.
func (*ActionUpdate) Exec ¶
func (au *ActionUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ActionUpdate) ExecX ¶
func (au *ActionUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ActionUpdate) Mutation ¶
func (au *ActionUpdate) Mutation() *ActionMutation
Mutation returns the ActionMutation object of the builder.
func (*ActionUpdate) Save ¶
func (au *ActionUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ActionUpdate) SaveX ¶
func (au *ActionUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ActionUpdate) SetArgs ¶
func (au *ActionUpdate) SetArgs(s string) *ActionUpdate
SetArgs sets the "args" field.
func (*ActionUpdate) SetMode ¶
func (au *ActionUpdate) SetMode(s string) *ActionUpdate
SetMode sets the "mode" field.
func (*ActionUpdate) SetNillableQueued ¶
func (au *ActionUpdate) SetNillableQueued(b *bool) *ActionUpdate
SetNillableQueued sets the "queued" field if the given value is not nil.
func (*ActionUpdate) SetNillableResponded ¶
func (au *ActionUpdate) SetNillableResponded(b *bool) *ActionUpdate
SetNillableResponded sets the "responded" field if the given value is not nil.
func (*ActionUpdate) SetNillableResult ¶
func (au *ActionUpdate) SetNillableResult(s *string) *ActionUpdate
SetNillableResult sets the "result" field if the given value is not nil.
func (*ActionUpdate) SetNillableTargetingID ¶
func (au *ActionUpdate) SetNillableTargetingID(id *int) *ActionUpdate
SetNillableTargetingID sets the "targeting" edge to the Host entity by ID if the given value is not nil.
func (*ActionUpdate) SetQueued ¶
func (au *ActionUpdate) SetQueued(b bool) *ActionUpdate
SetQueued sets the "queued" field.
func (*ActionUpdate) SetResponded ¶
func (au *ActionUpdate) SetResponded(b bool) *ActionUpdate
SetResponded sets the "responded" field.
func (*ActionUpdate) SetResult ¶
func (au *ActionUpdate) SetResult(s string) *ActionUpdate
SetResult sets the "result" field.
func (*ActionUpdate) SetTargeting ¶
func (au *ActionUpdate) SetTargeting(h *Host) *ActionUpdate
SetTargeting sets the "targeting" edge to the Host entity.
func (*ActionUpdate) SetTargetingID ¶
func (au *ActionUpdate) SetTargetingID(id int) *ActionUpdate
SetTargetingID sets the "targeting" edge to the Host entity by ID.
func (*ActionUpdate) SetUUID ¶
func (au *ActionUpdate) SetUUID(s string) *ActionUpdate
SetUUID sets the "uuid" field.
func (*ActionUpdate) Where ¶
func (au *ActionUpdate) Where(ps ...predicate.Action) *ActionUpdate
Where adds a new predicate for the ActionUpdate builder.
type ActionUpdateOne ¶
type ActionUpdateOne struct {
// contains filtered or unexported fields
}
ActionUpdateOne is the builder for updating a single Action entity.
func (*ActionUpdateOne) ClearTargeting ¶
func (auo *ActionUpdateOne) ClearTargeting() *ActionUpdateOne
ClearTargeting clears the "targeting" edge to the Host entity.
func (*ActionUpdateOne) Exec ¶
func (auo *ActionUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ActionUpdateOne) ExecX ¶
func (auo *ActionUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ActionUpdateOne) Mutation ¶
func (auo *ActionUpdateOne) Mutation() *ActionMutation
Mutation returns the ActionMutation object of the builder.
func (*ActionUpdateOne) Save ¶
func (auo *ActionUpdateOne) Save(ctx context.Context) (*Action, error)
Save executes the query and returns the updated Action entity.
func (*ActionUpdateOne) SaveX ¶
func (auo *ActionUpdateOne) SaveX(ctx context.Context) *Action
SaveX is like Save, but panics if an error occurs.
func (*ActionUpdateOne) SetArgs ¶
func (auo *ActionUpdateOne) SetArgs(s string) *ActionUpdateOne
SetArgs sets the "args" field.
func (*ActionUpdateOne) SetMode ¶
func (auo *ActionUpdateOne) SetMode(s string) *ActionUpdateOne
SetMode sets the "mode" field.
func (*ActionUpdateOne) SetNillableQueued ¶
func (auo *ActionUpdateOne) SetNillableQueued(b *bool) *ActionUpdateOne
SetNillableQueued sets the "queued" field if the given value is not nil.
func (*ActionUpdateOne) SetNillableResponded ¶
func (auo *ActionUpdateOne) SetNillableResponded(b *bool) *ActionUpdateOne
SetNillableResponded sets the "responded" field if the given value is not nil.
func (*ActionUpdateOne) SetNillableResult ¶
func (auo *ActionUpdateOne) SetNillableResult(s *string) *ActionUpdateOne
SetNillableResult sets the "result" field if the given value is not nil.
func (*ActionUpdateOne) SetNillableTargetingID ¶
func (auo *ActionUpdateOne) SetNillableTargetingID(id *int) *ActionUpdateOne
SetNillableTargetingID sets the "targeting" edge to the Host entity by ID if the given value is not nil.
func (*ActionUpdateOne) SetQueued ¶
func (auo *ActionUpdateOne) SetQueued(b bool) *ActionUpdateOne
SetQueued sets the "queued" field.
func (*ActionUpdateOne) SetResponded ¶
func (auo *ActionUpdateOne) SetResponded(b bool) *ActionUpdateOne
SetResponded sets the "responded" field.
func (*ActionUpdateOne) SetResult ¶
func (auo *ActionUpdateOne) SetResult(s string) *ActionUpdateOne
SetResult sets the "result" field.
func (*ActionUpdateOne) SetTargeting ¶
func (auo *ActionUpdateOne) SetTargeting(h *Host) *ActionUpdateOne
SetTargeting sets the "targeting" edge to the Host entity.
func (*ActionUpdateOne) SetTargetingID ¶
func (auo *ActionUpdateOne) SetTargetingID(id int) *ActionUpdateOne
SetTargetingID sets the "targeting" edge to the Host entity by ID.
func (*ActionUpdateOne) SetUUID ¶
func (auo *ActionUpdateOne) SetUUID(s string) *ActionUpdateOne
SetUUID sets the "uuid" field.
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 Bot ¶
type Bot struct { // ID of the ent. ID int `json:"id,omitempty"` // UUID holds the value of the "uuid" field. UUID string `json:"uuid,omitempty"` // Interval holds the value of the "interval" field. Interval int `json:"interval,omitempty"` // Delta holds the value of the "delta" field. Delta int `json:"delta,omitempty"` // LastSeen holds the value of the "lastSeen" field. LastSeen int `json:"lastSeen,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the BotQuery when eager-loading is set. Edges BotEdges `json:"edges"` // contains filtered or unexported fields }
Bot is the model entity for the Bot schema.
func (*Bot) QueryInfecting ¶
QueryInfecting queries the "infecting" edge of the Bot entity.
func (*Bot) Unwrap ¶
Unwrap unwraps the Bot 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 (*Bot) Update ¶
func (b *Bot) Update() *BotUpdateOne
Update returns a builder for updating this Bot. Note that you need to call Bot.Unwrap() before calling this method if this Bot was returned from a transaction, and the transaction was committed or rolled back.
type BotClient ¶
type BotClient struct {
// contains filtered or unexported fields
}
BotClient is a client for the Bot schema.
func NewBotClient ¶
func NewBotClient(c config) *BotClient
NewBotClient returns a client for the Bot from the given config.
func (*BotClient) CreateBulk ¶
func (c *BotClient) CreateBulk(builders ...*BotCreate) *BotCreateBulk
CreateBulk returns a builder for creating a bulk of Bot entities.
func (*BotClient) DeleteOne ¶
func (c *BotClient) DeleteOne(b *Bot) *BotDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*BotClient) DeleteOneID ¶
func (c *BotClient) DeleteOneID(id int) *BotDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*BotClient) QueryInfecting ¶
QueryInfecting queries the infecting edge of a Bot.
func (*BotClient) UpdateOne ¶
func (c *BotClient) UpdateOne(b *Bot) *BotUpdateOne
UpdateOne returns an update builder for the given entity.
func (*BotClient) UpdateOneID ¶
func (c *BotClient) UpdateOneID(id int) *BotUpdateOne
UpdateOneID returns an update builder for the given id.
type BotCreate ¶
type BotCreate struct {
// contains filtered or unexported fields
}
BotCreate is the builder for creating a Bot entity.
func (*BotCreate) Mutation ¶
func (bc *BotCreate) Mutation() *BotMutation
Mutation returns the BotMutation object of the builder.
func (*BotCreate) SetInfecting ¶
SetInfecting sets the "infecting" edge to the Host entity.
func (*BotCreate) SetInfectingID ¶
SetInfectingID sets the "infecting" edge to the Host entity by ID.
func (*BotCreate) SetInterval ¶
SetInterval sets the "interval" field.
func (*BotCreate) SetLastSeen ¶
SetLastSeen sets the "lastSeen" field.
func (*BotCreate) SetNillableInfectingID ¶
SetNillableInfectingID sets the "infecting" edge to the Host entity by ID if the given value is not nil.
func (*BotCreate) SetNillableLastSeen ¶
SetNillableLastSeen sets the "lastSeen" field if the given value is not nil.
type BotCreateBulk ¶
type BotCreateBulk struct {
// contains filtered or unexported fields
}
BotCreateBulk is the builder for creating many Bot entities in bulk.
type BotDelete ¶
type BotDelete struct {
// contains filtered or unexported fields
}
BotDelete is the builder for deleting a Bot entity.
func (*BotDelete) Exec ¶
Exec executes the deletion query and returns how many vertices were deleted.
type BotDeleteOne ¶
type BotDeleteOne struct {
// contains filtered or unexported fields
}
BotDeleteOne is the builder for deleting a single Bot entity.
func (*BotDeleteOne) Exec ¶
func (bdo *BotDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*BotDeleteOne) ExecX ¶
func (bdo *BotDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type BotEdges ¶
type BotEdges struct { // Infecting holds the value of the infecting edge. Infecting *Host `json:"infecting,omitempty"` // contains filtered or unexported fields }
BotEdges holds the relations/edges for other nodes in the graph.
func (BotEdges) InfectingOrErr ¶
InfectingOrErr returns the Infecting value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type BotGroupBy ¶
type BotGroupBy struct {
// contains filtered or unexported fields
}
BotGroupBy is the group-by builder for Bot entities.
func (*BotGroupBy) Aggregate ¶
func (bgb *BotGroupBy) Aggregate(fns ...AggregateFunc) *BotGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*BotGroupBy) Bool ¶
func (bgb *BotGroupBy) 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 (*BotGroupBy) BoolX ¶
func (bgb *BotGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*BotGroupBy) Bools ¶
func (bgb *BotGroupBy) 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 (*BotGroupBy) BoolsX ¶
func (bgb *BotGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*BotGroupBy) Float64 ¶
func (bgb *BotGroupBy) 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 (*BotGroupBy) Float64X ¶
func (bgb *BotGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*BotGroupBy) Float64s ¶
func (bgb *BotGroupBy) 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 (*BotGroupBy) Float64sX ¶
func (bgb *BotGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*BotGroupBy) Int ¶
func (bgb *BotGroupBy) 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 (*BotGroupBy) IntX ¶
func (bgb *BotGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*BotGroupBy) Ints ¶
func (bgb *BotGroupBy) 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 (*BotGroupBy) IntsX ¶
func (bgb *BotGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*BotGroupBy) Scan ¶
func (bgb *BotGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*BotGroupBy) ScanX ¶
func (bgb *BotGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*BotGroupBy) String ¶
func (bgb *BotGroupBy) 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 (*BotGroupBy) StringX ¶
func (bgb *BotGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type BotMutation ¶
type BotMutation struct {
// contains filtered or unexported fields
}
BotMutation represents an operation that mutates the Bot nodes in the graph.
func (*BotMutation) AddDelta ¶
func (m *BotMutation) AddDelta(i int)
AddDelta adds i to the "delta" field.
func (*BotMutation) AddField ¶
func (m *BotMutation) 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 (*BotMutation) AddInterval ¶
func (m *BotMutation) AddInterval(i int)
AddInterval adds i to the "interval" field.
func (*BotMutation) AddLastSeen ¶
func (m *BotMutation) AddLastSeen(i int)
AddLastSeen adds i to the "lastSeen" field.
func (*BotMutation) AddedDelta ¶
func (m *BotMutation) AddedDelta() (r int, exists bool)
AddedDelta returns the value that was added to the "delta" field in this mutation.
func (*BotMutation) AddedEdges ¶
func (m *BotMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*BotMutation) AddedField ¶
func (m *BotMutation) 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 (*BotMutation) AddedFields ¶
func (m *BotMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*BotMutation) AddedIDs ¶
func (m *BotMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*BotMutation) AddedInterval ¶
func (m *BotMutation) AddedInterval() (r int, exists bool)
AddedInterval returns the value that was added to the "interval" field in this mutation.
func (*BotMutation) AddedLastSeen ¶
func (m *BotMutation) AddedLastSeen() (r int, exists bool)
AddedLastSeen returns the value that was added to the "lastSeen" field in this mutation.
func (*BotMutation) ClearEdge ¶
func (m *BotMutation) 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 (*BotMutation) ClearField ¶
func (m *BotMutation) 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 (*BotMutation) ClearInfecting ¶
func (m *BotMutation) ClearInfecting()
ClearInfecting clears the "infecting" edge to the Host entity.
func (*BotMutation) ClearedEdges ¶
func (m *BotMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*BotMutation) ClearedFields ¶
func (m *BotMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (BotMutation) Client ¶
func (m BotMutation) 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 (*BotMutation) Delta ¶
func (m *BotMutation) Delta() (r int, exists bool)
Delta returns the value of the "delta" field in the mutation.
func (*BotMutation) EdgeCleared ¶
func (m *BotMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*BotMutation) Field ¶
func (m *BotMutation) 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 (*BotMutation) FieldCleared ¶
func (m *BotMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*BotMutation) Fields ¶
func (m *BotMutation) 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 (*BotMutation) ID ¶
func (m *BotMutation) 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.
func (*BotMutation) InfectingCleared ¶
func (m *BotMutation) InfectingCleared() bool
InfectingCleared returns if the "infecting" edge to the Host entity was cleared.
func (*BotMutation) InfectingID ¶
func (m *BotMutation) InfectingID() (id int, exists bool)
InfectingID returns the "infecting" edge ID in the mutation.
func (*BotMutation) InfectingIDs ¶
func (m *BotMutation) InfectingIDs() (ids []int)
InfectingIDs returns the "infecting" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use InfectingID instead. It exists only for internal usage by the builders.
func (*BotMutation) Interval ¶
func (m *BotMutation) Interval() (r int, exists bool)
Interval returns the value of the "interval" field in the mutation.
func (*BotMutation) LastSeen ¶
func (m *BotMutation) LastSeen() (r int, exists bool)
LastSeen returns the value of the "lastSeen" field in the mutation.
func (*BotMutation) OldDelta ¶
func (m *BotMutation) OldDelta(ctx context.Context) (v int, err error)
OldDelta returns the old "delta" field's value of the Bot entity. If the Bot 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 (*BotMutation) 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 (*BotMutation) OldInterval ¶
func (m *BotMutation) OldInterval(ctx context.Context) (v int, err error)
OldInterval returns the old "interval" field's value of the Bot entity. If the Bot 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 (*BotMutation) OldLastSeen ¶
func (m *BotMutation) OldLastSeen(ctx context.Context) (v int, err error)
OldLastSeen returns the old "lastSeen" field's value of the Bot entity. If the Bot 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 (*BotMutation) OldUUID ¶
func (m *BotMutation) OldUUID(ctx context.Context) (v string, err error)
OldUUID returns the old "uuid" field's value of the Bot entity. If the Bot 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 (*BotMutation) RemovedEdges ¶
func (m *BotMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*BotMutation) RemovedIDs ¶
func (m *BotMutation) 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 (*BotMutation) ResetDelta ¶
func (m *BotMutation) ResetDelta()
ResetDelta resets all changes to the "delta" field.
func (*BotMutation) ResetEdge ¶
func (m *BotMutation) 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 (*BotMutation) ResetField ¶
func (m *BotMutation) 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 (*BotMutation) ResetInfecting ¶
func (m *BotMutation) ResetInfecting()
ResetInfecting resets all changes to the "infecting" edge.
func (*BotMutation) ResetInterval ¶
func (m *BotMutation) ResetInterval()
ResetInterval resets all changes to the "interval" field.
func (*BotMutation) ResetLastSeen ¶
func (m *BotMutation) ResetLastSeen()
ResetLastSeen resets all changes to the "lastSeen" field.
func (*BotMutation) ResetUUID ¶
func (m *BotMutation) ResetUUID()
ResetUUID resets all changes to the "uuid" field.
func (*BotMutation) SetDelta ¶
func (m *BotMutation) SetDelta(i int)
SetDelta sets the "delta" field.
func (*BotMutation) SetField ¶
func (m *BotMutation) 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 (*BotMutation) SetInfectingID ¶
func (m *BotMutation) SetInfectingID(id int)
SetInfectingID sets the "infecting" edge to the Host entity by id.
func (*BotMutation) SetInterval ¶
func (m *BotMutation) SetInterval(i int)
SetInterval sets the "interval" field.
func (*BotMutation) SetLastSeen ¶
func (m *BotMutation) SetLastSeen(i int)
SetLastSeen sets the "lastSeen" field.
func (*BotMutation) SetUUID ¶
func (m *BotMutation) SetUUID(s string)
SetUUID sets the "uuid" field.
func (BotMutation) Tx ¶
func (m BotMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*BotMutation) Type ¶
func (m *BotMutation) Type() string
Type returns the node type of this mutation (Bot).
func (*BotMutation) UUID ¶
func (m *BotMutation) UUID() (r string, exists bool)
UUID returns the value of the "uuid" field in the mutation.
type BotQuery ¶
type BotQuery struct {
// contains filtered or unexported fields
}
BotQuery is the builder for querying Bot entities.
func (*BotQuery) Clone ¶
Clone returns a duplicate of the BotQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*BotQuery) First ¶
First returns the first Bot entity from the query. Returns a *NotFoundError when no Bot was found.
func (*BotQuery) FirstID ¶
FirstID returns the first Bot ID from the query. Returns a *NotFoundError when no Bot ID was found.
func (*BotQuery) GroupBy ¶
func (bq *BotQuery) GroupBy(field string, fields ...string) *BotGroupBy
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 { UUID string `json:"uuid,omitempty"` Count int `json:"count,omitempty"` } client.Bot.Query(). GroupBy(bot.FieldUUID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*BotQuery) Only ¶
Only returns a single Bot entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one Bot entity is not found. Returns a *NotFoundError when no Bot entities are found.
func (*BotQuery) OnlyID ¶
OnlyID is like Only, but returns the only Bot ID in the query. Returns a *NotSingularError when exactly one Bot ID is not found. Returns a *NotFoundError when no entities are found.
func (*BotQuery) QueryInfecting ¶
QueryInfecting chains the current query on the "infecting" edge.
func (*BotQuery) 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 { UUID string `json:"uuid,omitempty"` } client.Bot.Query(). Select(bot.FieldUUID). Scan(ctx, &v)
func (*BotQuery) WithInfecting ¶
WithInfecting tells the query-builder to eager-load the nodes that are connected to the "infecting" edge. The optional arguments are used to configure the query builder of the edge.
type BotSelect ¶
type BotSelect struct { *BotQuery // contains filtered or unexported fields }
BotSelect is the builder for selecting fields of Bot entities.
func (*BotSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BotSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BotSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BotSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BotSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BotSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BotSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BotUpdate ¶
type BotUpdate struct {
// contains filtered or unexported fields
}
BotUpdate is the builder for updating Bot entities.
func (*BotUpdate) AddInterval ¶
AddInterval adds i to the "interval" field.
func (*BotUpdate) AddLastSeen ¶
AddLastSeen adds i to the "lastSeen" field.
func (*BotUpdate) ClearInfecting ¶
ClearInfecting clears the "infecting" edge to the Host entity.
func (*BotUpdate) Mutation ¶
func (bu *BotUpdate) Mutation() *BotMutation
Mutation returns the BotMutation object of the builder.
func (*BotUpdate) Save ¶
Save executes the query and returns the number of nodes affected by the update operation.
func (*BotUpdate) SetInfecting ¶
SetInfecting sets the "infecting" edge to the Host entity.
func (*BotUpdate) SetInfectingID ¶
SetInfectingID sets the "infecting" edge to the Host entity by ID.
func (*BotUpdate) SetInterval ¶
SetInterval sets the "interval" field.
func (*BotUpdate) SetLastSeen ¶
SetLastSeen sets the "lastSeen" field.
func (*BotUpdate) SetNillableInfectingID ¶
SetNillableInfectingID sets the "infecting" edge to the Host entity by ID if the given value is not nil.
func (*BotUpdate) SetNillableLastSeen ¶
SetNillableLastSeen sets the "lastSeen" field if the given value is not nil.
type BotUpdateOne ¶
type BotUpdateOne struct {
// contains filtered or unexported fields
}
BotUpdateOne is the builder for updating a single Bot entity.
func (*BotUpdateOne) AddDelta ¶
func (buo *BotUpdateOne) AddDelta(i int) *BotUpdateOne
AddDelta adds i to the "delta" field.
func (*BotUpdateOne) AddInterval ¶
func (buo *BotUpdateOne) AddInterval(i int) *BotUpdateOne
AddInterval adds i to the "interval" field.
func (*BotUpdateOne) AddLastSeen ¶
func (buo *BotUpdateOne) AddLastSeen(i int) *BotUpdateOne
AddLastSeen adds i to the "lastSeen" field.
func (*BotUpdateOne) ClearInfecting ¶
func (buo *BotUpdateOne) ClearInfecting() *BotUpdateOne
ClearInfecting clears the "infecting" edge to the Host entity.
func (*BotUpdateOne) Exec ¶
func (buo *BotUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*BotUpdateOne) ExecX ¶
func (buo *BotUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BotUpdateOne) Mutation ¶
func (buo *BotUpdateOne) Mutation() *BotMutation
Mutation returns the BotMutation object of the builder.
func (*BotUpdateOne) Save ¶
func (buo *BotUpdateOne) Save(ctx context.Context) (*Bot, error)
Save executes the query and returns the updated Bot entity.
func (*BotUpdateOne) SaveX ¶
func (buo *BotUpdateOne) SaveX(ctx context.Context) *Bot
SaveX is like Save, but panics if an error occurs.
func (*BotUpdateOne) SetDelta ¶
func (buo *BotUpdateOne) SetDelta(i int) *BotUpdateOne
SetDelta sets the "delta" field.
func (*BotUpdateOne) SetInfecting ¶
func (buo *BotUpdateOne) SetInfecting(h *Host) *BotUpdateOne
SetInfecting sets the "infecting" edge to the Host entity.
func (*BotUpdateOne) SetInfectingID ¶
func (buo *BotUpdateOne) SetInfectingID(id int) *BotUpdateOne
SetInfectingID sets the "infecting" edge to the Host entity by ID.
func (*BotUpdateOne) SetInterval ¶
func (buo *BotUpdateOne) SetInterval(i int) *BotUpdateOne
SetInterval sets the "interval" field.
func (*BotUpdateOne) SetLastSeen ¶
func (buo *BotUpdateOne) SetLastSeen(i int) *BotUpdateOne
SetLastSeen sets the "lastSeen" field.
func (*BotUpdateOne) SetNillableInfectingID ¶
func (buo *BotUpdateOne) SetNillableInfectingID(id *int) *BotUpdateOne
SetNillableInfectingID sets the "infecting" edge to the Host entity by ID if the given value is not nil.
func (*BotUpdateOne) SetNillableLastSeen ¶
func (buo *BotUpdateOne) SetNillableLastSeen(i *int) *BotUpdateOne
SetNillableLastSeen sets the "lastSeen" field if the given value is not nil.
func (*BotUpdateOne) SetUUID ¶
func (buo *BotUpdateOne) SetUUID(s string) *BotUpdateOne
SetUUID sets the "uuid" field.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Action is the client for interacting with the Action builders. Action *ActionClient // Bot is the client for interacting with the Bot builders. Bot *BotClient // Group is the client for interacting with the Group builders. Group *GroupClient // Host is the client for interacting with the Host builders. Host *HostClient // User is the client for interacting with the User builders. User *UserClient // 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(). Action. 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(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 Group ¶
type Group struct { // ID of the ent. ID int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Desc holds the value of the "desc" field. Desc string `json:"desc,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the GroupQuery when eager-loading is set. Edges GroupEdges `json:"edges"` // contains filtered or unexported fields }
Group is the model entity for the Group schema.
func (*Group) QueryMembers ¶
QueryMembers queries the "members" edge of the Group entity.
func (*Group) Unwrap ¶
Unwrap unwraps the Group 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 (*Group) Update ¶
func (gr *Group) Update() *GroupUpdateOne
Update returns a builder for updating this Group. Note that you need to call Group.Unwrap() before calling this method if this Group was returned from a transaction, and the transaction was committed or rolled back.
type GroupClient ¶
type GroupClient struct {
// contains filtered or unexported fields
}
GroupClient is a client for the Group schema.
func NewGroupClient ¶
func NewGroupClient(c config) *GroupClient
NewGroupClient returns a client for the Group from the given config.
func (*GroupClient) Create ¶
func (c *GroupClient) Create() *GroupCreate
Create returns a create builder for Group.
func (*GroupClient) CreateBulk ¶
func (c *GroupClient) CreateBulk(builders ...*GroupCreate) *GroupCreateBulk
CreateBulk returns a builder for creating a bulk of Group entities.
func (*GroupClient) Delete ¶
func (c *GroupClient) Delete() *GroupDelete
Delete returns a delete builder for Group.
func (*GroupClient) DeleteOne ¶
func (c *GroupClient) DeleteOne(gr *Group) *GroupDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*GroupClient) DeleteOneID ¶
func (c *GroupClient) DeleteOneID(id int) *GroupDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*GroupClient) GetX ¶
func (c *GroupClient) GetX(ctx context.Context, id int) *Group
GetX is like Get, but panics if an error occurs.
func (*GroupClient) Query ¶
func (c *GroupClient) Query() *GroupQuery
Query returns a query builder for Group.
func (*GroupClient) QueryMembers ¶
func (c *GroupClient) QueryMembers(gr *Group) *HostQuery
QueryMembers queries the members edge of a Group.
func (*GroupClient) Update ¶
func (c *GroupClient) Update() *GroupUpdate
Update returns an update builder for Group.
func (*GroupClient) UpdateOne ¶
func (c *GroupClient) UpdateOne(gr *Group) *GroupUpdateOne
UpdateOne returns an update builder for the given entity.
func (*GroupClient) UpdateOneID ¶
func (c *GroupClient) UpdateOneID(id int) *GroupUpdateOne
UpdateOneID returns an update builder for the given id.
func (*GroupClient) Use ¶
func (c *GroupClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `group.Hooks(f(g(h())))`.
type GroupCreate ¶
type GroupCreate struct {
// contains filtered or unexported fields
}
GroupCreate is the builder for creating a Group entity.
func (*GroupCreate) AddMemberIDs ¶
func (gc *GroupCreate) AddMemberIDs(ids ...int) *GroupCreate
AddMemberIDs adds the "members" edge to the Host entity by IDs.
func (*GroupCreate) AddMembers ¶
func (gc *GroupCreate) AddMembers(h ...*Host) *GroupCreate
AddMembers adds the "members" edges to the Host entity.
func (*GroupCreate) Mutation ¶
func (gc *GroupCreate) Mutation() *GroupMutation
Mutation returns the GroupMutation object of the builder.
func (*GroupCreate) Save ¶
func (gc *GroupCreate) Save(ctx context.Context) (*Group, error)
Save creates the Group in the database.
func (*GroupCreate) SaveX ¶
func (gc *GroupCreate) SaveX(ctx context.Context) *Group
SaveX calls Save and panics if Save returns an error.
func (*GroupCreate) SetDesc ¶
func (gc *GroupCreate) SetDesc(s string) *GroupCreate
SetDesc sets the "desc" field.
func (*GroupCreate) SetName ¶
func (gc *GroupCreate) SetName(s string) *GroupCreate
SetName sets the "name" field.
type GroupCreateBulk ¶
type GroupCreateBulk struct {
// contains filtered or unexported fields
}
GroupCreateBulk is the builder for creating many Group entities in bulk.
type GroupDelete ¶
type GroupDelete struct {
// contains filtered or unexported fields
}
GroupDelete is the builder for deleting a Group entity.
func (*GroupDelete) Exec ¶
func (gd *GroupDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*GroupDelete) ExecX ¶
func (gd *GroupDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*GroupDelete) Where ¶
func (gd *GroupDelete) Where(ps ...predicate.Group) *GroupDelete
Where adds a new predicate to the GroupDelete builder.
type GroupDeleteOne ¶
type GroupDeleteOne struct {
// contains filtered or unexported fields
}
GroupDeleteOne is the builder for deleting a single Group entity.
func (*GroupDeleteOne) Exec ¶
func (gdo *GroupDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*GroupDeleteOne) ExecX ¶
func (gdo *GroupDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type GroupEdges ¶
type GroupEdges struct { // Members holds the value of the members edge. Members []*Host `json:"members,omitempty"` // contains filtered or unexported fields }
GroupEdges holds the relations/edges for other nodes in the graph.
func (GroupEdges) MembersOrErr ¶
func (e GroupEdges) MembersOrErr() ([]*Host, error)
MembersOrErr returns the Members value or an error if the edge was not loaded in eager-loading.
type GroupGroupBy ¶
type GroupGroupBy struct {
// contains filtered or unexported fields
}
GroupGroupBy is the group-by builder for Group entities.
func (*GroupGroupBy) Aggregate ¶
func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*GroupGroupBy) Bool ¶
func (ggb *GroupGroupBy) 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 (*GroupGroupBy) BoolX ¶
func (ggb *GroupGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*GroupGroupBy) Bools ¶
func (ggb *GroupGroupBy) 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 (*GroupGroupBy) BoolsX ¶
func (ggb *GroupGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*GroupGroupBy) Float64 ¶
func (ggb *GroupGroupBy) 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 (*GroupGroupBy) Float64X ¶
func (ggb *GroupGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*GroupGroupBy) Float64s ¶
func (ggb *GroupGroupBy) 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 (*GroupGroupBy) Float64sX ¶
func (ggb *GroupGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*GroupGroupBy) Int ¶
func (ggb *GroupGroupBy) 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 (*GroupGroupBy) IntX ¶
func (ggb *GroupGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*GroupGroupBy) Ints ¶
func (ggb *GroupGroupBy) 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 (*GroupGroupBy) IntsX ¶
func (ggb *GroupGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*GroupGroupBy) Scan ¶
func (ggb *GroupGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*GroupGroupBy) ScanX ¶
func (ggb *GroupGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*GroupGroupBy) String ¶
func (ggb *GroupGroupBy) 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 (*GroupGroupBy) StringX ¶
func (ggb *GroupGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type GroupMutation ¶
type GroupMutation struct {
// contains filtered or unexported fields
}
GroupMutation represents an operation that mutates the Group nodes in the graph.
func (*GroupMutation) AddField ¶
func (m *GroupMutation) 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 (*GroupMutation) AddMemberIDs ¶
func (m *GroupMutation) AddMemberIDs(ids ...int)
AddMemberIDs adds the "members" edge to the Host entity by ids.
func (*GroupMutation) AddedEdges ¶
func (m *GroupMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*GroupMutation) AddedField ¶
func (m *GroupMutation) 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 (*GroupMutation) AddedFields ¶
func (m *GroupMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*GroupMutation) AddedIDs ¶
func (m *GroupMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*GroupMutation) ClearEdge ¶
func (m *GroupMutation) 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 (*GroupMutation) ClearField ¶
func (m *GroupMutation) 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 (*GroupMutation) ClearMembers ¶
func (m *GroupMutation) ClearMembers()
ClearMembers clears the "members" edge to the Host entity.
func (*GroupMutation) ClearedEdges ¶
func (m *GroupMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*GroupMutation) ClearedFields ¶
func (m *GroupMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (GroupMutation) Client ¶
func (m GroupMutation) 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 (*GroupMutation) Desc ¶
func (m *GroupMutation) Desc() (r string, exists bool)
Desc returns the value of the "desc" field in the mutation.
func (*GroupMutation) EdgeCleared ¶
func (m *GroupMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*GroupMutation) Field ¶
func (m *GroupMutation) 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 (*GroupMutation) FieldCleared ¶
func (m *GroupMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*GroupMutation) Fields ¶
func (m *GroupMutation) 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 (*GroupMutation) ID ¶
func (m *GroupMutation) 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.
func (*GroupMutation) MembersCleared ¶
func (m *GroupMutation) MembersCleared() bool
MembersCleared returns if the "members" edge to the Host entity was cleared.
func (*GroupMutation) MembersIDs ¶
func (m *GroupMutation) MembersIDs() (ids []int)
MembersIDs returns the "members" edge IDs in the mutation.
func (*GroupMutation) Name ¶
func (m *GroupMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*GroupMutation) OldDesc ¶
func (m *GroupMutation) OldDesc(ctx context.Context) (v string, err error)
OldDesc returns the old "desc" field's value of the Group entity. If the Group 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 (*GroupMutation) 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 (*GroupMutation) OldName ¶
func (m *GroupMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Group entity. If the Group 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 (*GroupMutation) RemoveMemberIDs ¶
func (m *GroupMutation) RemoveMemberIDs(ids ...int)
RemoveMemberIDs removes the "members" edge to the Host entity by IDs.
func (*GroupMutation) RemovedEdges ¶
func (m *GroupMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*GroupMutation) RemovedIDs ¶
func (m *GroupMutation) 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 (*GroupMutation) RemovedMembersIDs ¶
func (m *GroupMutation) RemovedMembersIDs() (ids []int)
RemovedMembers returns the removed IDs of the "members" edge to the Host entity.
func (*GroupMutation) ResetDesc ¶
func (m *GroupMutation) ResetDesc()
ResetDesc resets all changes to the "desc" field.
func (*GroupMutation) ResetEdge ¶
func (m *GroupMutation) 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 (*GroupMutation) ResetField ¶
func (m *GroupMutation) 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 (*GroupMutation) ResetMembers ¶
func (m *GroupMutation) ResetMembers()
ResetMembers resets all changes to the "members" edge.
func (*GroupMutation) ResetName ¶
func (m *GroupMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*GroupMutation) SetDesc ¶
func (m *GroupMutation) SetDesc(s string)
SetDesc sets the "desc" field.
func (*GroupMutation) SetField ¶
func (m *GroupMutation) 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 (*GroupMutation) SetName ¶
func (m *GroupMutation) SetName(s string)
SetName sets the "name" field.
func (GroupMutation) Tx ¶
func (m GroupMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*GroupMutation) Type ¶
func (m *GroupMutation) Type() string
Type returns the node type of this mutation (Group).
type GroupQuery ¶
type GroupQuery struct {
// contains filtered or unexported fields
}
GroupQuery is the builder for querying Group entities.
func (*GroupQuery) All ¶
func (gq *GroupQuery) All(ctx context.Context) ([]*Group, error)
All executes the query and returns a list of Groups.
func (*GroupQuery) AllX ¶
func (gq *GroupQuery) AllX(ctx context.Context) []*Group
AllX is like All, but panics if an error occurs.
func (*GroupQuery) Clone ¶
func (gq *GroupQuery) Clone() *GroupQuery
Clone returns a duplicate of the GroupQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*GroupQuery) Count ¶
func (gq *GroupQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*GroupQuery) CountX ¶
func (gq *GroupQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*GroupQuery) Exist ¶
func (gq *GroupQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*GroupQuery) ExistX ¶
func (gq *GroupQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*GroupQuery) First ¶
func (gq *GroupQuery) First(ctx context.Context) (*Group, error)
First returns the first Group entity from the query. Returns a *NotFoundError when no Group was found.
func (*GroupQuery) FirstID ¶
func (gq *GroupQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Group ID from the query. Returns a *NotFoundError when no Group ID was found.
func (*GroupQuery) FirstIDX ¶
func (gq *GroupQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*GroupQuery) FirstX ¶
func (gq *GroupQuery) FirstX(ctx context.Context) *Group
FirstX is like First, but panics if an error occurs.
func (*GroupQuery) GroupBy ¶
func (gq *GroupQuery) GroupBy(field string, fields ...string) *GroupGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Group.Query(). GroupBy(group.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*GroupQuery) IDs ¶
func (gq *GroupQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of Group IDs.
func (*GroupQuery) IDsX ¶
func (gq *GroupQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*GroupQuery) Limit ¶
func (gq *GroupQuery) Limit(limit int) *GroupQuery
Limit adds a limit step to the query.
func (*GroupQuery) Offset ¶
func (gq *GroupQuery) Offset(offset int) *GroupQuery
Offset adds an offset step to the query.
func (*GroupQuery) Only ¶
func (gq *GroupQuery) Only(ctx context.Context) (*Group, error)
Only returns a single Group entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one Group entity is not found. Returns a *NotFoundError when no Group entities are found.
func (*GroupQuery) OnlyID ¶
func (gq *GroupQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Group ID in the query. Returns a *NotSingularError when exactly one Group ID is not found. Returns a *NotFoundError when no entities are found.
func (*GroupQuery) OnlyIDX ¶
func (gq *GroupQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*GroupQuery) OnlyX ¶
func (gq *GroupQuery) OnlyX(ctx context.Context) *Group
OnlyX is like Only, but panics if an error occurs.
func (*GroupQuery) Order ¶
func (gq *GroupQuery) Order(o ...OrderFunc) *GroupQuery
Order adds an order step to the query.
func (*GroupQuery) QueryMembers ¶
func (gq *GroupQuery) QueryMembers() *HostQuery
QueryMembers chains the current query on the "members" edge.
func (*GroupQuery) Select ¶
func (gq *GroupQuery) Select(field string, fields ...string) *GroupSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.Group.Query(). Select(group.FieldName). Scan(ctx, &v)
func (*GroupQuery) Where ¶
func (gq *GroupQuery) Where(ps ...predicate.Group) *GroupQuery
Where adds a new predicate for the GroupQuery builder.
func (*GroupQuery) WithMembers ¶
func (gq *GroupQuery) WithMembers(opts ...func(*HostQuery)) *GroupQuery
WithMembers tells the query-builder to eager-load the nodes that are connected to the "members" edge. The optional arguments are used to configure the query builder of the edge.
type GroupSelect ¶
type GroupSelect struct { *GroupQuery // contains filtered or unexported fields }
GroupSelect is the builder for selecting fields of Group entities.
func (*GroupSelect) Bool ¶
func (gs *GroupSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*GroupSelect) BoolX ¶
func (gs *GroupSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*GroupSelect) Bools ¶
func (gs *GroupSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*GroupSelect) BoolsX ¶
func (gs *GroupSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*GroupSelect) Float64 ¶
func (gs *GroupSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*GroupSelect) Float64X ¶
func (gs *GroupSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*GroupSelect) Float64s ¶
func (gs *GroupSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*GroupSelect) Float64sX ¶
func (gs *GroupSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*GroupSelect) Int ¶
func (gs *GroupSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*GroupSelect) IntX ¶
func (gs *GroupSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*GroupSelect) Ints ¶
func (gs *GroupSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*GroupSelect) IntsX ¶
func (gs *GroupSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*GroupSelect) Scan ¶
func (gs *GroupSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*GroupSelect) ScanX ¶
func (gs *GroupSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*GroupSelect) String ¶
func (gs *GroupSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*GroupSelect) StringX ¶
func (gs *GroupSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type GroupUpdate ¶
type GroupUpdate struct {
// contains filtered or unexported fields
}
GroupUpdate is the builder for updating Group entities.
func (*GroupUpdate) AddMemberIDs ¶
func (gu *GroupUpdate) AddMemberIDs(ids ...int) *GroupUpdate
AddMemberIDs adds the "members" edge to the Host entity by IDs.
func (*GroupUpdate) AddMembers ¶
func (gu *GroupUpdate) AddMembers(h ...*Host) *GroupUpdate
AddMembers adds the "members" edges to the Host entity.
func (*GroupUpdate) ClearMembers ¶
func (gu *GroupUpdate) ClearMembers() *GroupUpdate
ClearMembers clears all "members" edges to the Host entity.
func (*GroupUpdate) Exec ¶
func (gu *GroupUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*GroupUpdate) ExecX ¶
func (gu *GroupUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GroupUpdate) Mutation ¶
func (gu *GroupUpdate) Mutation() *GroupMutation
Mutation returns the GroupMutation object of the builder.
func (*GroupUpdate) RemoveMemberIDs ¶
func (gu *GroupUpdate) RemoveMemberIDs(ids ...int) *GroupUpdate
RemoveMemberIDs removes the "members" edge to Host entities by IDs.
func (*GroupUpdate) RemoveMembers ¶
func (gu *GroupUpdate) RemoveMembers(h ...*Host) *GroupUpdate
RemoveMembers removes "members" edges to Host entities.
func (*GroupUpdate) Save ¶
func (gu *GroupUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*GroupUpdate) SaveX ¶
func (gu *GroupUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*GroupUpdate) SetDesc ¶
func (gu *GroupUpdate) SetDesc(s string) *GroupUpdate
SetDesc sets the "desc" field.
func (*GroupUpdate) SetName ¶
func (gu *GroupUpdate) SetName(s string) *GroupUpdate
SetName sets the "name" field.
func (*GroupUpdate) Where ¶
func (gu *GroupUpdate) Where(ps ...predicate.Group) *GroupUpdate
Where adds a new predicate for the GroupUpdate builder.
type GroupUpdateOne ¶
type GroupUpdateOne struct {
// contains filtered or unexported fields
}
GroupUpdateOne is the builder for updating a single Group entity.
func (*GroupUpdateOne) AddMemberIDs ¶
func (guo *GroupUpdateOne) AddMemberIDs(ids ...int) *GroupUpdateOne
AddMemberIDs adds the "members" edge to the Host entity by IDs.
func (*GroupUpdateOne) AddMembers ¶
func (guo *GroupUpdateOne) AddMembers(h ...*Host) *GroupUpdateOne
AddMembers adds the "members" edges to the Host entity.
func (*GroupUpdateOne) ClearMembers ¶
func (guo *GroupUpdateOne) ClearMembers() *GroupUpdateOne
ClearMembers clears all "members" edges to the Host entity.
func (*GroupUpdateOne) Exec ¶
func (guo *GroupUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*GroupUpdateOne) ExecX ¶
func (guo *GroupUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GroupUpdateOne) Mutation ¶
func (guo *GroupUpdateOne) Mutation() *GroupMutation
Mutation returns the GroupMutation object of the builder.
func (*GroupUpdateOne) RemoveMemberIDs ¶
func (guo *GroupUpdateOne) RemoveMemberIDs(ids ...int) *GroupUpdateOne
RemoveMemberIDs removes the "members" edge to Host entities by IDs.
func (*GroupUpdateOne) RemoveMembers ¶
func (guo *GroupUpdateOne) RemoveMembers(h ...*Host) *GroupUpdateOne
RemoveMembers removes "members" edges to Host entities.
func (*GroupUpdateOne) Save ¶
func (guo *GroupUpdateOne) Save(ctx context.Context) (*Group, error)
Save executes the query and returns the updated Group entity.
func (*GroupUpdateOne) SaveX ¶
func (guo *GroupUpdateOne) SaveX(ctx context.Context) *Group
SaveX is like Save, but panics if an error occurs.
func (*GroupUpdateOne) SetDesc ¶
func (guo *GroupUpdateOne) SetDesc(s string) *GroupUpdateOne
SetDesc sets the "desc" field.
func (*GroupUpdateOne) SetName ¶
func (guo *GroupUpdateOne) SetName(s string) *GroupUpdateOne
SetName sets the "name" field.
type Host ¶
type Host struct { // ID of the ent. ID int `json:"id,omitempty"` // Hostname holds the value of the "hostname" field. Hostname string `json:"hostname,omitempty"` // Interface holds the value of the "interface" field. Interface string `json:"interface,omitempty"` // LastSeen holds the value of the "lastSeen" field. LastSeen int `json:"lastSeen,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) QueryActions ¶
func (h *Host) QueryActions() *ActionQuery
QueryActions queries the "actions" edge of the Host entity.
func (*Host) QueryMember ¶
func (h *Host) QueryMember() *GroupQuery
QueryMember queries the "member" 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 int) *HostDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*HostClient) GetX ¶
func (c *HostClient) GetX(ctx context.Context, id int) *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) QueryActions ¶
func (c *HostClient) QueryActions(h *Host) *ActionQuery
QueryActions queries the actions edge of a Host.
func (*HostClient) QueryBots ¶
func (c *HostClient) QueryBots(h *Host) *BotQuery
QueryBots queries the bots edge of a Host.
func (*HostClient) QueryMember ¶
func (c *HostClient) QueryMember(h *Host) *GroupQuery
QueryMember queries the member 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 int) *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) AddActionIDs ¶
func (hc *HostCreate) AddActionIDs(ids ...int) *HostCreate
AddActionIDs adds the "actions" edge to the Action entity by IDs.
func (*HostCreate) AddActions ¶
func (hc *HostCreate) AddActions(a ...*Action) *HostCreate
AddActions adds the "actions" edges to the Action entity.
func (*HostCreate) AddBotIDs ¶
func (hc *HostCreate) AddBotIDs(ids ...int) *HostCreate
AddBotIDs adds the "bots" edge to the Bot entity by IDs.
func (*HostCreate) AddBots ¶
func (hc *HostCreate) AddBots(b ...*Bot) *HostCreate
AddBots adds the "bots" edges to the Bot entity.
func (*HostCreate) AddMember ¶
func (hc *HostCreate) AddMember(g ...*Group) *HostCreate
AddMember adds the "member" edges to the Group entity.
func (*HostCreate) AddMemberIDs ¶
func (hc *HostCreate) AddMemberIDs(ids ...int) *HostCreate
AddMemberIDs adds the "member" edge to the Group entity by IDs.
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) SetHostname ¶
func (hc *HostCreate) SetHostname(s string) *HostCreate
SetHostname sets the "hostname" field.
func (*HostCreate) SetInterface ¶
func (hc *HostCreate) SetInterface(s string) *HostCreate
SetInterface sets the "interface" field.
func (*HostCreate) SetLastSeen ¶
func (hc *HostCreate) SetLastSeen(i int) *HostCreate
SetLastSeen sets the "lastSeen" field.
func (*HostCreate) SetNillableLastSeen ¶
func (hc *HostCreate) SetNillableLastSeen(i *int) *HostCreate
SetNillableLastSeen sets the "lastSeen" field if the given value is not nil.
type HostCreateBulk ¶
type HostCreateBulk struct {
// contains filtered or unexported fields
}
HostCreateBulk is the builder for creating many Host entities in bulk.
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 adds a new predicate 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 { // Bots holds the value of the bots edge. Bots []*Bot `json:"bots,omitempty"` // Actions holds the value of the actions edge. Actions []*Action `json:"actions,omitempty"` // Member holds the value of the member edge. Member []*Group `json:"member,omitempty"` // contains filtered or unexported fields }
HostEdges holds the relations/edges for other nodes in the graph.
func (HostEdges) ActionsOrErr ¶
ActionsOrErr returns the Actions value or an error if the edge was not loaded in eager-loading.
func (HostEdges) BotsOrErr ¶
BotsOrErr returns the Bots value or an error if the edge was not loaded in eager-loading.
func (HostEdges) MemberOrErr ¶
MemberOrErr returns the Member 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) ActionsCleared ¶
func (m *HostMutation) ActionsCleared() bool
ActionsCleared returns if the "actions" edge to the Action entity was cleared.
func (*HostMutation) ActionsIDs ¶
func (m *HostMutation) ActionsIDs() (ids []int)
ActionsIDs returns the "actions" edge IDs in the mutation.
func (*HostMutation) AddActionIDs ¶
func (m *HostMutation) AddActionIDs(ids ...int)
AddActionIDs adds the "actions" edge to the Action entity by ids.
func (*HostMutation) AddBotIDs ¶
func (m *HostMutation) AddBotIDs(ids ...int)
AddBotIDs adds the "bots" edge to the Bot 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) AddLastSeen ¶
func (m *HostMutation) AddLastSeen(i int)
AddLastSeen adds i to the "lastSeen" field.
func (*HostMutation) AddMemberIDs ¶
func (m *HostMutation) AddMemberIDs(ids ...int)
AddMemberIDs adds the "member" edge to the Group 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) AddedLastSeen ¶
func (m *HostMutation) AddedLastSeen() (r int, exists bool)
AddedLastSeen returns the value that was added to the "lastSeen" field in this mutation.
func (*HostMutation) BotsCleared ¶
func (m *HostMutation) BotsCleared() bool
BotsCleared returns if the "bots" edge to the Bot entity was cleared.
func (*HostMutation) BotsIDs ¶
func (m *HostMutation) BotsIDs() (ids []int)
BotsIDs returns the "bots" edge IDs in the mutation.
func (*HostMutation) ClearActions ¶
func (m *HostMutation) ClearActions()
ClearActions clears the "actions" edge to the Action entity.
func (*HostMutation) ClearBots ¶
func (m *HostMutation) ClearBots()
ClearBots clears the "bots" edge to the Bot 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) ClearMember ¶
func (m *HostMutation) ClearMember()
ClearMember clears the "member" edge to the Group 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) 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 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.
func (*HostMutation) Interface ¶
func (m *HostMutation) Interface() (r string, exists bool)
Interface returns the value of the "interface" field in the mutation.
func (*HostMutation) LastSeen ¶
func (m *HostMutation) LastSeen() (r int, exists bool)
LastSeen returns the value of the "lastSeen" field in the mutation.
func (*HostMutation) MemberCleared ¶
func (m *HostMutation) MemberCleared() bool
MemberCleared returns if the "member" edge to the Group entity was cleared.
func (*HostMutation) MemberIDs ¶
func (m *HostMutation) MemberIDs() (ids []int)
MemberIDs returns the "member" edge IDs in the mutation.
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) OldInterface ¶
func (m *HostMutation) OldInterface(ctx context.Context) (v string, err error)
OldInterface returns the old "interface" 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) OldLastSeen ¶
func (m *HostMutation) OldLastSeen(ctx context.Context) (v int, err error)
OldLastSeen returns the old "lastSeen" 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) RemoveActionIDs ¶
func (m *HostMutation) RemoveActionIDs(ids ...int)
RemoveActionIDs removes the "actions" edge to the Action entity by IDs.
func (*HostMutation) RemoveBotIDs ¶
func (m *HostMutation) RemoveBotIDs(ids ...int)
RemoveBotIDs removes the "bots" edge to the Bot entity by IDs.
func (*HostMutation) RemoveMemberIDs ¶
func (m *HostMutation) RemoveMemberIDs(ids ...int)
RemoveMemberIDs removes the "member" edge to the Group entity by IDs.
func (*HostMutation) RemovedActionsIDs ¶
func (m *HostMutation) RemovedActionsIDs() (ids []int)
RemovedActions returns the removed IDs of the "actions" edge to the Action entity.
func (*HostMutation) RemovedBotsIDs ¶
func (m *HostMutation) RemovedBotsIDs() (ids []int)
RemovedBots returns the removed IDs of the "bots" edge to the Bot 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) RemovedMemberIDs ¶
func (m *HostMutation) RemovedMemberIDs() (ids []int)
RemovedMember returns the removed IDs of the "member" edge to the Group entity.
func (*HostMutation) ResetActions ¶
func (m *HostMutation) ResetActions()
ResetActions resets all changes to the "actions" edge.
func (*HostMutation) ResetBots ¶
func (m *HostMutation) ResetBots()
ResetBots resets all changes to the "bots" 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) ResetInterface ¶
func (m *HostMutation) ResetInterface()
ResetInterface resets all changes to the "interface" field.
func (*HostMutation) ResetLastSeen ¶
func (m *HostMutation) ResetLastSeen()
ResetLastSeen resets all changes to the "lastSeen" field.
func (*HostMutation) ResetMember ¶
func (m *HostMutation) ResetMember()
ResetMember resets all changes to the "member" edge.
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) SetInterface ¶
func (m *HostMutation) SetInterface(s string)
SetInterface sets the "interface" field.
func (*HostMutation) SetLastSeen ¶
func (m *HostMutation) SetLastSeen(i int)
SetLastSeen sets the "lastSeen" 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).
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 exactly one Host entity is not 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 exactly one Host ID is not found. Returns a *NotFoundError when no entities are found.
func (*HostQuery) QueryActions ¶
func (hq *HostQuery) QueryActions() *ActionQuery
QueryActions chains the current query on the "actions" edge.
func (*HostQuery) QueryMember ¶
func (hq *HostQuery) QueryMember() *GroupQuery
QueryMember chains the current query on the "member" edge.
func (*HostQuery) Select ¶
func (hq *HostQuery) Select(field string, 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) WithActions ¶
func (hq *HostQuery) WithActions(opts ...func(*ActionQuery)) *HostQuery
WithActions tells the query-builder to eager-load the nodes that are connected to the "actions" edge. The optional arguments are used to configure the query builder of the edge.
func (*HostQuery) WithBots ¶
WithBots tells the query-builder to eager-load the nodes that are connected to the "bots" edge. The optional arguments are used to configure the query builder of the edge.
func (*HostQuery) WithMember ¶
func (hq *HostQuery) WithMember(opts ...func(*GroupQuery)) *HostQuery
WithMember tells the query-builder to eager-load the nodes that are connected to the "member" 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) AddActionIDs ¶
func (hu *HostUpdate) AddActionIDs(ids ...int) *HostUpdate
AddActionIDs adds the "actions" edge to the Action entity by IDs.
func (*HostUpdate) AddActions ¶
func (hu *HostUpdate) AddActions(a ...*Action) *HostUpdate
AddActions adds the "actions" edges to the Action entity.
func (*HostUpdate) AddBotIDs ¶
func (hu *HostUpdate) AddBotIDs(ids ...int) *HostUpdate
AddBotIDs adds the "bots" edge to the Bot entity by IDs.
func (*HostUpdate) AddBots ¶
func (hu *HostUpdate) AddBots(b ...*Bot) *HostUpdate
AddBots adds the "bots" edges to the Bot entity.
func (*HostUpdate) AddLastSeen ¶
func (hu *HostUpdate) AddLastSeen(i int) *HostUpdate
AddLastSeen adds i to the "lastSeen" field.
func (*HostUpdate) AddMember ¶
func (hu *HostUpdate) AddMember(g ...*Group) *HostUpdate
AddMember adds the "member" edges to the Group entity.
func (*HostUpdate) AddMemberIDs ¶
func (hu *HostUpdate) AddMemberIDs(ids ...int) *HostUpdate
AddMemberIDs adds the "member" edge to the Group entity by IDs.
func (*HostUpdate) ClearActions ¶
func (hu *HostUpdate) ClearActions() *HostUpdate
ClearActions clears all "actions" edges to the Action entity.
func (*HostUpdate) ClearBots ¶
func (hu *HostUpdate) ClearBots() *HostUpdate
ClearBots clears all "bots" edges to the Bot entity.
func (*HostUpdate) ClearMember ¶
func (hu *HostUpdate) ClearMember() *HostUpdate
ClearMember clears all "member" edges to the Group 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) RemoveActionIDs ¶
func (hu *HostUpdate) RemoveActionIDs(ids ...int) *HostUpdate
RemoveActionIDs removes the "actions" edge to Action entities by IDs.
func (*HostUpdate) RemoveActions ¶
func (hu *HostUpdate) RemoveActions(a ...*Action) *HostUpdate
RemoveActions removes "actions" edges to Action entities.
func (*HostUpdate) RemoveBotIDs ¶
func (hu *HostUpdate) RemoveBotIDs(ids ...int) *HostUpdate
RemoveBotIDs removes the "bots" edge to Bot entities by IDs.
func (*HostUpdate) RemoveBots ¶
func (hu *HostUpdate) RemoveBots(b ...*Bot) *HostUpdate
RemoveBots removes "bots" edges to Bot entities.
func (*HostUpdate) RemoveMember ¶
func (hu *HostUpdate) RemoveMember(g ...*Group) *HostUpdate
RemoveMember removes "member" edges to Group entities.
func (*HostUpdate) RemoveMemberIDs ¶
func (hu *HostUpdate) RemoveMemberIDs(ids ...int) *HostUpdate
RemoveMemberIDs removes the "member" edge to Group 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) SetHostname ¶
func (hu *HostUpdate) SetHostname(s string) *HostUpdate
SetHostname sets the "hostname" field.
func (*HostUpdate) SetInterface ¶
func (hu *HostUpdate) SetInterface(s string) *HostUpdate
SetInterface sets the "interface" field.
func (*HostUpdate) SetLastSeen ¶
func (hu *HostUpdate) SetLastSeen(i int) *HostUpdate
SetLastSeen sets the "lastSeen" field.
func (*HostUpdate) SetNillableLastSeen ¶
func (hu *HostUpdate) SetNillableLastSeen(i *int) *HostUpdate
SetNillableLastSeen sets the "lastSeen" field if the given value is not nil.
func (*HostUpdate) Where ¶
func (hu *HostUpdate) Where(ps ...predicate.Host) *HostUpdate
Where adds a new predicate for 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) AddActionIDs ¶
func (huo *HostUpdateOne) AddActionIDs(ids ...int) *HostUpdateOne
AddActionIDs adds the "actions" edge to the Action entity by IDs.
func (*HostUpdateOne) AddActions ¶
func (huo *HostUpdateOne) AddActions(a ...*Action) *HostUpdateOne
AddActions adds the "actions" edges to the Action entity.
func (*HostUpdateOne) AddBotIDs ¶
func (huo *HostUpdateOne) AddBotIDs(ids ...int) *HostUpdateOne
AddBotIDs adds the "bots" edge to the Bot entity by IDs.
func (*HostUpdateOne) AddBots ¶
func (huo *HostUpdateOne) AddBots(b ...*Bot) *HostUpdateOne
AddBots adds the "bots" edges to the Bot entity.
func (*HostUpdateOne) AddLastSeen ¶
func (huo *HostUpdateOne) AddLastSeen(i int) *HostUpdateOne
AddLastSeen adds i to the "lastSeen" field.
func (*HostUpdateOne) AddMember ¶
func (huo *HostUpdateOne) AddMember(g ...*Group) *HostUpdateOne
AddMember adds the "member" edges to the Group entity.
func (*HostUpdateOne) AddMemberIDs ¶
func (huo *HostUpdateOne) AddMemberIDs(ids ...int) *HostUpdateOne
AddMemberIDs adds the "member" edge to the Group entity by IDs.
func (*HostUpdateOne) ClearActions ¶
func (huo *HostUpdateOne) ClearActions() *HostUpdateOne
ClearActions clears all "actions" edges to the Action entity.
func (*HostUpdateOne) ClearBots ¶
func (huo *HostUpdateOne) ClearBots() *HostUpdateOne
ClearBots clears all "bots" edges to the Bot entity.
func (*HostUpdateOne) ClearMember ¶
func (huo *HostUpdateOne) ClearMember() *HostUpdateOne
ClearMember clears all "member" edges to the Group 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) RemoveActionIDs ¶
func (huo *HostUpdateOne) RemoveActionIDs(ids ...int) *HostUpdateOne
RemoveActionIDs removes the "actions" edge to Action entities by IDs.
func (*HostUpdateOne) RemoveActions ¶
func (huo *HostUpdateOne) RemoveActions(a ...*Action) *HostUpdateOne
RemoveActions removes "actions" edges to Action entities.
func (*HostUpdateOne) RemoveBotIDs ¶
func (huo *HostUpdateOne) RemoveBotIDs(ids ...int) *HostUpdateOne
RemoveBotIDs removes the "bots" edge to Bot entities by IDs.
func (*HostUpdateOne) RemoveBots ¶
func (huo *HostUpdateOne) RemoveBots(b ...*Bot) *HostUpdateOne
RemoveBots removes "bots" edges to Bot entities.
func (*HostUpdateOne) RemoveMember ¶
func (huo *HostUpdateOne) RemoveMember(g ...*Group) *HostUpdateOne
RemoveMember removes "member" edges to Group entities.
func (*HostUpdateOne) RemoveMemberIDs ¶
func (huo *HostUpdateOne) RemoveMemberIDs(ids ...int) *HostUpdateOne
RemoveMemberIDs removes the "member" edge to Group 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) SetHostname ¶
func (huo *HostUpdateOne) SetHostname(s string) *HostUpdateOne
SetHostname sets the "hostname" field.
func (*HostUpdateOne) SetInterface ¶
func (huo *HostUpdateOne) SetInterface(s string) *HostUpdateOne
SetInterface sets the "interface" field.
func (*HostUpdateOne) SetLastSeen ¶
func (huo *HostUpdateOne) SetLastSeen(i int) *HostUpdateOne
SetLastSeen sets the "lastSeen" field.
func (*HostUpdateOne) SetNillableLastSeen ¶
func (huo *HostUpdateOne) SetNillableLastSeen(i *int) *HostUpdateOne
SetNillableLastSeen sets the "lastSeen" field if the given value is not nil.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type 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(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 Rollbacker method.
type Tx ¶
type Tx struct { // Action is the client for interacting with the Action builders. Action *ActionClient // Bot is the client for interacting with the Bot builders. Bot *BotClient // Group is the client for interacting with the Group builders. Group *GroupClient // Host is the client for interacting with the Host builders. Host *HostClient // User is the client for interacting with the User builders. User *UserClient // 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 User ¶
type User struct { // ID of the ent. ID int `json:"id,omitempty"` // Username holds the value of the "username" field. Username string `json:"username,omitempty"` // Password holds the value of the "password" field. Password string `json:"password,omitempty"` // contains filtered or unexported fields }
User is the model entity for the User schema.
func (*User) Unwrap ¶
Unwrap unwraps the User 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 (*User) Update ¶
func (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶
func (c *UserClient) Create() *UserCreate
Create returns a create builder for User.
func (*UserClient) CreateBulk ¶
func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
CreateBulk returns a builder for creating a bulk of User entities.
func (*UserClient) Delete ¶
func (c *UserClient) Delete() *UserDelete
Delete returns a delete builder for User.
func (*UserClient) DeleteOne ¶
func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*UserClient) GetX ¶
func (c *UserClient) GetX(ctx context.Context, id int) *User
GetX is like Get, but panics if an error occurs.
func (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) Update ¶
func (c *UserClient) Update() *UserUpdate
Update returns an update builder for User.
func (*UserClient) UpdateOne ¶
func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserClient) UpdateOneID ¶
func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserClient) Use ¶
func (c *UserClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.
type UserCreate ¶
type UserCreate struct {
// contains filtered or unexported fields
}
UserCreate is the builder for creating a User entity.
func (*UserCreate) Mutation ¶
func (uc *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) Save ¶
func (uc *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (uc *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetPassword ¶
func (uc *UserCreate) SetPassword(s string) *UserCreate
SetPassword sets the "password" field.
func (*UserCreate) SetUsername ¶
func (uc *UserCreate) SetUsername(s string) *UserCreate
SetUsername sets the "username" field.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
type UserDelete ¶
type UserDelete struct {
// contains filtered or unexported fields
}
UserDelete is the builder for deleting a User entity.
func (*UserDelete) Exec ¶
func (ud *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (ud *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete
Where adds a new predicate to the UserDelete builder.
type UserDeleteOne ¶
type UserDeleteOne struct {
// contains filtered or unexported fields
}
UserDeleteOne is the builder for deleting a single User entity.
func (*UserDeleteOne) Exec ¶
func (udo *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (udo *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserGroupBy ¶
type UserGroupBy struct {
// contains filtered or unexported fields
}
UserGroupBy is the group-by builder for User entities.
func (*UserGroupBy) Aggregate ¶
func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserGroupBy) Bool ¶
func (ugb *UserGroupBy) 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 (*UserGroupBy) BoolX ¶
func (ugb *UserGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*UserGroupBy) Bools ¶
func (ugb *UserGroupBy) 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 (*UserGroupBy) BoolsX ¶
func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*UserGroupBy) Float64 ¶
func (ugb *UserGroupBy) 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 (*UserGroupBy) Float64X ¶
func (ugb *UserGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*UserGroupBy) Float64s ¶
func (ugb *UserGroupBy) 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 (*UserGroupBy) Float64sX ¶
func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*UserGroupBy) Int ¶
func (ugb *UserGroupBy) 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 (*UserGroupBy) IntX ¶
func (ugb *UserGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*UserGroupBy) Ints ¶
func (ugb *UserGroupBy) 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 (*UserGroupBy) IntsX ¶
func (ugb *UserGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*UserGroupBy) Scan ¶
func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*UserGroupBy) ScanX ¶
func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*UserGroupBy) String ¶
func (ugb *UserGroupBy) 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 (*UserGroupBy) StringX ¶
func (ugb *UserGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) AddField ¶
func (m *UserMutation) 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 (*UserMutation) AddedEdges ¶
func (m *UserMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserMutation) AddedField ¶
func (m *UserMutation) 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 (*UserMutation) AddedFields ¶
func (m *UserMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserMutation) AddedIDs ¶
func (m *UserMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserMutation) ClearEdge ¶
func (m *UserMutation) 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 (*UserMutation) ClearField ¶
func (m *UserMutation) 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 (*UserMutation) ClearedEdges ¶
func (m *UserMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserMutation) ClearedFields ¶
func (m *UserMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserMutation) Client ¶
func (m UserMutation) 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 (*UserMutation) EdgeCleared ¶
func (m *UserMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserMutation) Field ¶
func (m *UserMutation) 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 (*UserMutation) FieldCleared ¶
func (m *UserMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserMutation) Fields ¶
func (m *UserMutation) 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 (*UserMutation) ID ¶
func (m *UserMutation) 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.
func (*UserMutation) 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 (*UserMutation) OldPassword ¶
func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)
OldPassword returns the old "password" field's value of the User entity. If the User 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 (*UserMutation) OldUsername ¶
func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)
OldUsername returns the old "username" field's value of the User entity. If the User 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 (*UserMutation) Password ¶
func (m *UserMutation) Password() (r string, exists bool)
Password returns the value of the "password" field in the mutation.
func (*UserMutation) RemovedEdges ¶
func (m *UserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserMutation) RemovedIDs ¶
func (m *UserMutation) 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 (*UserMutation) ResetEdge ¶
func (m *UserMutation) 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 (*UserMutation) ResetField ¶
func (m *UserMutation) 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 (*UserMutation) ResetPassword ¶
func (m *UserMutation) ResetPassword()
ResetPassword resets all changes to the "password" field.
func (*UserMutation) ResetUsername ¶
func (m *UserMutation) ResetUsername()
ResetUsername resets all changes to the "username" field.
func (*UserMutation) SetField ¶
func (m *UserMutation) 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 (*UserMutation) SetPassword ¶
func (m *UserMutation) SetPassword(s string)
SetPassword sets the "password" field.
func (*UserMutation) SetUsername ¶
func (m *UserMutation) SetUsername(s string)
SetUsername sets the "username" field.
func (UserMutation) Tx ¶
func (m UserMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserMutation) Type ¶
func (m *UserMutation) Type() string
Type returns the node type of this mutation (User).
func (*UserMutation) Username ¶
func (m *UserMutation) Username() (r string, exists bool)
Username returns the value of the "username" field in the mutation.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Clone ¶
Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserQuery) First ¶
First returns the first User entity from the query. Returns a *NotFoundError when no User was found.
func (*UserQuery) FirstID ¶
FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.
func (*UserQuery) GroupBy ¶
func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
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 { Username string `json:"username,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldUsername). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserQuery) Only ¶
Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one User entity is not found. Returns a *NotFoundError when no User entities are found.
func (*UserQuery) OnlyID ¶
OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when exactly one User ID is not found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) Select ¶
func (uq *UserQuery) Select(field string, fields ...string) *UserSelect
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 { Username string `json:"username,omitempty"` } client.User.Query(). Select(user.FieldUsername). Scan(ctx, &v)
type UserSelect ¶
type UserSelect struct { *UserQuery // contains filtered or unexported fields }
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Bool ¶
func (us *UserSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) BoolX ¶
func (us *UserSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*UserSelect) Bools ¶
func (us *UserSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) BoolsX ¶
func (us *UserSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*UserSelect) Float64 ¶
func (us *UserSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64X ¶
func (us *UserSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*UserSelect) Float64s ¶
func (us *UserSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64sX ¶
func (us *UserSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*UserSelect) Int ¶
func (us *UserSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) IntX ¶
func (us *UserSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*UserSelect) Ints ¶
func (us *UserSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSelect) IntsX ¶
func (us *UserSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*UserSelect) Scan ¶
func (us *UserSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*UserSelect) ScanX ¶
func (us *UserSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*UserSelect) String ¶
func (us *UserSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*UserSelect) StringX ¶
func (us *UserSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) Exec ¶
func (uu *UserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpdate) ExecX ¶
func (uu *UserUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdate) Mutation ¶
func (uu *UserUpdate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdate) Save ¶
func (uu *UserUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserUpdate) SaveX ¶
func (uu *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) SetPassword ¶
func (uu *UserUpdate) SetPassword(s string) *UserUpdate
SetPassword sets the "password" field.
func (*UserUpdate) SetUsername ¶
func (uu *UserUpdate) SetUsername(s string) *UserUpdate
SetUsername sets the "username" field.
func (*UserUpdate) Where ¶
func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
Where adds a new predicate for the UserUpdate builder.
type UserUpdateOne ¶
type UserUpdateOne struct {
// contains filtered or unexported fields
}
UserUpdateOne is the builder for updating a single User entity.
func (*UserUpdateOne) Exec ¶
func (uuo *UserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserUpdateOne) ExecX ¶
func (uuo *UserUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdateOne) Mutation ¶
func (uuo *UserUpdateOne) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdateOne) Save ¶
func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated User entity.
func (*UserUpdateOne) SaveX ¶
func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) SetPassword ¶
func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne
SetPassword sets the "password" field.
func (*UserUpdateOne) SetUsername ¶
func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne
SetUsername sets the "username" field.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field 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 ¶
- action.go
- action_create.go
- action_delete.go
- action_query.go
- action_update.go
- bot.go
- bot_create.go
- bot_delete.go
- bot_query.go
- bot_update.go
- client.go
- config.go
- context.go
- ent.go
- generate.go
- group.go
- group_create.go
- group_delete.go
- group_query.go
- group_update.go
- host.go
- host_create.go
- host_delete.go
- host_query.go
- host_update.go
- mutation.go
- runtime.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go