Documentation
¶
Index ¶
- Constants
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Client
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Event
- type EventClient
- func (c *EventClient) Create() *EventCreate
- func (c *EventClient) CreateBulk(builders ...*EventCreate) *EventCreateBulk
- func (c *EventClient) Delete() *EventDelete
- func (c *EventClient) DeleteOne(e *Event) *EventDeleteOne
- func (c *EventClient) DeleteOneID(id int) *EventDeleteOne
- func (c *EventClient) Get(ctx context.Context, id int) (*Event, error)
- func (c *EventClient) GetX(ctx context.Context, id int) *Event
- func (c *EventClient) Hooks() []Hook
- func (c *EventClient) Query() *EventQuery
- func (c *EventClient) QueryServer(e *Event) *ServerQuery
- func (c *EventClient) QueryUser(e *Event) *UserQuery
- func (c *EventClient) Update() *EventUpdate
- func (c *EventClient) UpdateOne(e *Event) *EventUpdateOne
- func (c *EventClient) UpdateOneID(id int) *EventUpdateOne
- func (c *EventClient) Use(hooks ...Hook)
- type EventCreate
- func (ec *EventCreate) AddServer(s ...*Server) *EventCreate
- func (ec *EventCreate) AddServerIDs(ids ...int) *EventCreate
- func (ec *EventCreate) AddUser(u ...*User) *EventCreate
- func (ec *EventCreate) AddUserIDs(ids ...int) *EventCreate
- func (ec *EventCreate) Mutation() *EventMutation
- func (ec *EventCreate) Save(ctx context.Context) (*Event, error)
- func (ec *EventCreate) SaveX(ctx context.Context) *Event
- func (ec *EventCreate) SetCreatedAt(t time.Time) *EventCreate
- func (ec *EventCreate) SetMessage(s string) *EventCreate
- func (ec *EventCreate) SetNillableCreatedAt(t *time.Time) *EventCreate
- type EventCreateBulk
- type EventDelete
- type EventDeleteOne
- type EventEdges
- type EventGroupBy
- func (egb *EventGroupBy) Aggregate(fns ...AggregateFunc) *EventGroupBy
- func (egb *EventGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (egb *EventGroupBy) BoolX(ctx context.Context) bool
- func (egb *EventGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (egb *EventGroupBy) BoolsX(ctx context.Context) []bool
- func (egb *EventGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (egb *EventGroupBy) Float64X(ctx context.Context) float64
- func (egb *EventGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (egb *EventGroupBy) Float64sX(ctx context.Context) []float64
- func (egb *EventGroupBy) Int(ctx context.Context) (_ int, err error)
- func (egb *EventGroupBy) IntX(ctx context.Context) int
- func (egb *EventGroupBy) Ints(ctx context.Context) ([]int, error)
- func (egb *EventGroupBy) IntsX(ctx context.Context) []int
- func (egb *EventGroupBy) Scan(ctx context.Context, v interface{}) error
- func (egb *EventGroupBy) ScanX(ctx context.Context, v interface{})
- func (egb *EventGroupBy) String(ctx context.Context) (_ string, err error)
- func (egb *EventGroupBy) StringX(ctx context.Context) string
- func (egb *EventGroupBy) Strings(ctx context.Context) ([]string, error)
- func (egb *EventGroupBy) StringsX(ctx context.Context) []string
- type EventMutation
- func (m *EventMutation) AddField(name string, value ent.Value) error
- func (m *EventMutation) AddServerIDs(ids ...int)
- func (m *EventMutation) AddUserIDs(ids ...int)
- func (m *EventMutation) AddedEdges() []string
- func (m *EventMutation) AddedField(name string) (ent.Value, bool)
- func (m *EventMutation) AddedFields() []string
- func (m *EventMutation) AddedIDs(name string) []ent.Value
- func (m *EventMutation) ClearEdge(name string) error
- func (m *EventMutation) ClearField(name string) error
- func (m *EventMutation) ClearServer()
- func (m *EventMutation) ClearUser()
- func (m *EventMutation) ClearedEdges() []string
- func (m *EventMutation) ClearedFields() []string
- func (m EventMutation) Client() *Client
- func (m *EventMutation) CreatedAt() (r time.Time, exists bool)
- func (m *EventMutation) EdgeCleared(name string) bool
- func (m *EventMutation) Field(name string) (ent.Value, bool)
- func (m *EventMutation) FieldCleared(name string) bool
- func (m *EventMutation) Fields() []string
- func (m *EventMutation) ID() (id int, exists bool)
- func (m *EventMutation) Message() (r string, exists bool)
- func (m *EventMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *EventMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *EventMutation) OldMessage(ctx context.Context) (v string, err error)
- func (m *EventMutation) Op() Op
- func (m *EventMutation) RemoveServerIDs(ids ...int)
- func (m *EventMutation) RemoveUserIDs(ids ...int)
- func (m *EventMutation) RemovedEdges() []string
- func (m *EventMutation) RemovedIDs(name string) []ent.Value
- func (m *EventMutation) RemovedServerIDs() (ids []int)
- func (m *EventMutation) RemovedUserIDs() (ids []int)
- func (m *EventMutation) ResetCreatedAt()
- func (m *EventMutation) ResetEdge(name string) error
- func (m *EventMutation) ResetField(name string) error
- func (m *EventMutation) ResetMessage()
- func (m *EventMutation) ResetServer()
- func (m *EventMutation) ResetUser()
- func (m *EventMutation) ServerCleared() bool
- func (m *EventMutation) ServerIDs() (ids []int)
- func (m *EventMutation) SetCreatedAt(t time.Time)
- func (m *EventMutation) SetField(name string, value ent.Value) error
- func (m *EventMutation) SetMessage(s string)
- func (m EventMutation) Tx() (*Tx, error)
- func (m *EventMutation) Type() string
- func (m *EventMutation) UserCleared() bool
- func (m *EventMutation) UserIDs() (ids []int)
- type EventQuery
- func (eq *EventQuery) All(ctx context.Context) ([]*Event, error)
- func (eq *EventQuery) AllX(ctx context.Context) []*Event
- func (eq *EventQuery) Clone() *EventQuery
- func (eq *EventQuery) Count(ctx context.Context) (int, error)
- func (eq *EventQuery) CountX(ctx context.Context) int
- func (eq *EventQuery) Exist(ctx context.Context) (bool, error)
- func (eq *EventQuery) ExistX(ctx context.Context) bool
- func (eq *EventQuery) First(ctx context.Context) (*Event, error)
- func (eq *EventQuery) FirstID(ctx context.Context) (id int, err error)
- func (eq *EventQuery) FirstIDX(ctx context.Context) int
- func (eq *EventQuery) FirstX(ctx context.Context) *Event
- func (eq *EventQuery) GroupBy(field string, fields ...string) *EventGroupBy
- func (eq *EventQuery) IDs(ctx context.Context) ([]int, error)
- func (eq *EventQuery) IDsX(ctx context.Context) []int
- func (eq *EventQuery) Limit(limit int) *EventQuery
- func (eq *EventQuery) Offset(offset int) *EventQuery
- func (eq *EventQuery) Only(ctx context.Context) (*Event, error)
- func (eq *EventQuery) OnlyID(ctx context.Context) (id int, err error)
- func (eq *EventQuery) OnlyIDX(ctx context.Context) int
- func (eq *EventQuery) OnlyX(ctx context.Context) *Event
- func (eq *EventQuery) Order(o ...OrderFunc) *EventQuery
- func (eq *EventQuery) QueryServer() *ServerQuery
- func (eq *EventQuery) QueryUser() *UserQuery
- func (eq *EventQuery) Select(field string, fields ...string) *EventSelect
- func (eq *EventQuery) Where(ps ...predicate.Event) *EventQuery
- func (eq *EventQuery) WithServer(opts ...func(*ServerQuery)) *EventQuery
- func (eq *EventQuery) WithUser(opts ...func(*UserQuery)) *EventQuery
- type EventSelect
- func (es *EventSelect) Bool(ctx context.Context) (_ bool, err error)
- func (es *EventSelect) BoolX(ctx context.Context) bool
- func (es *EventSelect) Bools(ctx context.Context) ([]bool, error)
- func (es *EventSelect) BoolsX(ctx context.Context) []bool
- func (es *EventSelect) Float64(ctx context.Context) (_ float64, err error)
- func (es *EventSelect) Float64X(ctx context.Context) float64
- func (es *EventSelect) Float64s(ctx context.Context) ([]float64, error)
- func (es *EventSelect) Float64sX(ctx context.Context) []float64
- func (es *EventSelect) Int(ctx context.Context) (_ int, err error)
- func (es *EventSelect) IntX(ctx context.Context) int
- func (es *EventSelect) Ints(ctx context.Context) ([]int, error)
- func (es *EventSelect) IntsX(ctx context.Context) []int
- func (es *EventSelect) Scan(ctx context.Context, v interface{}) error
- func (es *EventSelect) ScanX(ctx context.Context, v interface{})
- func (es *EventSelect) String(ctx context.Context) (_ string, err error)
- func (es *EventSelect) StringX(ctx context.Context) string
- func (es *EventSelect) Strings(ctx context.Context) ([]string, error)
- func (es *EventSelect) StringsX(ctx context.Context) []string
- type EventUpdate
- func (eu *EventUpdate) AddServer(s ...*Server) *EventUpdate
- func (eu *EventUpdate) AddServerIDs(ids ...int) *EventUpdate
- func (eu *EventUpdate) AddUser(u ...*User) *EventUpdate
- func (eu *EventUpdate) AddUserIDs(ids ...int) *EventUpdate
- func (eu *EventUpdate) ClearServer() *EventUpdate
- func (eu *EventUpdate) ClearUser() *EventUpdate
- func (eu *EventUpdate) Exec(ctx context.Context) error
- func (eu *EventUpdate) ExecX(ctx context.Context)
- func (eu *EventUpdate) Mutation() *EventMutation
- func (eu *EventUpdate) RemoveServer(s ...*Server) *EventUpdate
- func (eu *EventUpdate) RemoveServerIDs(ids ...int) *EventUpdate
- func (eu *EventUpdate) RemoveUser(u ...*User) *EventUpdate
- func (eu *EventUpdate) RemoveUserIDs(ids ...int) *EventUpdate
- func (eu *EventUpdate) Save(ctx context.Context) (int, error)
- func (eu *EventUpdate) SaveX(ctx context.Context) int
- func (eu *EventUpdate) SetCreatedAt(t time.Time) *EventUpdate
- func (eu *EventUpdate) SetMessage(s string) *EventUpdate
- func (eu *EventUpdate) SetNillableCreatedAt(t *time.Time) *EventUpdate
- func (eu *EventUpdate) Where(ps ...predicate.Event) *EventUpdate
- type EventUpdateOne
- func (euo *EventUpdateOne) AddServer(s ...*Server) *EventUpdateOne
- func (euo *EventUpdateOne) AddServerIDs(ids ...int) *EventUpdateOne
- func (euo *EventUpdateOne) AddUser(u ...*User) *EventUpdateOne
- func (euo *EventUpdateOne) AddUserIDs(ids ...int) *EventUpdateOne
- func (euo *EventUpdateOne) ClearServer() *EventUpdateOne
- func (euo *EventUpdateOne) ClearUser() *EventUpdateOne
- func (euo *EventUpdateOne) Exec(ctx context.Context) error
- func (euo *EventUpdateOne) ExecX(ctx context.Context)
- func (euo *EventUpdateOne) Mutation() *EventMutation
- func (euo *EventUpdateOne) RemoveServer(s ...*Server) *EventUpdateOne
- func (euo *EventUpdateOne) RemoveServerIDs(ids ...int) *EventUpdateOne
- func (euo *EventUpdateOne) RemoveUser(u ...*User) *EventUpdateOne
- func (euo *EventUpdateOne) RemoveUserIDs(ids ...int) *EventUpdateOne
- func (euo *EventUpdateOne) Save(ctx context.Context) (*Event, error)
- func (euo *EventUpdateOne) SaveX(ctx context.Context) *Event
- func (euo *EventUpdateOne) SetCreatedAt(t time.Time) *EventUpdateOne
- func (euo *EventUpdateOne) SetMessage(s string) *EventUpdateOne
- func (euo *EventUpdateOne) SetNillableCreatedAt(t *time.Time) *EventUpdateOne
- type Events
- type Hook
- 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 Server
- type ServerClient
- func (c *ServerClient) Create() *ServerCreate
- func (c *ServerClient) CreateBulk(builders ...*ServerCreate) *ServerCreateBulk
- func (c *ServerClient) Delete() *ServerDelete
- func (c *ServerClient) DeleteOne(s *Server) *ServerDeleteOne
- func (c *ServerClient) DeleteOneID(id int) *ServerDeleteOne
- func (c *ServerClient) Get(ctx context.Context, id int) (*Server, error)
- func (c *ServerClient) GetX(ctx context.Context, id int) *Server
- func (c *ServerClient) Hooks() []Hook
- func (c *ServerClient) Query() *ServerQuery
- func (c *ServerClient) QueryEvent(s *Server) *EventQuery
- func (c *ServerClient) QueryOwners(s *Server) *UserQuery
- func (c *ServerClient) QueryTemplateFrom(s *Server) *TemplateQuery
- func (c *ServerClient) Update() *ServerUpdate
- func (c *ServerClient) UpdateOne(s *Server) *ServerUpdateOne
- func (c *ServerClient) UpdateOneID(id int) *ServerUpdateOne
- func (c *ServerClient) Use(hooks ...Hook)
- type ServerCreate
- func (sc *ServerCreate) AddEvent(e ...*Event) *ServerCreate
- func (sc *ServerCreate) AddEventIDs(ids ...int) *ServerCreate
- func (sc *ServerCreate) AddOwnerIDs(ids ...int) *ServerCreate
- func (sc *ServerCreate) AddOwners(u ...*User) *ServerCreate
- func (sc *ServerCreate) AddTemplateFrom(t ...*Template) *ServerCreate
- func (sc *ServerCreate) AddTemplateFromIDs(ids ...int) *ServerCreate
- func (sc *ServerCreate) Mutation() *ServerMutation
- func (sc *ServerCreate) Save(ctx context.Context) (*Server, error)
- func (sc *ServerCreate) SaveX(ctx context.Context) *Server
- func (sc *ServerCreate) SetCPU(i int) *ServerCreate
- func (sc *ServerCreate) SetCreatedAt(t time.Time) *ServerCreate
- func (sc *ServerCreate) SetDeletedAt(t time.Time) *ServerCreate
- func (sc *ServerCreate) SetDescription(s string) *ServerCreate
- func (sc *ServerCreate) SetIP(s string) *ServerCreate
- func (sc *ServerCreate) SetMemory(i int) *ServerCreate
- func (sc *ServerCreate) SetName(s string) *ServerCreate
- func (sc *ServerCreate) SetNillableCreatedAt(t *time.Time) *ServerCreate
- func (sc *ServerCreate) SetNillableDeletedAt(t *time.Time) *ServerCreate
- func (sc *ServerCreate) SetNvidiaGpu(i int) *ServerCreate
- func (sc *ServerCreate) SetTemplate(s string) *ServerCreate
- func (sc *ServerCreate) SetVariables(cv *common.TemplateVariables) *ServerCreate
- type ServerCreateBulk
- type ServerDelete
- type ServerDeleteOne
- type ServerEdges
- type ServerGroupBy
- func (sgb *ServerGroupBy) Aggregate(fns ...AggregateFunc) *ServerGroupBy
- func (sgb *ServerGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (sgb *ServerGroupBy) BoolX(ctx context.Context) bool
- func (sgb *ServerGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (sgb *ServerGroupBy) BoolsX(ctx context.Context) []bool
- func (sgb *ServerGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (sgb *ServerGroupBy) Float64X(ctx context.Context) float64
- func (sgb *ServerGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (sgb *ServerGroupBy) Float64sX(ctx context.Context) []float64
- func (sgb *ServerGroupBy) Int(ctx context.Context) (_ int, err error)
- func (sgb *ServerGroupBy) IntX(ctx context.Context) int
- func (sgb *ServerGroupBy) Ints(ctx context.Context) ([]int, error)
- func (sgb *ServerGroupBy) IntsX(ctx context.Context) []int
- func (sgb *ServerGroupBy) Scan(ctx context.Context, v interface{}) error
- func (sgb *ServerGroupBy) ScanX(ctx context.Context, v interface{})
- func (sgb *ServerGroupBy) String(ctx context.Context) (_ string, err error)
- func (sgb *ServerGroupBy) StringX(ctx context.Context) string
- func (sgb *ServerGroupBy) Strings(ctx context.Context) ([]string, error)
- func (sgb *ServerGroupBy) StringsX(ctx context.Context) []string
- type ServerMutation
- func (m *ServerMutation) AddCPU(i int)
- func (m *ServerMutation) AddEventIDs(ids ...int)
- func (m *ServerMutation) AddField(name string, value ent.Value) error
- func (m *ServerMutation) AddMemory(i int)
- func (m *ServerMutation) AddNvidiaGpu(i int)
- func (m *ServerMutation) AddOwnerIDs(ids ...int)
- func (m *ServerMutation) AddTemplateFromIDs(ids ...int)
- func (m *ServerMutation) AddedCPU() (r int, exists bool)
- func (m *ServerMutation) AddedEdges() []string
- func (m *ServerMutation) AddedField(name string) (ent.Value, bool)
- func (m *ServerMutation) AddedFields() []string
- func (m *ServerMutation) AddedIDs(name string) []ent.Value
- func (m *ServerMutation) AddedMemory() (r int, exists bool)
- func (m *ServerMutation) AddedNvidiaGpu() (r int, exists bool)
- func (m *ServerMutation) CPU() (r int, exists bool)
- func (m *ServerMutation) ClearDeletedAt()
- func (m *ServerMutation) ClearEdge(name string) error
- func (m *ServerMutation) ClearEvent()
- func (m *ServerMutation) ClearField(name string) error
- func (m *ServerMutation) ClearOwners()
- func (m *ServerMutation) ClearTemplateFrom()
- func (m *ServerMutation) ClearedEdges() []string
- func (m *ServerMutation) ClearedFields() []string
- func (m ServerMutation) Client() *Client
- func (m *ServerMutation) CreatedAt() (r time.Time, exists bool)
- func (m *ServerMutation) DeletedAt() (r time.Time, exists bool)
- func (m *ServerMutation) DeletedAtCleared() bool
- func (m *ServerMutation) Description() (r string, exists bool)
- func (m *ServerMutation) EdgeCleared(name string) bool
- func (m *ServerMutation) EventCleared() bool
- func (m *ServerMutation) EventIDs() (ids []int)
- func (m *ServerMutation) Field(name string) (ent.Value, bool)
- func (m *ServerMutation) FieldCleared(name string) bool
- func (m *ServerMutation) Fields() []string
- func (m *ServerMutation) ID() (id int, exists bool)
- func (m *ServerMutation) IP() (r string, exists bool)
- func (m *ServerMutation) Memory() (r int, exists bool)
- func (m *ServerMutation) Name() (r string, exists bool)
- func (m *ServerMutation) NvidiaGpu() (r int, exists bool)
- func (m *ServerMutation) OldCPU(ctx context.Context) (v int, err error)
- func (m *ServerMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ServerMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)
- func (m *ServerMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *ServerMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ServerMutation) OldIP(ctx context.Context) (v string, err error)
- func (m *ServerMutation) OldMemory(ctx context.Context) (v int, err error)
- func (m *ServerMutation) OldName(ctx context.Context) (v string, err error)
- func (m *ServerMutation) OldNvidiaGpu(ctx context.Context) (v int, err error)
- func (m *ServerMutation) OldTemplate(ctx context.Context) (v string, err error)
- func (m *ServerMutation) OldVariables(ctx context.Context) (v *common.TemplateVariables, err error)
- func (m *ServerMutation) Op() Op
- func (m *ServerMutation) OwnersCleared() bool
- func (m *ServerMutation) OwnersIDs() (ids []int)
- func (m *ServerMutation) RemoveEventIDs(ids ...int)
- func (m *ServerMutation) RemoveOwnerIDs(ids ...int)
- func (m *ServerMutation) RemoveTemplateFromIDs(ids ...int)
- func (m *ServerMutation) RemovedEdges() []string
- func (m *ServerMutation) RemovedEventIDs() (ids []int)
- func (m *ServerMutation) RemovedIDs(name string) []ent.Value
- func (m *ServerMutation) RemovedOwnersIDs() (ids []int)
- func (m *ServerMutation) RemovedTemplateFromIDs() (ids []int)
- func (m *ServerMutation) ResetCPU()
- func (m *ServerMutation) ResetCreatedAt()
- func (m *ServerMutation) ResetDeletedAt()
- func (m *ServerMutation) ResetDescription()
- func (m *ServerMutation) ResetEdge(name string) error
- func (m *ServerMutation) ResetEvent()
- func (m *ServerMutation) ResetField(name string) error
- func (m *ServerMutation) ResetIP()
- func (m *ServerMutation) ResetMemory()
- func (m *ServerMutation) ResetName()
- func (m *ServerMutation) ResetNvidiaGpu()
- func (m *ServerMutation) ResetOwners()
- func (m *ServerMutation) ResetTemplate()
- func (m *ServerMutation) ResetTemplateFrom()
- func (m *ServerMutation) ResetVariables()
- func (m *ServerMutation) SetCPU(i int)
- func (m *ServerMutation) SetCreatedAt(t time.Time)
- func (m *ServerMutation) SetDeletedAt(t time.Time)
- func (m *ServerMutation) SetDescription(s string)
- func (m *ServerMutation) SetField(name string, value ent.Value) error
- func (m *ServerMutation) SetIP(s string)
- func (m *ServerMutation) SetMemory(i int)
- func (m *ServerMutation) SetName(s string)
- func (m *ServerMutation) SetNvidiaGpu(i int)
- func (m *ServerMutation) SetTemplate(s string)
- func (m *ServerMutation) SetVariables(cv *common.TemplateVariables)
- func (m *ServerMutation) Template() (r string, exists bool)
- func (m *ServerMutation) TemplateFromCleared() bool
- func (m *ServerMutation) TemplateFromIDs() (ids []int)
- func (m ServerMutation) Tx() (*Tx, error)
- func (m *ServerMutation) Type() string
- func (m *ServerMutation) Variables() (r *common.TemplateVariables, exists bool)
- type ServerQuery
- func (sq *ServerQuery) All(ctx context.Context) ([]*Server, error)
- func (sq *ServerQuery) AllX(ctx context.Context) []*Server
- func (sq *ServerQuery) Clone() *ServerQuery
- func (sq *ServerQuery) Count(ctx context.Context) (int, error)
- func (sq *ServerQuery) CountX(ctx context.Context) int
- func (sq *ServerQuery) Exist(ctx context.Context) (bool, error)
- func (sq *ServerQuery) ExistX(ctx context.Context) bool
- func (sq *ServerQuery) First(ctx context.Context) (*Server, error)
- func (sq *ServerQuery) FirstID(ctx context.Context) (id int, err error)
- func (sq *ServerQuery) FirstIDX(ctx context.Context) int
- func (sq *ServerQuery) FirstX(ctx context.Context) *Server
- func (sq *ServerQuery) GroupBy(field string, fields ...string) *ServerGroupBy
- func (sq *ServerQuery) IDs(ctx context.Context) ([]int, error)
- func (sq *ServerQuery) IDsX(ctx context.Context) []int
- func (sq *ServerQuery) Limit(limit int) *ServerQuery
- func (sq *ServerQuery) Offset(offset int) *ServerQuery
- func (sq *ServerQuery) Only(ctx context.Context) (*Server, error)
- func (sq *ServerQuery) OnlyID(ctx context.Context) (id int, err error)
- func (sq *ServerQuery) OnlyIDX(ctx context.Context) int
- func (sq *ServerQuery) OnlyX(ctx context.Context) *Server
- func (sq *ServerQuery) Order(o ...OrderFunc) *ServerQuery
- func (sq *ServerQuery) QueryEvent() *EventQuery
- func (sq *ServerQuery) QueryOwners() *UserQuery
- func (sq *ServerQuery) QueryTemplateFrom() *TemplateQuery
- func (sq *ServerQuery) Select(field string, fields ...string) *ServerSelect
- func (sq *ServerQuery) Where(ps ...predicate.Server) *ServerQuery
- func (sq *ServerQuery) WithEvent(opts ...func(*EventQuery)) *ServerQuery
- func (sq *ServerQuery) WithOwners(opts ...func(*UserQuery)) *ServerQuery
- func (sq *ServerQuery) WithTemplateFrom(opts ...func(*TemplateQuery)) *ServerQuery
- type ServerSelect
- func (ss *ServerSelect) Bool(ctx context.Context) (_ bool, err error)
- func (ss *ServerSelect) BoolX(ctx context.Context) bool
- func (ss *ServerSelect) Bools(ctx context.Context) ([]bool, error)
- func (ss *ServerSelect) BoolsX(ctx context.Context) []bool
- func (ss *ServerSelect) Float64(ctx context.Context) (_ float64, err error)
- func (ss *ServerSelect) Float64X(ctx context.Context) float64
- func (ss *ServerSelect) Float64s(ctx context.Context) ([]float64, error)
- func (ss *ServerSelect) Float64sX(ctx context.Context) []float64
- func (ss *ServerSelect) Int(ctx context.Context) (_ int, err error)
- func (ss *ServerSelect) IntX(ctx context.Context) int
- func (ss *ServerSelect) Ints(ctx context.Context) ([]int, error)
- func (ss *ServerSelect) IntsX(ctx context.Context) []int
- func (ss *ServerSelect) Scan(ctx context.Context, v interface{}) error
- func (ss *ServerSelect) ScanX(ctx context.Context, v interface{})
- func (ss *ServerSelect) String(ctx context.Context) (_ string, err error)
- func (ss *ServerSelect) StringX(ctx context.Context) string
- func (ss *ServerSelect) Strings(ctx context.Context) ([]string, error)
- func (ss *ServerSelect) StringsX(ctx context.Context) []string
- type ServerUpdate
- func (su *ServerUpdate) AddCPU(i int) *ServerUpdate
- func (su *ServerUpdate) AddEvent(e ...*Event) *ServerUpdate
- func (su *ServerUpdate) AddEventIDs(ids ...int) *ServerUpdate
- func (su *ServerUpdate) AddMemory(i int) *ServerUpdate
- func (su *ServerUpdate) AddNvidiaGpu(i int) *ServerUpdate
- func (su *ServerUpdate) AddOwnerIDs(ids ...int) *ServerUpdate
- func (su *ServerUpdate) AddOwners(u ...*User) *ServerUpdate
- func (su *ServerUpdate) AddTemplateFrom(t ...*Template) *ServerUpdate
- func (su *ServerUpdate) AddTemplateFromIDs(ids ...int) *ServerUpdate
- func (su *ServerUpdate) ClearDeletedAt() *ServerUpdate
- func (su *ServerUpdate) ClearEvent() *ServerUpdate
- func (su *ServerUpdate) ClearOwners() *ServerUpdate
- func (su *ServerUpdate) ClearTemplateFrom() *ServerUpdate
- func (su *ServerUpdate) Exec(ctx context.Context) error
- func (su *ServerUpdate) ExecX(ctx context.Context)
- func (su *ServerUpdate) Mutation() *ServerMutation
- func (su *ServerUpdate) RemoveEvent(e ...*Event) *ServerUpdate
- func (su *ServerUpdate) RemoveEventIDs(ids ...int) *ServerUpdate
- func (su *ServerUpdate) RemoveOwnerIDs(ids ...int) *ServerUpdate
- func (su *ServerUpdate) RemoveOwners(u ...*User) *ServerUpdate
- func (su *ServerUpdate) RemoveTemplateFrom(t ...*Template) *ServerUpdate
- func (su *ServerUpdate) RemoveTemplateFromIDs(ids ...int) *ServerUpdate
- func (su *ServerUpdate) Save(ctx context.Context) (int, error)
- func (su *ServerUpdate) SaveX(ctx context.Context) int
- func (su *ServerUpdate) SetCPU(i int) *ServerUpdate
- func (su *ServerUpdate) SetCreatedAt(t time.Time) *ServerUpdate
- func (su *ServerUpdate) SetDeletedAt(t time.Time) *ServerUpdate
- func (su *ServerUpdate) SetDescription(s string) *ServerUpdate
- func (su *ServerUpdate) SetIP(s string) *ServerUpdate
- func (su *ServerUpdate) SetMemory(i int) *ServerUpdate
- func (su *ServerUpdate) SetName(s string) *ServerUpdate
- func (su *ServerUpdate) SetNillableCreatedAt(t *time.Time) *ServerUpdate
- func (su *ServerUpdate) SetNillableDeletedAt(t *time.Time) *ServerUpdate
- func (su *ServerUpdate) SetNvidiaGpu(i int) *ServerUpdate
- func (su *ServerUpdate) SetTemplate(s string) *ServerUpdate
- func (su *ServerUpdate) SetVariables(cv *common.TemplateVariables) *ServerUpdate
- func (su *ServerUpdate) Where(ps ...predicate.Server) *ServerUpdate
- type ServerUpdateOne
- func (suo *ServerUpdateOne) AddCPU(i int) *ServerUpdateOne
- func (suo *ServerUpdateOne) AddEvent(e ...*Event) *ServerUpdateOne
- func (suo *ServerUpdateOne) AddEventIDs(ids ...int) *ServerUpdateOne
- func (suo *ServerUpdateOne) AddMemory(i int) *ServerUpdateOne
- func (suo *ServerUpdateOne) AddNvidiaGpu(i int) *ServerUpdateOne
- func (suo *ServerUpdateOne) AddOwnerIDs(ids ...int) *ServerUpdateOne
- func (suo *ServerUpdateOne) AddOwners(u ...*User) *ServerUpdateOne
- func (suo *ServerUpdateOne) AddTemplateFrom(t ...*Template) *ServerUpdateOne
- func (suo *ServerUpdateOne) AddTemplateFromIDs(ids ...int) *ServerUpdateOne
- func (suo *ServerUpdateOne) ClearDeletedAt() *ServerUpdateOne
- func (suo *ServerUpdateOne) ClearEvent() *ServerUpdateOne
- func (suo *ServerUpdateOne) ClearOwners() *ServerUpdateOne
- func (suo *ServerUpdateOne) ClearTemplateFrom() *ServerUpdateOne
- func (suo *ServerUpdateOne) Exec(ctx context.Context) error
- func (suo *ServerUpdateOne) ExecX(ctx context.Context)
- func (suo *ServerUpdateOne) Mutation() *ServerMutation
- func (suo *ServerUpdateOne) RemoveEvent(e ...*Event) *ServerUpdateOne
- func (suo *ServerUpdateOne) RemoveEventIDs(ids ...int) *ServerUpdateOne
- func (suo *ServerUpdateOne) RemoveOwnerIDs(ids ...int) *ServerUpdateOne
- func (suo *ServerUpdateOne) RemoveOwners(u ...*User) *ServerUpdateOne
- func (suo *ServerUpdateOne) RemoveTemplateFrom(t ...*Template) *ServerUpdateOne
- func (suo *ServerUpdateOne) RemoveTemplateFromIDs(ids ...int) *ServerUpdateOne
- func (suo *ServerUpdateOne) Save(ctx context.Context) (*Server, error)
- func (suo *ServerUpdateOne) SaveX(ctx context.Context) *Server
- func (suo *ServerUpdateOne) SetCPU(i int) *ServerUpdateOne
- func (suo *ServerUpdateOne) SetCreatedAt(t time.Time) *ServerUpdateOne
- func (suo *ServerUpdateOne) SetDeletedAt(t time.Time) *ServerUpdateOne
- func (suo *ServerUpdateOne) SetDescription(s string) *ServerUpdateOne
- func (suo *ServerUpdateOne) SetIP(s string) *ServerUpdateOne
- func (suo *ServerUpdateOne) SetMemory(i int) *ServerUpdateOne
- func (suo *ServerUpdateOne) SetName(s string) *ServerUpdateOne
- func (suo *ServerUpdateOne) SetNillableCreatedAt(t *time.Time) *ServerUpdateOne
- func (suo *ServerUpdateOne) SetNillableDeletedAt(t *time.Time) *ServerUpdateOne
- func (suo *ServerUpdateOne) SetNvidiaGpu(i int) *ServerUpdateOne
- func (suo *ServerUpdateOne) SetTemplate(s string) *ServerUpdateOne
- func (suo *ServerUpdateOne) SetVariables(cv *common.TemplateVariables) *ServerUpdateOne
- type Servers
- type Template
- type TemplateClient
- func (c *TemplateClient) Create() *TemplateCreate
- func (c *TemplateClient) CreateBulk(builders ...*TemplateCreate) *TemplateCreateBulk
- func (c *TemplateClient) Delete() *TemplateDelete
- func (c *TemplateClient) DeleteOne(t *Template) *TemplateDeleteOne
- func (c *TemplateClient) DeleteOneID(id int) *TemplateDeleteOne
- func (c *TemplateClient) Get(ctx context.Context, id int) (*Template, error)
- func (c *TemplateClient) GetX(ctx context.Context, id int) *Template
- func (c *TemplateClient) Hooks() []Hook
- func (c *TemplateClient) Query() *TemplateQuery
- func (c *TemplateClient) QueryServer(t *Template) *ServerQuery
- func (c *TemplateClient) QueryUser(t *Template) *UserQuery
- func (c *TemplateClient) Update() *TemplateUpdate
- func (c *TemplateClient) UpdateOne(t *Template) *TemplateUpdateOne
- func (c *TemplateClient) UpdateOneID(id int) *TemplateUpdateOne
- func (c *TemplateClient) Use(hooks ...Hook)
- type TemplateCreate
- func (tc *TemplateCreate) AddServer(s ...*Server) *TemplateCreate
- func (tc *TemplateCreate) AddServerIDs(ids ...int) *TemplateCreate
- func (tc *TemplateCreate) AddUser(u ...*User) *TemplateCreate
- func (tc *TemplateCreate) AddUserIDs(ids ...int) *TemplateCreate
- func (tc *TemplateCreate) Mutation() *TemplateMutation
- func (tc *TemplateCreate) Save(ctx context.Context) (*Template, error)
- func (tc *TemplateCreate) SaveX(ctx context.Context) *Template
- func (tc *TemplateCreate) SetCreatedAt(t time.Time) *TemplateCreate
- func (tc *TemplateCreate) SetDeletedAt(t time.Time) *TemplateCreate
- func (tc *TemplateCreate) SetDescription(s string) *TemplateCreate
- func (tc *TemplateCreate) SetName(s string) *TemplateCreate
- func (tc *TemplateCreate) SetNillableCreatedAt(t *time.Time) *TemplateCreate
- func (tc *TemplateCreate) SetNillableDeletedAt(t *time.Time) *TemplateCreate
- func (tc *TemplateCreate) SetNillableDescription(s *string) *TemplateCreate
- func (tc *TemplateCreate) SetTemplate(s string) *TemplateCreate
- func (tc *TemplateCreate) SetVariables(cv *common.TemplateVariables) *TemplateCreate
- type TemplateCreateBulk
- type TemplateDelete
- type TemplateDeleteOne
- type TemplateEdges
- type TemplateGroupBy
- func (tgb *TemplateGroupBy) Aggregate(fns ...AggregateFunc) *TemplateGroupBy
- func (tgb *TemplateGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (tgb *TemplateGroupBy) BoolX(ctx context.Context) bool
- func (tgb *TemplateGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (tgb *TemplateGroupBy) BoolsX(ctx context.Context) []bool
- func (tgb *TemplateGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (tgb *TemplateGroupBy) Float64X(ctx context.Context) float64
- func (tgb *TemplateGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (tgb *TemplateGroupBy) Float64sX(ctx context.Context) []float64
- func (tgb *TemplateGroupBy) Int(ctx context.Context) (_ int, err error)
- func (tgb *TemplateGroupBy) IntX(ctx context.Context) int
- func (tgb *TemplateGroupBy) Ints(ctx context.Context) ([]int, error)
- func (tgb *TemplateGroupBy) IntsX(ctx context.Context) []int
- func (tgb *TemplateGroupBy) Scan(ctx context.Context, v interface{}) error
- func (tgb *TemplateGroupBy) ScanX(ctx context.Context, v interface{})
- func (tgb *TemplateGroupBy) String(ctx context.Context) (_ string, err error)
- func (tgb *TemplateGroupBy) StringX(ctx context.Context) string
- func (tgb *TemplateGroupBy) Strings(ctx context.Context) ([]string, error)
- func (tgb *TemplateGroupBy) StringsX(ctx context.Context) []string
- type TemplateMutation
- func (m *TemplateMutation) AddField(name string, value ent.Value) error
- func (m *TemplateMutation) AddServerIDs(ids ...int)
- func (m *TemplateMutation) AddUserIDs(ids ...int)
- func (m *TemplateMutation) AddedEdges() []string
- func (m *TemplateMutation) AddedField(name string) (ent.Value, bool)
- func (m *TemplateMutation) AddedFields() []string
- func (m *TemplateMutation) AddedIDs(name string) []ent.Value
- func (m *TemplateMutation) ClearDeletedAt()
- func (m *TemplateMutation) ClearDescription()
- func (m *TemplateMutation) ClearEdge(name string) error
- func (m *TemplateMutation) ClearField(name string) error
- func (m *TemplateMutation) ClearServer()
- func (m *TemplateMutation) ClearUser()
- func (m *TemplateMutation) ClearedEdges() []string
- func (m *TemplateMutation) ClearedFields() []string
- func (m TemplateMutation) Client() *Client
- func (m *TemplateMutation) CreatedAt() (r time.Time, exists bool)
- func (m *TemplateMutation) DeletedAt() (r time.Time, exists bool)
- func (m *TemplateMutation) DeletedAtCleared() bool
- func (m *TemplateMutation) Description() (r string, exists bool)
- func (m *TemplateMutation) DescriptionCleared() bool
- func (m *TemplateMutation) EdgeCleared(name string) bool
- func (m *TemplateMutation) Field(name string) (ent.Value, bool)
- func (m *TemplateMutation) FieldCleared(name string) bool
- func (m *TemplateMutation) Fields() []string
- func (m *TemplateMutation) ID() (id int, exists bool)
- func (m *TemplateMutation) Name() (r string, exists bool)
- func (m *TemplateMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *TemplateMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)
- func (m *TemplateMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *TemplateMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TemplateMutation) OldName(ctx context.Context) (v string, err error)
- func (m *TemplateMutation) OldTemplate(ctx context.Context) (v string, err error)
- func (m *TemplateMutation) OldVariables(ctx context.Context) (v *common.TemplateVariables, err error)
- func (m *TemplateMutation) Op() Op
- func (m *TemplateMutation) RemoveServerIDs(ids ...int)
- func (m *TemplateMutation) RemoveUserIDs(ids ...int)
- func (m *TemplateMutation) RemovedEdges() []string
- func (m *TemplateMutation) RemovedIDs(name string) []ent.Value
- func (m *TemplateMutation) RemovedServerIDs() (ids []int)
- func (m *TemplateMutation) RemovedUserIDs() (ids []int)
- func (m *TemplateMutation) ResetCreatedAt()
- func (m *TemplateMutation) ResetDeletedAt()
- func (m *TemplateMutation) ResetDescription()
- func (m *TemplateMutation) ResetEdge(name string) error
- func (m *TemplateMutation) ResetField(name string) error
- func (m *TemplateMutation) ResetName()
- func (m *TemplateMutation) ResetServer()
- func (m *TemplateMutation) ResetTemplate()
- func (m *TemplateMutation) ResetUser()
- func (m *TemplateMutation) ResetVariables()
- func (m *TemplateMutation) ServerCleared() bool
- func (m *TemplateMutation) ServerIDs() (ids []int)
- func (m *TemplateMutation) SetCreatedAt(t time.Time)
- func (m *TemplateMutation) SetDeletedAt(t time.Time)
- func (m *TemplateMutation) SetDescription(s string)
- func (m *TemplateMutation) SetField(name string, value ent.Value) error
- func (m *TemplateMutation) SetName(s string)
- func (m *TemplateMutation) SetTemplate(s string)
- func (m *TemplateMutation) SetVariables(cv *common.TemplateVariables)
- func (m *TemplateMutation) Template() (r string, exists bool)
- func (m TemplateMutation) Tx() (*Tx, error)
- func (m *TemplateMutation) Type() string
- func (m *TemplateMutation) UserCleared() bool
- func (m *TemplateMutation) UserIDs() (ids []int)
- func (m *TemplateMutation) Variables() (r *common.TemplateVariables, exists bool)
- type TemplateQuery
- func (tq *TemplateQuery) All(ctx context.Context) ([]*Template, error)
- func (tq *TemplateQuery) AllX(ctx context.Context) []*Template
- func (tq *TemplateQuery) Clone() *TemplateQuery
- func (tq *TemplateQuery) Count(ctx context.Context) (int, error)
- func (tq *TemplateQuery) CountX(ctx context.Context) int
- func (tq *TemplateQuery) Exist(ctx context.Context) (bool, error)
- func (tq *TemplateQuery) ExistX(ctx context.Context) bool
- func (tq *TemplateQuery) First(ctx context.Context) (*Template, error)
- func (tq *TemplateQuery) FirstID(ctx context.Context) (id int, err error)
- func (tq *TemplateQuery) FirstIDX(ctx context.Context) int
- func (tq *TemplateQuery) FirstX(ctx context.Context) *Template
- func (tq *TemplateQuery) GroupBy(field string, fields ...string) *TemplateGroupBy
- func (tq *TemplateQuery) IDs(ctx context.Context) ([]int, error)
- func (tq *TemplateQuery) IDsX(ctx context.Context) []int
- func (tq *TemplateQuery) Limit(limit int) *TemplateQuery
- func (tq *TemplateQuery) Offset(offset int) *TemplateQuery
- func (tq *TemplateQuery) Only(ctx context.Context) (*Template, error)
- func (tq *TemplateQuery) OnlyID(ctx context.Context) (id int, err error)
- func (tq *TemplateQuery) OnlyIDX(ctx context.Context) int
- func (tq *TemplateQuery) OnlyX(ctx context.Context) *Template
- func (tq *TemplateQuery) Order(o ...OrderFunc) *TemplateQuery
- func (tq *TemplateQuery) QueryServer() *ServerQuery
- func (tq *TemplateQuery) QueryUser() *UserQuery
- func (tq *TemplateQuery) Select(field string, fields ...string) *TemplateSelect
- func (tq *TemplateQuery) Where(ps ...predicate.Template) *TemplateQuery
- func (tq *TemplateQuery) WithServer(opts ...func(*ServerQuery)) *TemplateQuery
- func (tq *TemplateQuery) WithUser(opts ...func(*UserQuery)) *TemplateQuery
- type TemplateSelect
- func (ts *TemplateSelect) Bool(ctx context.Context) (_ bool, err error)
- func (ts *TemplateSelect) BoolX(ctx context.Context) bool
- func (ts *TemplateSelect) Bools(ctx context.Context) ([]bool, error)
- func (ts *TemplateSelect) BoolsX(ctx context.Context) []bool
- func (ts *TemplateSelect) Float64(ctx context.Context) (_ float64, err error)
- func (ts *TemplateSelect) Float64X(ctx context.Context) float64
- func (ts *TemplateSelect) Float64s(ctx context.Context) ([]float64, error)
- func (ts *TemplateSelect) Float64sX(ctx context.Context) []float64
- func (ts *TemplateSelect) Int(ctx context.Context) (_ int, err error)
- func (ts *TemplateSelect) IntX(ctx context.Context) int
- func (ts *TemplateSelect) Ints(ctx context.Context) ([]int, error)
- func (ts *TemplateSelect) IntsX(ctx context.Context) []int
- func (ts *TemplateSelect) Scan(ctx context.Context, v interface{}) error
- func (ts *TemplateSelect) ScanX(ctx context.Context, v interface{})
- func (ts *TemplateSelect) String(ctx context.Context) (_ string, err error)
- func (ts *TemplateSelect) StringX(ctx context.Context) string
- func (ts *TemplateSelect) Strings(ctx context.Context) ([]string, error)
- func (ts *TemplateSelect) StringsX(ctx context.Context) []string
- type TemplateUpdate
- func (tu *TemplateUpdate) AddServer(s ...*Server) *TemplateUpdate
- func (tu *TemplateUpdate) AddServerIDs(ids ...int) *TemplateUpdate
- func (tu *TemplateUpdate) AddUser(u ...*User) *TemplateUpdate
- func (tu *TemplateUpdate) AddUserIDs(ids ...int) *TemplateUpdate
- func (tu *TemplateUpdate) ClearDeletedAt() *TemplateUpdate
- func (tu *TemplateUpdate) ClearDescription() *TemplateUpdate
- func (tu *TemplateUpdate) ClearServer() *TemplateUpdate
- func (tu *TemplateUpdate) ClearUser() *TemplateUpdate
- func (tu *TemplateUpdate) Exec(ctx context.Context) error
- func (tu *TemplateUpdate) ExecX(ctx context.Context)
- func (tu *TemplateUpdate) Mutation() *TemplateMutation
- func (tu *TemplateUpdate) RemoveServer(s ...*Server) *TemplateUpdate
- func (tu *TemplateUpdate) RemoveServerIDs(ids ...int) *TemplateUpdate
- func (tu *TemplateUpdate) RemoveUser(u ...*User) *TemplateUpdate
- func (tu *TemplateUpdate) RemoveUserIDs(ids ...int) *TemplateUpdate
- func (tu *TemplateUpdate) Save(ctx context.Context) (int, error)
- func (tu *TemplateUpdate) SaveX(ctx context.Context) int
- func (tu *TemplateUpdate) SetCreatedAt(t time.Time) *TemplateUpdate
- func (tu *TemplateUpdate) SetDeletedAt(t time.Time) *TemplateUpdate
- func (tu *TemplateUpdate) SetDescription(s string) *TemplateUpdate
- func (tu *TemplateUpdate) SetName(s string) *TemplateUpdate
- func (tu *TemplateUpdate) SetNillableCreatedAt(t *time.Time) *TemplateUpdate
- func (tu *TemplateUpdate) SetNillableDeletedAt(t *time.Time) *TemplateUpdate
- func (tu *TemplateUpdate) SetNillableDescription(s *string) *TemplateUpdate
- func (tu *TemplateUpdate) SetTemplate(s string) *TemplateUpdate
- func (tu *TemplateUpdate) SetVariables(cv *common.TemplateVariables) *TemplateUpdate
- func (tu *TemplateUpdate) Where(ps ...predicate.Template) *TemplateUpdate
- type TemplateUpdateOne
- func (tuo *TemplateUpdateOne) AddServer(s ...*Server) *TemplateUpdateOne
- func (tuo *TemplateUpdateOne) AddServerIDs(ids ...int) *TemplateUpdateOne
- func (tuo *TemplateUpdateOne) AddUser(u ...*User) *TemplateUpdateOne
- func (tuo *TemplateUpdateOne) AddUserIDs(ids ...int) *TemplateUpdateOne
- func (tuo *TemplateUpdateOne) ClearDeletedAt() *TemplateUpdateOne
- func (tuo *TemplateUpdateOne) ClearDescription() *TemplateUpdateOne
- func (tuo *TemplateUpdateOne) ClearServer() *TemplateUpdateOne
- func (tuo *TemplateUpdateOne) ClearUser() *TemplateUpdateOne
- func (tuo *TemplateUpdateOne) Exec(ctx context.Context) error
- func (tuo *TemplateUpdateOne) ExecX(ctx context.Context)
- func (tuo *TemplateUpdateOne) Mutation() *TemplateMutation
- func (tuo *TemplateUpdateOne) RemoveServer(s ...*Server) *TemplateUpdateOne
- func (tuo *TemplateUpdateOne) RemoveServerIDs(ids ...int) *TemplateUpdateOne
- func (tuo *TemplateUpdateOne) RemoveUser(u ...*User) *TemplateUpdateOne
- func (tuo *TemplateUpdateOne) RemoveUserIDs(ids ...int) *TemplateUpdateOne
- func (tuo *TemplateUpdateOne) Save(ctx context.Context) (*Template, error)
- func (tuo *TemplateUpdateOne) SaveX(ctx context.Context) *Template
- func (tuo *TemplateUpdateOne) SetCreatedAt(t time.Time) *TemplateUpdateOne
- func (tuo *TemplateUpdateOne) SetDeletedAt(t time.Time) *TemplateUpdateOne
- func (tuo *TemplateUpdateOne) SetDescription(s string) *TemplateUpdateOne
- func (tuo *TemplateUpdateOne) SetName(s string) *TemplateUpdateOne
- func (tuo *TemplateUpdateOne) SetNillableCreatedAt(t *time.Time) *TemplateUpdateOne
- func (tuo *TemplateUpdateOne) SetNillableDeletedAt(t *time.Time) *TemplateUpdateOne
- func (tuo *TemplateUpdateOne) SetNillableDescription(s *string) *TemplateUpdateOne
- func (tuo *TemplateUpdateOne) SetTemplate(s string) *TemplateUpdateOne
- func (tuo *TemplateUpdateOne) SetVariables(cv *common.TemplateVariables) *TemplateUpdateOne
- type Templates
- 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) QueryEvents(u *User) *EventQuery
- func (c *UserClient) QueryServers(u *User) *ServerQuery
- func (c *UserClient) QueryTemplates(u *User) *TemplateQuery
- 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
- func (uc *UserCreate) AddEventIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddEvents(e ...*Event) *UserCreate
- func (uc *UserCreate) AddServerIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddServers(s ...*Server) *UserCreate
- func (uc *UserCreate) AddTemplateIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddTemplates(t ...*Template) *UserCreate
- func (uc *UserCreate) Mutation() *UserMutation
- func (uc *UserCreate) Save(ctx context.Context) (*User, error)
- func (uc *UserCreate) SaveX(ctx context.Context) *User
- func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate
- func (uc *UserCreate) SetDeletedAt(t time.Time) *UserCreate
- func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableDeletedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableQuotaCPU(i *int) *UserCreate
- func (uc *UserCreate) SetNillableQuotaInstance(i *int) *UserCreate
- func (uc *UserCreate) SetNillableQuotaMemory(i *int) *UserCreate
- func (uc *UserCreate) SetNillableQuotaNvidiaGpu(i *int) *UserCreate
- func (uc *UserCreate) SetNillableQuotaStorage(i *int) *UserCreate
- func (uc *UserCreate) SetQuotaCPU(i int) *UserCreate
- func (uc *UserCreate) SetQuotaInstance(i int) *UserCreate
- func (uc *UserCreate) SetQuotaMemory(i int) *UserCreate
- func (uc *UserCreate) SetQuotaNvidiaGpu(i int) *UserCreate
- func (uc *UserCreate) SetQuotaStorage(i int) *UserCreate
- func (uc *UserCreate) SetUserID(s string) *UserCreate
- func (uc *UserCreate) SetUserPw(s string) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserEdges
- 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) AddEventIDs(ids ...int)
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddQuotaCPU(i int)
- func (m *UserMutation) AddQuotaInstance(i int)
- func (m *UserMutation) AddQuotaMemory(i int)
- func (m *UserMutation) AddQuotaNvidiaGpu(i int)
- func (m *UserMutation) AddQuotaStorage(i int)
- func (m *UserMutation) AddServerIDs(ids ...int)
- func (m *UserMutation) AddTemplateIDs(ids ...int)
- 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) AddedQuotaCPU() (r int, exists bool)
- func (m *UserMutation) AddedQuotaInstance() (r int, exists bool)
- func (m *UserMutation) AddedQuotaMemory() (r int, exists bool)
- func (m *UserMutation) AddedQuotaNvidiaGpu() (r int, exists bool)
- func (m *UserMutation) AddedQuotaStorage() (r int, exists bool)
- func (m *UserMutation) ClearDeletedAt()
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearEvents()
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearServers()
- func (m *UserMutation) ClearTemplates()
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) CreatedAt() (r time.Time, exists bool)
- func (m *UserMutation) DeletedAt() (r time.Time, exists bool)
- func (m *UserMutation) DeletedAtCleared() bool
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) EventsCleared() bool
- func (m *UserMutation) EventsIDs() (ids []int)
- 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) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldQuotaCPU(ctx context.Context) (v int, err error)
- func (m *UserMutation) OldQuotaInstance(ctx context.Context) (v int, err error)
- func (m *UserMutation) OldQuotaMemory(ctx context.Context) (v int, err error)
- func (m *UserMutation) OldQuotaNvidiaGpu(ctx context.Context) (v int, err error)
- func (m *UserMutation) OldQuotaStorage(ctx context.Context) (v int, err error)
- func (m *UserMutation) OldUserID(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldUserPw(ctx context.Context) (v string, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) QuotaCPU() (r int, exists bool)
- func (m *UserMutation) QuotaInstance() (r int, exists bool)
- func (m *UserMutation) QuotaMemory() (r int, exists bool)
- func (m *UserMutation) QuotaNvidiaGpu() (r int, exists bool)
- func (m *UserMutation) QuotaStorage() (r int, exists bool)
- func (m *UserMutation) RemoveEventIDs(ids ...int)
- func (m *UserMutation) RemoveServerIDs(ids ...int)
- func (m *UserMutation) RemoveTemplateIDs(ids ...int)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedEventsIDs() (ids []int)
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedServersIDs() (ids []int)
- func (m *UserMutation) RemovedTemplatesIDs() (ids []int)
- func (m *UserMutation) ResetCreatedAt()
- func (m *UserMutation) ResetDeletedAt()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetEvents()
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetQuotaCPU()
- func (m *UserMutation) ResetQuotaInstance()
- func (m *UserMutation) ResetQuotaMemory()
- func (m *UserMutation) ResetQuotaNvidiaGpu()
- func (m *UserMutation) ResetQuotaStorage()
- func (m *UserMutation) ResetServers()
- func (m *UserMutation) ResetTemplates()
- func (m *UserMutation) ResetUserID()
- func (m *UserMutation) ResetUserPw()
- func (m *UserMutation) ServersCleared() bool
- func (m *UserMutation) ServersIDs() (ids []int)
- func (m *UserMutation) SetCreatedAt(t time.Time)
- func (m *UserMutation) SetDeletedAt(t time.Time)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetQuotaCPU(i int)
- func (m *UserMutation) SetQuotaInstance(i int)
- func (m *UserMutation) SetQuotaMemory(i int)
- func (m *UserMutation) SetQuotaNvidiaGpu(i int)
- func (m *UserMutation) SetQuotaStorage(i int)
- func (m *UserMutation) SetUserID(s string)
- func (m *UserMutation) SetUserPw(s string)
- func (m *UserMutation) TemplatesCleared() bool
- func (m *UserMutation) TemplatesIDs() (ids []int)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) UserID() (r string, exists bool)
- func (m *UserMutation) UserPw() (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) QueryEvents() *EventQuery
- func (uq *UserQuery) QueryServers() *ServerQuery
- func (uq *UserQuery) QueryTemplates() *TemplateQuery
- func (uq *UserQuery) Select(field string, fields ...string) *UserSelect
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- func (uq *UserQuery) WithEvents(opts ...func(*EventQuery)) *UserQuery
- func (uq *UserQuery) WithServers(opts ...func(*ServerQuery)) *UserQuery
- func (uq *UserQuery) WithTemplates(opts ...func(*TemplateQuery)) *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) AddEventIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddEvents(e ...*Event) *UserUpdate
- func (uu *UserUpdate) AddQuotaCPU(i int) *UserUpdate
- func (uu *UserUpdate) AddQuotaInstance(i int) *UserUpdate
- func (uu *UserUpdate) AddQuotaMemory(i int) *UserUpdate
- func (uu *UserUpdate) AddQuotaNvidiaGpu(i int) *UserUpdate
- func (uu *UserUpdate) AddQuotaStorage(i int) *UserUpdate
- func (uu *UserUpdate) AddServerIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddServers(s ...*Server) *UserUpdate
- func (uu *UserUpdate) AddTemplateIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddTemplates(t ...*Template) *UserUpdate
- func (uu *UserUpdate) ClearDeletedAt() *UserUpdate
- func (uu *UserUpdate) ClearEvents() *UserUpdate
- func (uu *UserUpdate) ClearServers() *UserUpdate
- func (uu *UserUpdate) ClearTemplates() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) RemoveEventIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveEvents(e ...*Event) *UserUpdate
- func (uu *UserUpdate) RemoveServerIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveServers(s ...*Server) *UserUpdate
- func (uu *UserUpdate) RemoveTemplateIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveTemplates(t ...*Template) *UserUpdate
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetCreatedAt(t time.Time) *UserUpdate
- func (uu *UserUpdate) SetDeletedAt(t time.Time) *UserUpdate
- func (uu *UserUpdate) SetNillableCreatedAt(t *time.Time) *UserUpdate
- func (uu *UserUpdate) SetNillableDeletedAt(t *time.Time) *UserUpdate
- func (uu *UserUpdate) SetNillableQuotaCPU(i *int) *UserUpdate
- func (uu *UserUpdate) SetNillableQuotaInstance(i *int) *UserUpdate
- func (uu *UserUpdate) SetNillableQuotaMemory(i *int) *UserUpdate
- func (uu *UserUpdate) SetNillableQuotaNvidiaGpu(i *int) *UserUpdate
- func (uu *UserUpdate) SetNillableQuotaStorage(i *int) *UserUpdate
- func (uu *UserUpdate) SetQuotaCPU(i int) *UserUpdate
- func (uu *UserUpdate) SetQuotaInstance(i int) *UserUpdate
- func (uu *UserUpdate) SetQuotaMemory(i int) *UserUpdate
- func (uu *UserUpdate) SetQuotaNvidiaGpu(i int) *UserUpdate
- func (uu *UserUpdate) SetQuotaStorage(i int) *UserUpdate
- func (uu *UserUpdate) SetUserID(s string) *UserUpdate
- func (uu *UserUpdate) SetUserPw(s string) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddEventIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddEvents(e ...*Event) *UserUpdateOne
- func (uuo *UserUpdateOne) AddQuotaCPU(i int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddQuotaInstance(i int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddQuotaMemory(i int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddQuotaNvidiaGpu(i int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddQuotaStorage(i int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddServerIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddServers(s ...*Server) *UserUpdateOne
- func (uuo *UserUpdateOne) AddTemplateIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddTemplates(t ...*Template) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearDeletedAt() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearEvents() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearServers() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearTemplates() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) RemoveEventIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveEvents(e ...*Event) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveServerIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveServers(s ...*Server) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveTemplateIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveTemplates(t ...*Template) *UserUpdateOne
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) SetCreatedAt(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetDeletedAt(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableCreatedAt(t *time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableDeletedAt(t *time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableQuotaCPU(i *int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableQuotaInstance(i *int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableQuotaMemory(i *int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableQuotaNvidiaGpu(i *int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableQuotaStorage(i *int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetQuotaCPU(i int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetQuotaInstance(i int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetQuotaMemory(i int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetQuotaNvidiaGpu(i int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetQuotaStorage(i int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUserID(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUserPw(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. TypeEvent = "Event" TypeServer = "Server" TypeTemplate = "Template" 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 AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Event is the client for interacting with the Event builders. Event *EventClient // Server is the client for interacting with the Server builders. Server *ServerClient // Template is the client for interacting with the Template builders. Template *TemplateClient // 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 the Client stored in 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(). Event. 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 Event ¶
type Event struct { // ID of the ent. ID int `json:"id,omitempty"` // Message holds the value of the "message" field. Message string `json:"message,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the EventQuery when eager-loading is set. Edges EventEdges `json:"edges"` // contains filtered or unexported fields }
Event is the model entity for the Event schema.
func (*Event) QueryServer ¶
func (e *Event) QueryServer() *ServerQuery
QueryServer queries the server edge of the Event.
func (*Event) Unwrap ¶
Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next queries will be executed through the driver which created the transaction.
func (*Event) Update ¶
func (e *Event) Update() *EventUpdateOne
Update returns a builder for updating this Event. Note that, you need to call Event.Unwrap() before calling this method, if this Event was returned from a transaction, and the transaction was committed or rolled back.
type EventClient ¶
type EventClient struct {
// contains filtered or unexported fields
}
EventClient is a client for the Event schema.
func NewEventClient ¶
func NewEventClient(c config) *EventClient
NewEventClient returns a client for the Event from the given config.
func (*EventClient) Create ¶
func (c *EventClient) Create() *EventCreate
Create returns a create builder for Event.
func (*EventClient) CreateBulk ¶
func (c *EventClient) CreateBulk(builders ...*EventCreate) *EventCreateBulk
CreateBulk returns a builder for creating a bulk of Event entities.
func (*EventClient) Delete ¶
func (c *EventClient) Delete() *EventDelete
Delete returns a delete builder for Event.
func (*EventClient) DeleteOne ¶
func (c *EventClient) DeleteOne(e *Event) *EventDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*EventClient) DeleteOneID ¶
func (c *EventClient) DeleteOneID(id int) *EventDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*EventClient) GetX ¶
func (c *EventClient) GetX(ctx context.Context, id int) *Event
GetX is like Get, but panics if an error occurs.
func (*EventClient) Query ¶
func (c *EventClient) Query() *EventQuery
Query returns a query builder for Event.
func (*EventClient) QueryServer ¶
func (c *EventClient) QueryServer(e *Event) *ServerQuery
QueryServer queries the server edge of a Event.
func (*EventClient) QueryUser ¶
func (c *EventClient) QueryUser(e *Event) *UserQuery
QueryUser queries the user edge of a Event.
func (*EventClient) Update ¶
func (c *EventClient) Update() *EventUpdate
Update returns an update builder for Event.
func (*EventClient) UpdateOne ¶
func (c *EventClient) UpdateOne(e *Event) *EventUpdateOne
UpdateOne returns an update builder for the given entity.
func (*EventClient) UpdateOneID ¶
func (c *EventClient) UpdateOneID(id int) *EventUpdateOne
UpdateOneID returns an update builder for the given id.
func (*EventClient) Use ¶
func (c *EventClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `event.Hooks(f(g(h())))`.
type EventCreate ¶
type EventCreate struct {
// contains filtered or unexported fields
}
EventCreate is the builder for creating a Event entity.
func (*EventCreate) AddServer ¶
func (ec *EventCreate) AddServer(s ...*Server) *EventCreate
AddServer adds the server edges to Server.
func (*EventCreate) AddServerIDs ¶
func (ec *EventCreate) AddServerIDs(ids ...int) *EventCreate
AddServerIDs adds the server edge to Server by ids.
func (*EventCreate) AddUser ¶
func (ec *EventCreate) AddUser(u ...*User) *EventCreate
AddUser adds the user edges to User.
func (*EventCreate) AddUserIDs ¶
func (ec *EventCreate) AddUserIDs(ids ...int) *EventCreate
AddUserIDs adds the user edge to User by ids.
func (*EventCreate) Mutation ¶
func (ec *EventCreate) Mutation() *EventMutation
Mutation returns the EventMutation object of the builder.
func (*EventCreate) Save ¶
func (ec *EventCreate) Save(ctx context.Context) (*Event, error)
Save creates the Event in the database.
func (*EventCreate) SaveX ¶
func (ec *EventCreate) SaveX(ctx context.Context) *Event
SaveX calls Save and panics if Save returns an error.
func (*EventCreate) SetCreatedAt ¶
func (ec *EventCreate) SetCreatedAt(t time.Time) *EventCreate
SetCreatedAt sets the created_at field.
func (*EventCreate) SetMessage ¶
func (ec *EventCreate) SetMessage(s string) *EventCreate
SetMessage sets the message field.
func (*EventCreate) SetNillableCreatedAt ¶
func (ec *EventCreate) SetNillableCreatedAt(t *time.Time) *EventCreate
SetNillableCreatedAt sets the created_at field if the given value is not nil.
type EventCreateBulk ¶
type EventCreateBulk struct {
// contains filtered or unexported fields
}
EventCreateBulk is the builder for creating a bulk of Event entities.
type EventDelete ¶
type EventDelete struct {
// contains filtered or unexported fields
}
EventDelete is the builder for deleting a Event entity.
func (*EventDelete) Exec ¶
func (ed *EventDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*EventDelete) ExecX ¶
func (ed *EventDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*EventDelete) Where ¶
func (ed *EventDelete) Where(ps ...predicate.Event) *EventDelete
Where adds a new predicate to the delete builder.
type EventDeleteOne ¶
type EventDeleteOne struct {
// contains filtered or unexported fields
}
EventDeleteOne is the builder for deleting a single Event entity.
func (*EventDeleteOne) Exec ¶
func (edo *EventDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*EventDeleteOne) ExecX ¶
func (edo *EventDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type EventEdges ¶
type EventEdges struct { // User holds the value of the user edge. User []*User // Server holds the value of the server edge. Server []*Server // contains filtered or unexported fields }
EventEdges holds the relations/edges for other nodes in the graph.
func (EventEdges) ServerOrErr ¶
func (e EventEdges) ServerOrErr() ([]*Server, error)
ServerOrErr returns the Server value or an error if the edge was not loaded in eager-loading.
func (EventEdges) UserOrErr ¶
func (e EventEdges) UserOrErr() ([]*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading.
type EventGroupBy ¶
type EventGroupBy struct {
// contains filtered or unexported fields
}
EventGroupBy is the builder for group-by Event entities.
func (*EventGroupBy) Aggregate ¶
func (egb *EventGroupBy) Aggregate(fns ...AggregateFunc) *EventGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*EventGroupBy) Bool ¶
func (egb *EventGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from group-by. It is only allowed when querying group-by with one field.
func (*EventGroupBy) BoolX ¶
func (egb *EventGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*EventGroupBy) Bools ¶
func (egb *EventGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when querying group-by with one field.
func (*EventGroupBy) BoolsX ¶
func (egb *EventGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*EventGroupBy) Float64 ¶
func (egb *EventGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from group-by. It is only allowed when querying group-by with one field.
func (*EventGroupBy) Float64X ¶
func (egb *EventGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*EventGroupBy) Float64s ¶
func (egb *EventGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when querying group-by with one field.
func (*EventGroupBy) Float64sX ¶
func (egb *EventGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*EventGroupBy) Int ¶
func (egb *EventGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from group-by. It is only allowed when querying group-by with one field.
func (*EventGroupBy) IntX ¶
func (egb *EventGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*EventGroupBy) Ints ¶
func (egb *EventGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when querying group-by with one field.
func (*EventGroupBy) IntsX ¶
func (egb *EventGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*EventGroupBy) Scan ¶
func (egb *EventGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scan the result into the given value.
func (*EventGroupBy) ScanX ¶
func (egb *EventGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*EventGroupBy) String ¶
func (egb *EventGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from group-by. It is only allowed when querying group-by with one field.
func (*EventGroupBy) StringX ¶
func (egb *EventGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type EventMutation ¶
type EventMutation struct {
// contains filtered or unexported fields
}
EventMutation represents an operation that mutate the Events nodes in the graph.
func (*EventMutation) AddField ¶
func (m *EventMutation) AddField(name string, value ent.Value) error
AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.
func (*EventMutation) AddServerIDs ¶
func (m *EventMutation) AddServerIDs(ids ...int)
AddServerIDs adds the server edge to Server by ids.
func (*EventMutation) AddUserIDs ¶
func (m *EventMutation) AddUserIDs(ids ...int)
AddUserIDs adds the user edge to User by ids.
func (*EventMutation) AddedEdges ¶
func (m *EventMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*EventMutation) AddedField ¶
func (m *EventMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.
func (*EventMutation) AddedFields ¶
func (m *EventMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented or decremented during this mutation.
func (*EventMutation) AddedIDs ¶
func (m *EventMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all ids (to other nodes) that were added for the given edge name.
func (*EventMutation) ClearEdge ¶
func (m *EventMutation) ClearEdge(name string) error
ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.
func (*EventMutation) ClearField ¶
func (m *EventMutation) ClearField(name string) error
ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.
func (*EventMutation) ClearServer ¶
func (m *EventMutation) ClearServer()
ClearServer clears the server edge to Server.
func (*EventMutation) ClearUser ¶
func (m *EventMutation) ClearUser()
ClearUser clears the user edge to User.
func (*EventMutation) ClearedEdges ¶
func (m *EventMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*EventMutation) ClearedFields ¶
func (m *EventMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (EventMutation) Client ¶
func (m EventMutation) 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 (*EventMutation) CreatedAt ¶
func (m *EventMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the created_at value in the mutation.
func (*EventMutation) EdgeCleared ¶
func (m *EventMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.
func (*EventMutation) Field ¶
func (m *EventMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean value indicates that this field was not set, or was not define in the schema.
func (*EventMutation) FieldCleared ¶
func (m *EventMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicates if this field was cleared in this mutation.
func (*EventMutation) Fields ¶
func (m *EventMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that, in order to get all numeric fields that were in/decremented, call AddedFields().
func (*EventMutation) ID ¶
func (m *EventMutation) ID() (id int, exists bool)
ID returns the id value in the mutation. Note that, the id is available only if it was provided to the builder.
func (*EventMutation) Message ¶
func (m *EventMutation) Message() (r string, exists bool)
Message returns the message value in the mutation.
func (*EventMutation) OldCreatedAt ¶
OldCreatedAt returns the old created_at value of the Event. If the Event 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 database query fails.
func (*EventMutation) 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 was failed.
func (*EventMutation) OldMessage ¶
func (m *EventMutation) OldMessage(ctx context.Context) (v string, err error)
OldMessage returns the old message value of the Event. If the Event 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 database query fails.
func (*EventMutation) RemoveServerIDs ¶
func (m *EventMutation) RemoveServerIDs(ids ...int)
RemoveServerIDs removes the server edge to Server by ids.
func (*EventMutation) RemoveUserIDs ¶
func (m *EventMutation) RemoveUserIDs(ids ...int)
RemoveUserIDs removes the user edge to User by ids.
func (*EventMutation) RemovedEdges ¶
func (m *EventMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*EventMutation) RemovedIDs ¶
func (m *EventMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.
func (*EventMutation) RemovedServerIDs ¶
func (m *EventMutation) RemovedServerIDs() (ids []int)
RemovedServer returns the removed ids of server.
func (*EventMutation) RemovedUserIDs ¶
func (m *EventMutation) RemovedUserIDs() (ids []int)
RemovedUser returns the removed ids of user.
func (*EventMutation) ResetCreatedAt ¶
func (m *EventMutation) ResetCreatedAt()
ResetCreatedAt reset all changes of the "created_at" field.
func (*EventMutation) ResetEdge ¶
func (m *EventMutation) ResetEdge(name string) error
ResetEdge resets all changes in the mutation regarding the given edge name. It returns an error if the edge is not defined in the schema.
func (*EventMutation) ResetField ¶
func (m *EventMutation) ResetField(name string) error
ResetField resets all changes in the mutation regarding the given field name. It returns an error if the field is not defined in the schema.
func (*EventMutation) ResetMessage ¶
func (m *EventMutation) ResetMessage()
ResetMessage reset all changes of the "message" field.
func (*EventMutation) ResetServer ¶
func (m *EventMutation) ResetServer()
ResetServer reset all changes of the "server" edge.
func (*EventMutation) ResetUser ¶
func (m *EventMutation) ResetUser()
ResetUser reset all changes of the "user" edge.
func (*EventMutation) ServerCleared ¶
func (m *EventMutation) ServerCleared() bool
ServerCleared returns if the edge server was cleared.
func (*EventMutation) ServerIDs ¶
func (m *EventMutation) ServerIDs() (ids []int)
ServerIDs returns the server ids in the mutation.
func (*EventMutation) SetCreatedAt ¶
func (m *EventMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the created_at field.
func (*EventMutation) SetField ¶
func (m *EventMutation) SetField(name string, value ent.Value) error
SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.
func (*EventMutation) SetMessage ¶
func (m *EventMutation) SetMessage(s string)
SetMessage sets the message field.
func (EventMutation) Tx ¶
func (m EventMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*EventMutation) Type ¶
func (m *EventMutation) Type() string
Type returns the node type of this mutation (Event).
func (*EventMutation) UserCleared ¶
func (m *EventMutation) UserCleared() bool
UserCleared returns if the edge user was cleared.
func (*EventMutation) UserIDs ¶
func (m *EventMutation) UserIDs() (ids []int)
UserIDs returns the user ids in the mutation.
type EventQuery ¶
type EventQuery struct {
// contains filtered or unexported fields
}
EventQuery is the builder for querying Event entities.
func (*EventQuery) All ¶
func (eq *EventQuery) All(ctx context.Context) ([]*Event, error)
All executes the query and returns a list of Events.
func (*EventQuery) AllX ¶
func (eq *EventQuery) AllX(ctx context.Context) []*Event
AllX is like All, but panics if an error occurs.
func (*EventQuery) Clone ¶
func (eq *EventQuery) Clone() *EventQuery
Clone returns a duplicate of the query builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*EventQuery) Count ¶
func (eq *EventQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*EventQuery) CountX ¶
func (eq *EventQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*EventQuery) Exist ¶
func (eq *EventQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*EventQuery) ExistX ¶
func (eq *EventQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*EventQuery) First ¶
func (eq *EventQuery) First(ctx context.Context) (*Event, error)
First returns the first Event entity in the query. Returns *NotFoundError when no event was found.
func (*EventQuery) FirstID ¶
func (eq *EventQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Event id in the query. Returns *NotFoundError when no id was found.
func (*EventQuery) FirstIDX ¶
func (eq *EventQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*EventQuery) FirstX ¶
func (eq *EventQuery) FirstX(ctx context.Context) *Event
FirstX is like First, but panics if an error occurs.
func (*EventQuery) GroupBy ¶
func (eq *EventQuery) GroupBy(field string, fields ...string) *EventGroupBy
GroupBy 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 { Message string `json:"message,omitempty"` Count int `json:"count,omitempty"` } client.Event.Query(). GroupBy(event.FieldMessage). Aggregate(ent.Count()). Scan(ctx, &v)
func (*EventQuery) IDs ¶
func (eq *EventQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of Event ids.
func (*EventQuery) IDsX ¶
func (eq *EventQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*EventQuery) Limit ¶
func (eq *EventQuery) Limit(limit int) *EventQuery
Limit adds a limit step to the query.
func (*EventQuery) Offset ¶
func (eq *EventQuery) Offset(offset int) *EventQuery
Offset adds an offset step to the query.
func (*EventQuery) Only ¶
func (eq *EventQuery) Only(ctx context.Context) (*Event, error)
Only returns the only Event entity in the query, returns an error if not exactly one entity was returned.
func (*EventQuery) OnlyID ¶
func (eq *EventQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID returns the only Event id in the query, returns an error if not exactly one id was returned.
func (*EventQuery) OnlyIDX ¶
func (eq *EventQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*EventQuery) OnlyX ¶
func (eq *EventQuery) OnlyX(ctx context.Context) *Event
OnlyX is like Only, but panics if an error occurs.
func (*EventQuery) Order ¶
func (eq *EventQuery) Order(o ...OrderFunc) *EventQuery
Order adds an order step to the query.
func (*EventQuery) QueryServer ¶
func (eq *EventQuery) QueryServer() *ServerQuery
QueryServer chains the current query on the server edge.
func (*EventQuery) QueryUser ¶
func (eq *EventQuery) QueryUser() *UserQuery
QueryUser chains the current query on the user edge.
func (*EventQuery) Select ¶
func (eq *EventQuery) Select(field string, fields ...string) *EventSelect
Select one or more fields from the given query.
Example:
var v []struct { Message string `json:"message,omitempty"` } client.Event.Query(). Select(event.FieldMessage). Scan(ctx, &v)
func (*EventQuery) Where ¶
func (eq *EventQuery) Where(ps ...predicate.Event) *EventQuery
Where adds a new predicate for the builder.
func (*EventQuery) WithServer ¶
func (eq *EventQuery) WithServer(opts ...func(*ServerQuery)) *EventQuery
WithServer tells the query-builder to eager-loads the nodes that are connected to
the "server" edge. The optional arguments used to configure the query builder of the edge.
func (*EventQuery) WithUser ¶
func (eq *EventQuery) WithUser(opts ...func(*UserQuery)) *EventQuery
WithUser tells the query-builder to eager-loads the nodes that are connected to
the "user" edge. The optional arguments used to configure the query builder of the edge.
type EventSelect ¶
type EventSelect struct {
// contains filtered or unexported fields
}
EventSelect is the builder for select fields of Event entities.
func (*EventSelect) Bool ¶
func (es *EventSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from selector. It is only allowed when selecting one field.
func (*EventSelect) BoolX ¶
func (es *EventSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*EventSelect) Bools ¶
func (es *EventSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from selector. It is only allowed when selecting one field.
func (*EventSelect) BoolsX ¶
func (es *EventSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*EventSelect) Float64 ¶
func (es *EventSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from selector. It is only allowed when selecting one field.
func (*EventSelect) Float64X ¶
func (es *EventSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*EventSelect) Float64s ¶
func (es *EventSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from selector. It is only allowed when selecting one field.
func (*EventSelect) Float64sX ¶
func (es *EventSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*EventSelect) Int ¶
func (es *EventSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from selector. It is only allowed when selecting one field.
func (*EventSelect) IntX ¶
func (es *EventSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*EventSelect) Ints ¶
func (es *EventSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from selector. It is only allowed when selecting one field.
func (*EventSelect) IntsX ¶
func (es *EventSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*EventSelect) Scan ¶
func (es *EventSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scan the result into the given value.
func (*EventSelect) ScanX ¶
func (es *EventSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*EventSelect) String ¶
func (es *EventSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from selector. It is only allowed when selecting one field.
func (*EventSelect) StringX ¶
func (es *EventSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type EventUpdate ¶
type EventUpdate struct {
// contains filtered or unexported fields
}
EventUpdate is the builder for updating Event entities.
func (*EventUpdate) AddServer ¶
func (eu *EventUpdate) AddServer(s ...*Server) *EventUpdate
AddServer adds the server edges to Server.
func (*EventUpdate) AddServerIDs ¶
func (eu *EventUpdate) AddServerIDs(ids ...int) *EventUpdate
AddServerIDs adds the server edge to Server by ids.
func (*EventUpdate) AddUser ¶
func (eu *EventUpdate) AddUser(u ...*User) *EventUpdate
AddUser adds the user edges to User.
func (*EventUpdate) AddUserIDs ¶
func (eu *EventUpdate) AddUserIDs(ids ...int) *EventUpdate
AddUserIDs adds the user edge to User by ids.
func (*EventUpdate) ClearServer ¶
func (eu *EventUpdate) ClearServer() *EventUpdate
ClearServer clears all "server" edges to type Server.
func (*EventUpdate) ClearUser ¶
func (eu *EventUpdate) ClearUser() *EventUpdate
ClearUser clears all "user" edges to type User.
func (*EventUpdate) Exec ¶
func (eu *EventUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*EventUpdate) ExecX ¶
func (eu *EventUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EventUpdate) Mutation ¶
func (eu *EventUpdate) Mutation() *EventMutation
Mutation returns the EventMutation object of the builder.
func (*EventUpdate) RemoveServer ¶
func (eu *EventUpdate) RemoveServer(s ...*Server) *EventUpdate
RemoveServer removes server edges to Server.
func (*EventUpdate) RemoveServerIDs ¶
func (eu *EventUpdate) RemoveServerIDs(ids ...int) *EventUpdate
RemoveServerIDs removes the server edge to Server by ids.
func (*EventUpdate) RemoveUser ¶
func (eu *EventUpdate) RemoveUser(u ...*User) *EventUpdate
RemoveUser removes user edges to User.
func (*EventUpdate) RemoveUserIDs ¶
func (eu *EventUpdate) RemoveUserIDs(ids ...int) *EventUpdate
RemoveUserIDs removes the user edge to User by ids.
func (*EventUpdate) Save ¶
func (eu *EventUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*EventUpdate) SaveX ¶
func (eu *EventUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*EventUpdate) SetCreatedAt ¶
func (eu *EventUpdate) SetCreatedAt(t time.Time) *EventUpdate
SetCreatedAt sets the created_at field.
func (*EventUpdate) SetMessage ¶
func (eu *EventUpdate) SetMessage(s string) *EventUpdate
SetMessage sets the message field.
func (*EventUpdate) SetNillableCreatedAt ¶
func (eu *EventUpdate) SetNillableCreatedAt(t *time.Time) *EventUpdate
SetNillableCreatedAt sets the created_at field if the given value is not nil.
func (*EventUpdate) Where ¶
func (eu *EventUpdate) Where(ps ...predicate.Event) *EventUpdate
Where adds a new predicate for the builder.
type EventUpdateOne ¶
type EventUpdateOne struct {
// contains filtered or unexported fields
}
EventUpdateOne is the builder for updating a single Event entity.
func (*EventUpdateOne) AddServer ¶
func (euo *EventUpdateOne) AddServer(s ...*Server) *EventUpdateOne
AddServer adds the server edges to Server.
func (*EventUpdateOne) AddServerIDs ¶
func (euo *EventUpdateOne) AddServerIDs(ids ...int) *EventUpdateOne
AddServerIDs adds the server edge to Server by ids.
func (*EventUpdateOne) AddUser ¶
func (euo *EventUpdateOne) AddUser(u ...*User) *EventUpdateOne
AddUser adds the user edges to User.
func (*EventUpdateOne) AddUserIDs ¶
func (euo *EventUpdateOne) AddUserIDs(ids ...int) *EventUpdateOne
AddUserIDs adds the user edge to User by ids.
func (*EventUpdateOne) ClearServer ¶
func (euo *EventUpdateOne) ClearServer() *EventUpdateOne
ClearServer clears all "server" edges to type Server.
func (*EventUpdateOne) ClearUser ¶
func (euo *EventUpdateOne) ClearUser() *EventUpdateOne
ClearUser clears all "user" edges to type User.
func (*EventUpdateOne) Exec ¶
func (euo *EventUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*EventUpdateOne) ExecX ¶
func (euo *EventUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EventUpdateOne) Mutation ¶
func (euo *EventUpdateOne) Mutation() *EventMutation
Mutation returns the EventMutation object of the builder.
func (*EventUpdateOne) RemoveServer ¶
func (euo *EventUpdateOne) RemoveServer(s ...*Server) *EventUpdateOne
RemoveServer removes server edges to Server.
func (*EventUpdateOne) RemoveServerIDs ¶
func (euo *EventUpdateOne) RemoveServerIDs(ids ...int) *EventUpdateOne
RemoveServerIDs removes the server edge to Server by ids.
func (*EventUpdateOne) RemoveUser ¶
func (euo *EventUpdateOne) RemoveUser(u ...*User) *EventUpdateOne
RemoveUser removes user edges to User.
func (*EventUpdateOne) RemoveUserIDs ¶
func (euo *EventUpdateOne) RemoveUserIDs(ids ...int) *EventUpdateOne
RemoveUserIDs removes the user edge to User by ids.
func (*EventUpdateOne) Save ¶
func (euo *EventUpdateOne) Save(ctx context.Context) (*Event, error)
Save executes the query and returns the updated entity.
func (*EventUpdateOne) SaveX ¶
func (euo *EventUpdateOne) SaveX(ctx context.Context) *Event
SaveX is like Save, but panics if an error occurs.
func (*EventUpdateOne) SetCreatedAt ¶
func (euo *EventUpdateOne) SetCreatedAt(t time.Time) *EventUpdateOne
SetCreatedAt sets the created_at field.
func (*EventUpdateOne) SetMessage ¶
func (euo *EventUpdateOne) SetMessage(s string) *EventUpdateOne
SetMessage sets the message field.
func (*EventUpdateOne) SetNillableCreatedAt ¶
func (euo *EventUpdateOne) SetNillableCreatedAt(t *time.Time) *EventUpdateOne
SetNillableCreatedAt sets the created_at field if the given value is not nil.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflict 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 Server ¶
type Server struct { // ID of the ent. ID int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Template holds the value of the "template" field. Template string `json:"template,omitempty"` // Variables holds the value of the "variables" field. Variables *common.TemplateVariables `json:"variables,omitempty"` // IP holds the value of the "ip" field. IP string `json:"ip,omitempty"` // Description holds the value of the "description" field. Description string `json:"description,omitempty"` // CPU holds the value of the "cpu" field. CPU int `json:"cpu,omitempty"` // Memory holds the value of the "memory" field. Memory int `json:"memory,omitempty"` // NvidiaGpu holds the value of the "nvidia_gpu" field. NvidiaGpu int `json:"nvidia_gpu,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // DeletedAt holds the value of the "deleted_at" field. DeletedAt time.Time `json:"deleted_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ServerQuery when eager-loading is set. Edges ServerEdges `json:"edges"` // contains filtered or unexported fields }
Server is the model entity for the Server schema.
func (*Server) QueryEvent ¶
func (s *Server) QueryEvent() *EventQuery
QueryEvent queries the event edge of the Server.
func (*Server) QueryOwners ¶
QueryOwners queries the owners edge of the Server.
func (*Server) QueryTemplateFrom ¶
func (s *Server) QueryTemplateFrom() *TemplateQuery
QueryTemplateFrom queries the template_from edge of the Server.
func (*Server) Unwrap ¶
Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next queries will be executed through the driver which created the transaction.
func (*Server) Update ¶
func (s *Server) Update() *ServerUpdateOne
Update returns a builder for updating this Server. Note that, you need to call Server.Unwrap() before calling this method, if this Server was returned from a transaction, and the transaction was committed or rolled back.
type ServerClient ¶
type ServerClient struct {
// contains filtered or unexported fields
}
ServerClient is a client for the Server schema.
func NewServerClient ¶
func NewServerClient(c config) *ServerClient
NewServerClient returns a client for the Server from the given config.
func (*ServerClient) Create ¶
func (c *ServerClient) Create() *ServerCreate
Create returns a create builder for Server.
func (*ServerClient) CreateBulk ¶
func (c *ServerClient) CreateBulk(builders ...*ServerCreate) *ServerCreateBulk
CreateBulk returns a builder for creating a bulk of Server entities.
func (*ServerClient) Delete ¶
func (c *ServerClient) Delete() *ServerDelete
Delete returns a delete builder for Server.
func (*ServerClient) DeleteOne ¶
func (c *ServerClient) DeleteOne(s *Server) *ServerDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*ServerClient) DeleteOneID ¶
func (c *ServerClient) DeleteOneID(id int) *ServerDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*ServerClient) GetX ¶
func (c *ServerClient) GetX(ctx context.Context, id int) *Server
GetX is like Get, but panics if an error occurs.
func (*ServerClient) Query ¶
func (c *ServerClient) Query() *ServerQuery
Query returns a query builder for Server.
func (*ServerClient) QueryEvent ¶
func (c *ServerClient) QueryEvent(s *Server) *EventQuery
QueryEvent queries the event edge of a Server.
func (*ServerClient) QueryOwners ¶
func (c *ServerClient) QueryOwners(s *Server) *UserQuery
QueryOwners queries the owners edge of a Server.
func (*ServerClient) QueryTemplateFrom ¶
func (c *ServerClient) QueryTemplateFrom(s *Server) *TemplateQuery
QueryTemplateFrom queries the template_from edge of a Server.
func (*ServerClient) Update ¶
func (c *ServerClient) Update() *ServerUpdate
Update returns an update builder for Server.
func (*ServerClient) UpdateOne ¶
func (c *ServerClient) UpdateOne(s *Server) *ServerUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ServerClient) UpdateOneID ¶
func (c *ServerClient) UpdateOneID(id int) *ServerUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ServerClient) Use ¶
func (c *ServerClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `server.Hooks(f(g(h())))`.
type ServerCreate ¶
type ServerCreate struct {
// contains filtered or unexported fields
}
ServerCreate is the builder for creating a Server entity.
func (*ServerCreate) AddEvent ¶
func (sc *ServerCreate) AddEvent(e ...*Event) *ServerCreate
AddEvent adds the event edges to Event.
func (*ServerCreate) AddEventIDs ¶
func (sc *ServerCreate) AddEventIDs(ids ...int) *ServerCreate
AddEventIDs adds the event edge to Event by ids.
func (*ServerCreate) AddOwnerIDs ¶
func (sc *ServerCreate) AddOwnerIDs(ids ...int) *ServerCreate
AddOwnerIDs adds the owners edge to User by ids.
func (*ServerCreate) AddOwners ¶
func (sc *ServerCreate) AddOwners(u ...*User) *ServerCreate
AddOwners adds the owners edges to User.
func (*ServerCreate) AddTemplateFrom ¶
func (sc *ServerCreate) AddTemplateFrom(t ...*Template) *ServerCreate
AddTemplateFrom adds the template_from edges to Template.
func (*ServerCreate) AddTemplateFromIDs ¶
func (sc *ServerCreate) AddTemplateFromIDs(ids ...int) *ServerCreate
AddTemplateFromIDs adds the template_from edge to Template by ids.
func (*ServerCreate) Mutation ¶
func (sc *ServerCreate) Mutation() *ServerMutation
Mutation returns the ServerMutation object of the builder.
func (*ServerCreate) Save ¶
func (sc *ServerCreate) Save(ctx context.Context) (*Server, error)
Save creates the Server in the database.
func (*ServerCreate) SaveX ¶
func (sc *ServerCreate) SaveX(ctx context.Context) *Server
SaveX calls Save and panics if Save returns an error.
func (*ServerCreate) SetCPU ¶
func (sc *ServerCreate) SetCPU(i int) *ServerCreate
SetCPU sets the cpu field.
func (*ServerCreate) SetCreatedAt ¶
func (sc *ServerCreate) SetCreatedAt(t time.Time) *ServerCreate
SetCreatedAt sets the created_at field.
func (*ServerCreate) SetDeletedAt ¶
func (sc *ServerCreate) SetDeletedAt(t time.Time) *ServerCreate
SetDeletedAt sets the deleted_at field.
func (*ServerCreate) SetDescription ¶
func (sc *ServerCreate) SetDescription(s string) *ServerCreate
SetDescription sets the description field.
func (*ServerCreate) SetIP ¶
func (sc *ServerCreate) SetIP(s string) *ServerCreate
SetIP sets the ip field.
func (*ServerCreate) SetMemory ¶
func (sc *ServerCreate) SetMemory(i int) *ServerCreate
SetMemory sets the memory field.
func (*ServerCreate) SetName ¶
func (sc *ServerCreate) SetName(s string) *ServerCreate
SetName sets the name field.
func (*ServerCreate) SetNillableCreatedAt ¶
func (sc *ServerCreate) SetNillableCreatedAt(t *time.Time) *ServerCreate
SetNillableCreatedAt sets the created_at field if the given value is not nil.
func (*ServerCreate) SetNillableDeletedAt ¶
func (sc *ServerCreate) SetNillableDeletedAt(t *time.Time) *ServerCreate
SetNillableDeletedAt sets the deleted_at field if the given value is not nil.
func (*ServerCreate) SetNvidiaGpu ¶
func (sc *ServerCreate) SetNvidiaGpu(i int) *ServerCreate
SetNvidiaGpu sets the nvidia_gpu field.
func (*ServerCreate) SetTemplate ¶
func (sc *ServerCreate) SetTemplate(s string) *ServerCreate
SetTemplate sets the template field.
func (*ServerCreate) SetVariables ¶
func (sc *ServerCreate) SetVariables(cv *common.TemplateVariables) *ServerCreate
SetVariables sets the variables field.
type ServerCreateBulk ¶
type ServerCreateBulk struct {
// contains filtered or unexported fields
}
ServerCreateBulk is the builder for creating a bulk of Server entities.
type ServerDelete ¶
type ServerDelete struct {
// contains filtered or unexported fields
}
ServerDelete is the builder for deleting a Server entity.
func (*ServerDelete) Exec ¶
func (sd *ServerDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ServerDelete) ExecX ¶
func (sd *ServerDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ServerDelete) Where ¶
func (sd *ServerDelete) Where(ps ...predicate.Server) *ServerDelete
Where adds a new predicate to the delete builder.
type ServerDeleteOne ¶
type ServerDeleteOne struct {
// contains filtered or unexported fields
}
ServerDeleteOne is the builder for deleting a single Server entity.
func (*ServerDeleteOne) Exec ¶
func (sdo *ServerDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ServerDeleteOne) ExecX ¶
func (sdo *ServerDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ServerEdges ¶
type ServerEdges struct { // Owners holds the value of the owners edge. Owners []*User // Event holds the value of the event edge. Event []*Event // TemplateFrom holds the value of the template_from edge. TemplateFrom []*Template // contains filtered or unexported fields }
ServerEdges holds the relations/edges for other nodes in the graph.
func (ServerEdges) EventOrErr ¶
func (e ServerEdges) EventOrErr() ([]*Event, error)
EventOrErr returns the Event value or an error if the edge was not loaded in eager-loading.
func (ServerEdges) OwnersOrErr ¶
func (e ServerEdges) OwnersOrErr() ([]*User, error)
OwnersOrErr returns the Owners value or an error if the edge was not loaded in eager-loading.
func (ServerEdges) TemplateFromOrErr ¶
func (e ServerEdges) TemplateFromOrErr() ([]*Template, error)
TemplateFromOrErr returns the TemplateFrom value or an error if the edge was not loaded in eager-loading.
type ServerGroupBy ¶
type ServerGroupBy struct {
// contains filtered or unexported fields
}
ServerGroupBy is the builder for group-by Server entities.
func (*ServerGroupBy) Aggregate ¶
func (sgb *ServerGroupBy) Aggregate(fns ...AggregateFunc) *ServerGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ServerGroupBy) Bool ¶
func (sgb *ServerGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from group-by. It is only allowed when querying group-by with one field.
func (*ServerGroupBy) BoolX ¶
func (sgb *ServerGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*ServerGroupBy) Bools ¶
func (sgb *ServerGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when querying group-by with one field.
func (*ServerGroupBy) BoolsX ¶
func (sgb *ServerGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*ServerGroupBy) Float64 ¶
func (sgb *ServerGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from group-by. It is only allowed when querying group-by with one field.
func (*ServerGroupBy) Float64X ¶
func (sgb *ServerGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*ServerGroupBy) Float64s ¶
func (sgb *ServerGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when querying group-by with one field.
func (*ServerGroupBy) Float64sX ¶
func (sgb *ServerGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*ServerGroupBy) Int ¶
func (sgb *ServerGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from group-by. It is only allowed when querying group-by with one field.
func (*ServerGroupBy) IntX ¶
func (sgb *ServerGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*ServerGroupBy) Ints ¶
func (sgb *ServerGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when querying group-by with one field.
func (*ServerGroupBy) IntsX ¶
func (sgb *ServerGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*ServerGroupBy) Scan ¶
func (sgb *ServerGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scan the result into the given value.
func (*ServerGroupBy) ScanX ¶
func (sgb *ServerGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*ServerGroupBy) String ¶
func (sgb *ServerGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from group-by. It is only allowed when querying group-by with one field.
func (*ServerGroupBy) StringX ¶
func (sgb *ServerGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type ServerMutation ¶
type ServerMutation struct {
// contains filtered or unexported fields
}
ServerMutation represents an operation that mutate the Servers nodes in the graph.
func (*ServerMutation) AddEventIDs ¶
func (m *ServerMutation) AddEventIDs(ids ...int)
AddEventIDs adds the event edge to Event by ids.
func (*ServerMutation) AddField ¶
func (m *ServerMutation) AddField(name string, value ent.Value) error
AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.
func (*ServerMutation) AddMemory ¶
func (m *ServerMutation) AddMemory(i int)
AddMemory adds i to memory.
func (*ServerMutation) AddNvidiaGpu ¶
func (m *ServerMutation) AddNvidiaGpu(i int)
AddNvidiaGpu adds i to nvidia_gpu.
func (*ServerMutation) AddOwnerIDs ¶
func (m *ServerMutation) AddOwnerIDs(ids ...int)
AddOwnerIDs adds the owners edge to User by ids.
func (*ServerMutation) AddTemplateFromIDs ¶
func (m *ServerMutation) AddTemplateFromIDs(ids ...int)
AddTemplateFromIDs adds the template_from edge to Template by ids.
func (*ServerMutation) AddedCPU ¶
func (m *ServerMutation) AddedCPU() (r int, exists bool)
AddedCPU returns the value that was added to the cpu field in this mutation.
func (*ServerMutation) AddedEdges ¶
func (m *ServerMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ServerMutation) AddedField ¶
func (m *ServerMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.
func (*ServerMutation) AddedFields ¶
func (m *ServerMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented or decremented during this mutation.
func (*ServerMutation) AddedIDs ¶
func (m *ServerMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all ids (to other nodes) that were added for the given edge name.
func (*ServerMutation) AddedMemory ¶
func (m *ServerMutation) AddedMemory() (r int, exists bool)
AddedMemory returns the value that was added to the memory field in this mutation.
func (*ServerMutation) AddedNvidiaGpu ¶
func (m *ServerMutation) AddedNvidiaGpu() (r int, exists bool)
AddedNvidiaGpu returns the value that was added to the nvidia_gpu field in this mutation.
func (*ServerMutation) CPU ¶
func (m *ServerMutation) CPU() (r int, exists bool)
CPU returns the cpu value in the mutation.
func (*ServerMutation) ClearDeletedAt ¶
func (m *ServerMutation) ClearDeletedAt()
ClearDeletedAt clears the value of deleted_at.
func (*ServerMutation) ClearEdge ¶
func (m *ServerMutation) ClearEdge(name string) error
ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.
func (*ServerMutation) ClearEvent ¶
func (m *ServerMutation) ClearEvent()
ClearEvent clears the event edge to Event.
func (*ServerMutation) ClearField ¶
func (m *ServerMutation) ClearField(name string) error
ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.
func (*ServerMutation) ClearOwners ¶
func (m *ServerMutation) ClearOwners()
ClearOwners clears the owners edge to User.
func (*ServerMutation) ClearTemplateFrom ¶
func (m *ServerMutation) ClearTemplateFrom()
ClearTemplateFrom clears the template_from edge to Template.
func (*ServerMutation) ClearedEdges ¶
func (m *ServerMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ServerMutation) ClearedFields ¶
func (m *ServerMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ServerMutation) Client ¶
func (m ServerMutation) 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 (*ServerMutation) CreatedAt ¶
func (m *ServerMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the created_at value in the mutation.
func (*ServerMutation) DeletedAt ¶
func (m *ServerMutation) DeletedAt() (r time.Time, exists bool)
DeletedAt returns the deleted_at value in the mutation.
func (*ServerMutation) DeletedAtCleared ¶
func (m *ServerMutation) DeletedAtCleared() bool
DeletedAtCleared returns if the field deleted_at was cleared in this mutation.
func (*ServerMutation) Description ¶
func (m *ServerMutation) Description() (r string, exists bool)
Description returns the description value in the mutation.
func (*ServerMutation) EdgeCleared ¶
func (m *ServerMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.
func (*ServerMutation) EventCleared ¶
func (m *ServerMutation) EventCleared() bool
EventCleared returns if the edge event was cleared.
func (*ServerMutation) EventIDs ¶
func (m *ServerMutation) EventIDs() (ids []int)
EventIDs returns the event ids in the mutation.
func (*ServerMutation) Field ¶
func (m *ServerMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean value indicates that this field was not set, or was not define in the schema.
func (*ServerMutation) FieldCleared ¶
func (m *ServerMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicates if this field was cleared in this mutation.
func (*ServerMutation) Fields ¶
func (m *ServerMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that, in order to get all numeric fields that were in/decremented, call AddedFields().
func (*ServerMutation) ID ¶
func (m *ServerMutation) ID() (id int, exists bool)
ID returns the id value in the mutation. Note that, the id is available only if it was provided to the builder.
func (*ServerMutation) IP ¶
func (m *ServerMutation) IP() (r string, exists bool)
IP returns the ip value in the mutation.
func (*ServerMutation) Memory ¶
func (m *ServerMutation) Memory() (r int, exists bool)
Memory returns the memory value in the mutation.
func (*ServerMutation) Name ¶
func (m *ServerMutation) Name() (r string, exists bool)
Name returns the name value in the mutation.
func (*ServerMutation) NvidiaGpu ¶
func (m *ServerMutation) NvidiaGpu() (r int, exists bool)
NvidiaGpu returns the nvidia_gpu value in the mutation.
func (*ServerMutation) OldCPU ¶
func (m *ServerMutation) OldCPU(ctx context.Context) (v int, err error)
OldCPU returns the old cpu value of the Server. If the Server 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 database query fails.
func (*ServerMutation) OldCreatedAt ¶
OldCreatedAt returns the old created_at value of the Server. If the Server 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 database query fails.
func (*ServerMutation) OldDeletedAt ¶
OldDeletedAt returns the old deleted_at value of the Server. If the Server 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 database query fails.
func (*ServerMutation) OldDescription ¶
func (m *ServerMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old description value of the Server. If the Server 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 database query fails.
func (*ServerMutation) 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 was failed.
func (*ServerMutation) OldIP ¶
func (m *ServerMutation) OldIP(ctx context.Context) (v string, err error)
OldIP returns the old ip value of the Server. If the Server 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 database query fails.
func (*ServerMutation) OldMemory ¶
func (m *ServerMutation) OldMemory(ctx context.Context) (v int, err error)
OldMemory returns the old memory value of the Server. If the Server 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 database query fails.
func (*ServerMutation) OldName ¶
func (m *ServerMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old name value of the Server. If the Server 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 database query fails.
func (*ServerMutation) OldNvidiaGpu ¶
func (m *ServerMutation) OldNvidiaGpu(ctx context.Context) (v int, err error)
OldNvidiaGpu returns the old nvidia_gpu value of the Server. If the Server 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 database query fails.
func (*ServerMutation) OldTemplate ¶
func (m *ServerMutation) OldTemplate(ctx context.Context) (v string, err error)
OldTemplate returns the old template value of the Server. If the Server 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 database query fails.
func (*ServerMutation) OldVariables ¶
func (m *ServerMutation) OldVariables(ctx context.Context) (v *common.TemplateVariables, err error)
OldVariables returns the old variables value of the Server. If the Server 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 database query fails.
func (*ServerMutation) OwnersCleared ¶
func (m *ServerMutation) OwnersCleared() bool
OwnersCleared returns if the edge owners was cleared.
func (*ServerMutation) OwnersIDs ¶
func (m *ServerMutation) OwnersIDs() (ids []int)
OwnersIDs returns the owners ids in the mutation.
func (*ServerMutation) RemoveEventIDs ¶
func (m *ServerMutation) RemoveEventIDs(ids ...int)
RemoveEventIDs removes the event edge to Event by ids.
func (*ServerMutation) RemoveOwnerIDs ¶
func (m *ServerMutation) RemoveOwnerIDs(ids ...int)
RemoveOwnerIDs removes the owners edge to User by ids.
func (*ServerMutation) RemoveTemplateFromIDs ¶
func (m *ServerMutation) RemoveTemplateFromIDs(ids ...int)
RemoveTemplateFromIDs removes the template_from edge to Template by ids.
func (*ServerMutation) RemovedEdges ¶
func (m *ServerMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ServerMutation) RemovedEventIDs ¶
func (m *ServerMutation) RemovedEventIDs() (ids []int)
RemovedEvent returns the removed ids of event.
func (*ServerMutation) RemovedIDs ¶
func (m *ServerMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.
func (*ServerMutation) RemovedOwnersIDs ¶
func (m *ServerMutation) RemovedOwnersIDs() (ids []int)
RemovedOwners returns the removed ids of owners.
func (*ServerMutation) RemovedTemplateFromIDs ¶
func (m *ServerMutation) RemovedTemplateFromIDs() (ids []int)
RemovedTemplateFrom returns the removed ids of template_from.
func (*ServerMutation) ResetCPU ¶
func (m *ServerMutation) ResetCPU()
ResetCPU reset all changes of the "cpu" field.
func (*ServerMutation) ResetCreatedAt ¶
func (m *ServerMutation) ResetCreatedAt()
ResetCreatedAt reset all changes of the "created_at" field.
func (*ServerMutation) ResetDeletedAt ¶
func (m *ServerMutation) ResetDeletedAt()
ResetDeletedAt reset all changes of the "deleted_at" field.
func (*ServerMutation) ResetDescription ¶
func (m *ServerMutation) ResetDescription()
ResetDescription reset all changes of the "description" field.
func (*ServerMutation) ResetEdge ¶
func (m *ServerMutation) ResetEdge(name string) error
ResetEdge resets all changes in the mutation regarding the given edge name. It returns an error if the edge is not defined in the schema.
func (*ServerMutation) ResetEvent ¶
func (m *ServerMutation) ResetEvent()
ResetEvent reset all changes of the "event" edge.
func (*ServerMutation) ResetField ¶
func (m *ServerMutation) ResetField(name string) error
ResetField resets all changes in the mutation regarding the given field name. It returns an error if the field is not defined in the schema.
func (*ServerMutation) ResetIP ¶
func (m *ServerMutation) ResetIP()
ResetIP reset all changes of the "ip" field.
func (*ServerMutation) ResetMemory ¶
func (m *ServerMutation) ResetMemory()
ResetMemory reset all changes of the "memory" field.
func (*ServerMutation) ResetName ¶
func (m *ServerMutation) ResetName()
ResetName reset all changes of the "name" field.
func (*ServerMutation) ResetNvidiaGpu ¶
func (m *ServerMutation) ResetNvidiaGpu()
ResetNvidiaGpu reset all changes of the "nvidia_gpu" field.
func (*ServerMutation) ResetOwners ¶
func (m *ServerMutation) ResetOwners()
ResetOwners reset all changes of the "owners" edge.
func (*ServerMutation) ResetTemplate ¶
func (m *ServerMutation) ResetTemplate()
ResetTemplate reset all changes of the "template" field.
func (*ServerMutation) ResetTemplateFrom ¶
func (m *ServerMutation) ResetTemplateFrom()
ResetTemplateFrom reset all changes of the "template_from" edge.
func (*ServerMutation) ResetVariables ¶
func (m *ServerMutation) ResetVariables()
ResetVariables reset all changes of the "variables" field.
func (*ServerMutation) SetCreatedAt ¶
func (m *ServerMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the created_at field.
func (*ServerMutation) SetDeletedAt ¶
func (m *ServerMutation) SetDeletedAt(t time.Time)
SetDeletedAt sets the deleted_at field.
func (*ServerMutation) SetDescription ¶
func (m *ServerMutation) SetDescription(s string)
SetDescription sets the description field.
func (*ServerMutation) SetField ¶
func (m *ServerMutation) SetField(name string, value ent.Value) error
SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.
func (*ServerMutation) SetMemory ¶
func (m *ServerMutation) SetMemory(i int)
SetMemory sets the memory field.
func (*ServerMutation) SetName ¶
func (m *ServerMutation) SetName(s string)
SetName sets the name field.
func (*ServerMutation) SetNvidiaGpu ¶
func (m *ServerMutation) SetNvidiaGpu(i int)
SetNvidiaGpu sets the nvidia_gpu field.
func (*ServerMutation) SetTemplate ¶
func (m *ServerMutation) SetTemplate(s string)
SetTemplate sets the template field.
func (*ServerMutation) SetVariables ¶
func (m *ServerMutation) SetVariables(cv *common.TemplateVariables)
SetVariables sets the variables field.
func (*ServerMutation) Template ¶
func (m *ServerMutation) Template() (r string, exists bool)
Template returns the template value in the mutation.
func (*ServerMutation) TemplateFromCleared ¶
func (m *ServerMutation) TemplateFromCleared() bool
TemplateFromCleared returns if the edge template_from was cleared.
func (*ServerMutation) TemplateFromIDs ¶
func (m *ServerMutation) TemplateFromIDs() (ids []int)
TemplateFromIDs returns the template_from ids in the mutation.
func (ServerMutation) Tx ¶
func (m ServerMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ServerMutation) Type ¶
func (m *ServerMutation) Type() string
Type returns the node type of this mutation (Server).
func (*ServerMutation) Variables ¶
func (m *ServerMutation) Variables() (r *common.TemplateVariables, exists bool)
Variables returns the variables value in the mutation.
type ServerQuery ¶
type ServerQuery struct {
// contains filtered or unexported fields
}
ServerQuery is the builder for querying Server entities.
func (*ServerQuery) All ¶
func (sq *ServerQuery) All(ctx context.Context) ([]*Server, error)
All executes the query and returns a list of Servers.
func (*ServerQuery) AllX ¶
func (sq *ServerQuery) AllX(ctx context.Context) []*Server
AllX is like All, but panics if an error occurs.
func (*ServerQuery) Clone ¶
func (sq *ServerQuery) Clone() *ServerQuery
Clone returns a duplicate of the query builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ServerQuery) Count ¶
func (sq *ServerQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ServerQuery) CountX ¶
func (sq *ServerQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ServerQuery) Exist ¶
func (sq *ServerQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ServerQuery) ExistX ¶
func (sq *ServerQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ServerQuery) First ¶
func (sq *ServerQuery) First(ctx context.Context) (*Server, error)
First returns the first Server entity in the query. Returns *NotFoundError when no server was found.
func (*ServerQuery) FirstID ¶
func (sq *ServerQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Server id in the query. Returns *NotFoundError when no id was found.
func (*ServerQuery) FirstIDX ¶
func (sq *ServerQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ServerQuery) FirstX ¶
func (sq *ServerQuery) FirstX(ctx context.Context) *Server
FirstX is like First, but panics if an error occurs.
func (*ServerQuery) GroupBy ¶
func (sq *ServerQuery) GroupBy(field string, fields ...string) *ServerGroupBy
GroupBy 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.Server.Query(). GroupBy(server.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ServerQuery) IDs ¶
func (sq *ServerQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of Server ids.
func (*ServerQuery) IDsX ¶
func (sq *ServerQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ServerQuery) Limit ¶
func (sq *ServerQuery) Limit(limit int) *ServerQuery
Limit adds a limit step to the query.
func (*ServerQuery) Offset ¶
func (sq *ServerQuery) Offset(offset int) *ServerQuery
Offset adds an offset step to the query.
func (*ServerQuery) Only ¶
func (sq *ServerQuery) Only(ctx context.Context) (*Server, error)
Only returns the only Server entity in the query, returns an error if not exactly one entity was returned.
func (*ServerQuery) OnlyID ¶
func (sq *ServerQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID returns the only Server id in the query, returns an error if not exactly one id was returned.
func (*ServerQuery) OnlyIDX ¶
func (sq *ServerQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ServerQuery) OnlyX ¶
func (sq *ServerQuery) OnlyX(ctx context.Context) *Server
OnlyX is like Only, but panics if an error occurs.
func (*ServerQuery) Order ¶
func (sq *ServerQuery) Order(o ...OrderFunc) *ServerQuery
Order adds an order step to the query.
func (*ServerQuery) QueryEvent ¶
func (sq *ServerQuery) QueryEvent() *EventQuery
QueryEvent chains the current query on the event edge.
func (*ServerQuery) QueryOwners ¶
func (sq *ServerQuery) QueryOwners() *UserQuery
QueryOwners chains the current query on the owners edge.
func (*ServerQuery) QueryTemplateFrom ¶
func (sq *ServerQuery) QueryTemplateFrom() *TemplateQuery
QueryTemplateFrom chains the current query on the template_from edge.
func (*ServerQuery) Select ¶
func (sq *ServerQuery) Select(field string, fields ...string) *ServerSelect
Select one or more fields from the given query.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.Server.Query(). Select(server.FieldName). Scan(ctx, &v)
func (*ServerQuery) Where ¶
func (sq *ServerQuery) Where(ps ...predicate.Server) *ServerQuery
Where adds a new predicate for the builder.
func (*ServerQuery) WithEvent ¶
func (sq *ServerQuery) WithEvent(opts ...func(*EventQuery)) *ServerQuery
WithEvent tells the query-builder to eager-loads the nodes that are connected to
the "event" edge. The optional arguments used to configure the query builder of the edge.
func (*ServerQuery) WithOwners ¶
func (sq *ServerQuery) WithOwners(opts ...func(*UserQuery)) *ServerQuery
WithOwners tells the query-builder to eager-loads the nodes that are connected to
the "owners" edge. The optional arguments used to configure the query builder of the edge.
func (*ServerQuery) WithTemplateFrom ¶
func (sq *ServerQuery) WithTemplateFrom(opts ...func(*TemplateQuery)) *ServerQuery
WithTemplateFrom tells the query-builder to eager-loads the nodes that are connected to
the "template_from" edge. The optional arguments used to configure the query builder of the edge.
type ServerSelect ¶
type ServerSelect struct {
// contains filtered or unexported fields
}
ServerSelect is the builder for select fields of Server entities.
func (*ServerSelect) Bool ¶
func (ss *ServerSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from selector. It is only allowed when selecting one field.
func (*ServerSelect) BoolX ¶
func (ss *ServerSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*ServerSelect) Bools ¶
func (ss *ServerSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from selector. It is only allowed when selecting one field.
func (*ServerSelect) BoolsX ¶
func (ss *ServerSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*ServerSelect) Float64 ¶
func (ss *ServerSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from selector. It is only allowed when selecting one field.
func (*ServerSelect) Float64X ¶
func (ss *ServerSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*ServerSelect) Float64s ¶
func (ss *ServerSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from selector. It is only allowed when selecting one field.
func (*ServerSelect) Float64sX ¶
func (ss *ServerSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*ServerSelect) Int ¶
func (ss *ServerSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from selector. It is only allowed when selecting one field.
func (*ServerSelect) IntX ¶
func (ss *ServerSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*ServerSelect) Ints ¶
func (ss *ServerSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from selector. It is only allowed when selecting one field.
func (*ServerSelect) IntsX ¶
func (ss *ServerSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*ServerSelect) Scan ¶
func (ss *ServerSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scan the result into the given value.
func (*ServerSelect) ScanX ¶
func (ss *ServerSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*ServerSelect) String ¶
func (ss *ServerSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from selector. It is only allowed when selecting one field.
func (*ServerSelect) StringX ¶
func (ss *ServerSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type ServerUpdate ¶
type ServerUpdate struct {
// contains filtered or unexported fields
}
ServerUpdate is the builder for updating Server entities.
func (*ServerUpdate) AddCPU ¶
func (su *ServerUpdate) AddCPU(i int) *ServerUpdate
AddCPU adds i to cpu.
func (*ServerUpdate) AddEvent ¶
func (su *ServerUpdate) AddEvent(e ...*Event) *ServerUpdate
AddEvent adds the event edges to Event.
func (*ServerUpdate) AddEventIDs ¶
func (su *ServerUpdate) AddEventIDs(ids ...int) *ServerUpdate
AddEventIDs adds the event edge to Event by ids.
func (*ServerUpdate) AddMemory ¶
func (su *ServerUpdate) AddMemory(i int) *ServerUpdate
AddMemory adds i to memory.
func (*ServerUpdate) AddNvidiaGpu ¶
func (su *ServerUpdate) AddNvidiaGpu(i int) *ServerUpdate
AddNvidiaGpu adds i to nvidia_gpu.
func (*ServerUpdate) AddOwnerIDs ¶
func (su *ServerUpdate) AddOwnerIDs(ids ...int) *ServerUpdate
AddOwnerIDs adds the owners edge to User by ids.
func (*ServerUpdate) AddOwners ¶
func (su *ServerUpdate) AddOwners(u ...*User) *ServerUpdate
AddOwners adds the owners edges to User.
func (*ServerUpdate) AddTemplateFrom ¶
func (su *ServerUpdate) AddTemplateFrom(t ...*Template) *ServerUpdate
AddTemplateFrom adds the template_from edges to Template.
func (*ServerUpdate) AddTemplateFromIDs ¶
func (su *ServerUpdate) AddTemplateFromIDs(ids ...int) *ServerUpdate
AddTemplateFromIDs adds the template_from edge to Template by ids.
func (*ServerUpdate) ClearDeletedAt ¶
func (su *ServerUpdate) ClearDeletedAt() *ServerUpdate
ClearDeletedAt clears the value of deleted_at.
func (*ServerUpdate) ClearEvent ¶
func (su *ServerUpdate) ClearEvent() *ServerUpdate
ClearEvent clears all "event" edges to type Event.
func (*ServerUpdate) ClearOwners ¶
func (su *ServerUpdate) ClearOwners() *ServerUpdate
ClearOwners clears all "owners" edges to type User.
func (*ServerUpdate) ClearTemplateFrom ¶
func (su *ServerUpdate) ClearTemplateFrom() *ServerUpdate
ClearTemplateFrom clears all "template_from" edges to type Template.
func (*ServerUpdate) Exec ¶
func (su *ServerUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ServerUpdate) ExecX ¶
func (su *ServerUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ServerUpdate) Mutation ¶
func (su *ServerUpdate) Mutation() *ServerMutation
Mutation returns the ServerMutation object of the builder.
func (*ServerUpdate) RemoveEvent ¶
func (su *ServerUpdate) RemoveEvent(e ...*Event) *ServerUpdate
RemoveEvent removes event edges to Event.
func (*ServerUpdate) RemoveEventIDs ¶
func (su *ServerUpdate) RemoveEventIDs(ids ...int) *ServerUpdate
RemoveEventIDs removes the event edge to Event by ids.
func (*ServerUpdate) RemoveOwnerIDs ¶
func (su *ServerUpdate) RemoveOwnerIDs(ids ...int) *ServerUpdate
RemoveOwnerIDs removes the owners edge to User by ids.
func (*ServerUpdate) RemoveOwners ¶
func (su *ServerUpdate) RemoveOwners(u ...*User) *ServerUpdate
RemoveOwners removes owners edges to User.
func (*ServerUpdate) RemoveTemplateFrom ¶
func (su *ServerUpdate) RemoveTemplateFrom(t ...*Template) *ServerUpdate
RemoveTemplateFrom removes template_from edges to Template.
func (*ServerUpdate) RemoveTemplateFromIDs ¶
func (su *ServerUpdate) RemoveTemplateFromIDs(ids ...int) *ServerUpdate
RemoveTemplateFromIDs removes the template_from edge to Template by ids.
func (*ServerUpdate) Save ¶
func (su *ServerUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ServerUpdate) SaveX ¶
func (su *ServerUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ServerUpdate) SetCPU ¶
func (su *ServerUpdate) SetCPU(i int) *ServerUpdate
SetCPU sets the cpu field.
func (*ServerUpdate) SetCreatedAt ¶
func (su *ServerUpdate) SetCreatedAt(t time.Time) *ServerUpdate
SetCreatedAt sets the created_at field.
func (*ServerUpdate) SetDeletedAt ¶
func (su *ServerUpdate) SetDeletedAt(t time.Time) *ServerUpdate
SetDeletedAt sets the deleted_at field.
func (*ServerUpdate) SetDescription ¶
func (su *ServerUpdate) SetDescription(s string) *ServerUpdate
SetDescription sets the description field.
func (*ServerUpdate) SetIP ¶
func (su *ServerUpdate) SetIP(s string) *ServerUpdate
SetIP sets the ip field.
func (*ServerUpdate) SetMemory ¶
func (su *ServerUpdate) SetMemory(i int) *ServerUpdate
SetMemory sets the memory field.
func (*ServerUpdate) SetName ¶
func (su *ServerUpdate) SetName(s string) *ServerUpdate
SetName sets the name field.
func (*ServerUpdate) SetNillableCreatedAt ¶
func (su *ServerUpdate) SetNillableCreatedAt(t *time.Time) *ServerUpdate
SetNillableCreatedAt sets the created_at field if the given value is not nil.
func (*ServerUpdate) SetNillableDeletedAt ¶
func (su *ServerUpdate) SetNillableDeletedAt(t *time.Time) *ServerUpdate
SetNillableDeletedAt sets the deleted_at field if the given value is not nil.
func (*ServerUpdate) SetNvidiaGpu ¶
func (su *ServerUpdate) SetNvidiaGpu(i int) *ServerUpdate
SetNvidiaGpu sets the nvidia_gpu field.
func (*ServerUpdate) SetTemplate ¶
func (su *ServerUpdate) SetTemplate(s string) *ServerUpdate
SetTemplate sets the template field.
func (*ServerUpdate) SetVariables ¶
func (su *ServerUpdate) SetVariables(cv *common.TemplateVariables) *ServerUpdate
SetVariables sets the variables field.
func (*ServerUpdate) Where ¶
func (su *ServerUpdate) Where(ps ...predicate.Server) *ServerUpdate
Where adds a new predicate for the builder.
type ServerUpdateOne ¶
type ServerUpdateOne struct {
// contains filtered or unexported fields
}
ServerUpdateOne is the builder for updating a single Server entity.
func (*ServerUpdateOne) AddCPU ¶
func (suo *ServerUpdateOne) AddCPU(i int) *ServerUpdateOne
AddCPU adds i to cpu.
func (*ServerUpdateOne) AddEvent ¶
func (suo *ServerUpdateOne) AddEvent(e ...*Event) *ServerUpdateOne
AddEvent adds the event edges to Event.
func (*ServerUpdateOne) AddEventIDs ¶
func (suo *ServerUpdateOne) AddEventIDs(ids ...int) *ServerUpdateOne
AddEventIDs adds the event edge to Event by ids.
func (*ServerUpdateOne) AddMemory ¶
func (suo *ServerUpdateOne) AddMemory(i int) *ServerUpdateOne
AddMemory adds i to memory.
func (*ServerUpdateOne) AddNvidiaGpu ¶
func (suo *ServerUpdateOne) AddNvidiaGpu(i int) *ServerUpdateOne
AddNvidiaGpu adds i to nvidia_gpu.
func (*ServerUpdateOne) AddOwnerIDs ¶
func (suo *ServerUpdateOne) AddOwnerIDs(ids ...int) *ServerUpdateOne
AddOwnerIDs adds the owners edge to User by ids.
func (*ServerUpdateOne) AddOwners ¶
func (suo *ServerUpdateOne) AddOwners(u ...*User) *ServerUpdateOne
AddOwners adds the owners edges to User.
func (*ServerUpdateOne) AddTemplateFrom ¶
func (suo *ServerUpdateOne) AddTemplateFrom(t ...*Template) *ServerUpdateOne
AddTemplateFrom adds the template_from edges to Template.
func (*ServerUpdateOne) AddTemplateFromIDs ¶
func (suo *ServerUpdateOne) AddTemplateFromIDs(ids ...int) *ServerUpdateOne
AddTemplateFromIDs adds the template_from edge to Template by ids.
func (*ServerUpdateOne) ClearDeletedAt ¶
func (suo *ServerUpdateOne) ClearDeletedAt() *ServerUpdateOne
ClearDeletedAt clears the value of deleted_at.
func (*ServerUpdateOne) ClearEvent ¶
func (suo *ServerUpdateOne) ClearEvent() *ServerUpdateOne
ClearEvent clears all "event" edges to type Event.
func (*ServerUpdateOne) ClearOwners ¶
func (suo *ServerUpdateOne) ClearOwners() *ServerUpdateOne
ClearOwners clears all "owners" edges to type User.
func (*ServerUpdateOne) ClearTemplateFrom ¶
func (suo *ServerUpdateOne) ClearTemplateFrom() *ServerUpdateOne
ClearTemplateFrom clears all "template_from" edges to type Template.
func (*ServerUpdateOne) Exec ¶
func (suo *ServerUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ServerUpdateOne) ExecX ¶
func (suo *ServerUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ServerUpdateOne) Mutation ¶
func (suo *ServerUpdateOne) Mutation() *ServerMutation
Mutation returns the ServerMutation object of the builder.
func (*ServerUpdateOne) RemoveEvent ¶
func (suo *ServerUpdateOne) RemoveEvent(e ...*Event) *ServerUpdateOne
RemoveEvent removes event edges to Event.
func (*ServerUpdateOne) RemoveEventIDs ¶
func (suo *ServerUpdateOne) RemoveEventIDs(ids ...int) *ServerUpdateOne
RemoveEventIDs removes the event edge to Event by ids.
func (*ServerUpdateOne) RemoveOwnerIDs ¶
func (suo *ServerUpdateOne) RemoveOwnerIDs(ids ...int) *ServerUpdateOne
RemoveOwnerIDs removes the owners edge to User by ids.
func (*ServerUpdateOne) RemoveOwners ¶
func (suo *ServerUpdateOne) RemoveOwners(u ...*User) *ServerUpdateOne
RemoveOwners removes owners edges to User.
func (*ServerUpdateOne) RemoveTemplateFrom ¶
func (suo *ServerUpdateOne) RemoveTemplateFrom(t ...*Template) *ServerUpdateOne
RemoveTemplateFrom removes template_from edges to Template.
func (*ServerUpdateOne) RemoveTemplateFromIDs ¶
func (suo *ServerUpdateOne) RemoveTemplateFromIDs(ids ...int) *ServerUpdateOne
RemoveTemplateFromIDs removes the template_from edge to Template by ids.
func (*ServerUpdateOne) Save ¶
func (suo *ServerUpdateOne) Save(ctx context.Context) (*Server, error)
Save executes the query and returns the updated entity.
func (*ServerUpdateOne) SaveX ¶
func (suo *ServerUpdateOne) SaveX(ctx context.Context) *Server
SaveX is like Save, but panics if an error occurs.
func (*ServerUpdateOne) SetCPU ¶
func (suo *ServerUpdateOne) SetCPU(i int) *ServerUpdateOne
SetCPU sets the cpu field.
func (*ServerUpdateOne) SetCreatedAt ¶
func (suo *ServerUpdateOne) SetCreatedAt(t time.Time) *ServerUpdateOne
SetCreatedAt sets the created_at field.
func (*ServerUpdateOne) SetDeletedAt ¶
func (suo *ServerUpdateOne) SetDeletedAt(t time.Time) *ServerUpdateOne
SetDeletedAt sets the deleted_at field.
func (*ServerUpdateOne) SetDescription ¶
func (suo *ServerUpdateOne) SetDescription(s string) *ServerUpdateOne
SetDescription sets the description field.
func (*ServerUpdateOne) SetIP ¶
func (suo *ServerUpdateOne) SetIP(s string) *ServerUpdateOne
SetIP sets the ip field.
func (*ServerUpdateOne) SetMemory ¶
func (suo *ServerUpdateOne) SetMemory(i int) *ServerUpdateOne
SetMemory sets the memory field.
func (*ServerUpdateOne) SetName ¶
func (suo *ServerUpdateOne) SetName(s string) *ServerUpdateOne
SetName sets the name field.
func (*ServerUpdateOne) SetNillableCreatedAt ¶
func (suo *ServerUpdateOne) SetNillableCreatedAt(t *time.Time) *ServerUpdateOne
SetNillableCreatedAt sets the created_at field if the given value is not nil.
func (*ServerUpdateOne) SetNillableDeletedAt ¶
func (suo *ServerUpdateOne) SetNillableDeletedAt(t *time.Time) *ServerUpdateOne
SetNillableDeletedAt sets the deleted_at field if the given value is not nil.
func (*ServerUpdateOne) SetNvidiaGpu ¶
func (suo *ServerUpdateOne) SetNvidiaGpu(i int) *ServerUpdateOne
SetNvidiaGpu sets the nvidia_gpu field.
func (*ServerUpdateOne) SetTemplate ¶
func (suo *ServerUpdateOne) SetTemplate(s string) *ServerUpdateOne
SetTemplate sets the template field.
func (*ServerUpdateOne) SetVariables ¶
func (suo *ServerUpdateOne) SetVariables(cv *common.TemplateVariables) *ServerUpdateOne
SetVariables sets the variables field.
type Template ¶
type Template struct { // ID of the ent. ID int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Description holds the value of the "description" field. Description string `json:"description,omitempty"` // Template holds the value of the "template" field. Template string `json:"template,omitempty"` // Variables holds the value of the "variables" field. Variables *common.TemplateVariables `json:"variables,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // DeletedAt holds the value of the "deleted_at" field. DeletedAt time.Time `json:"deleted_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the TemplateQuery when eager-loading is set. Edges TemplateEdges `json:"edges"` // contains filtered or unexported fields }
Template is the model entity for the Template schema.
func (*Template) QueryServer ¶
func (t *Template) QueryServer() *ServerQuery
QueryServer queries the server edge of the Template.
func (*Template) ToCommonType ¶
ToCommonType Convert db schema to common type
func (*Template) Unwrap ¶
Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next queries will be executed through the driver which created the transaction.
func (*Template) Update ¶
func (t *Template) Update() *TemplateUpdateOne
Update returns a builder for updating this Template. Note that, you need to call Template.Unwrap() before calling this method, if this Template was returned from a transaction, and the transaction was committed or rolled back.
type TemplateClient ¶
type TemplateClient struct {
// contains filtered or unexported fields
}
TemplateClient is a client for the Template schema.
func NewTemplateClient ¶
func NewTemplateClient(c config) *TemplateClient
NewTemplateClient returns a client for the Template from the given config.
func (*TemplateClient) Create ¶
func (c *TemplateClient) Create() *TemplateCreate
Create returns a create builder for Template.
func (*TemplateClient) CreateBulk ¶
func (c *TemplateClient) CreateBulk(builders ...*TemplateCreate) *TemplateCreateBulk
CreateBulk returns a builder for creating a bulk of Template entities.
func (*TemplateClient) Delete ¶
func (c *TemplateClient) Delete() *TemplateDelete
Delete returns a delete builder for Template.
func (*TemplateClient) DeleteOne ¶
func (c *TemplateClient) DeleteOne(t *Template) *TemplateDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*TemplateClient) DeleteOneID ¶
func (c *TemplateClient) DeleteOneID(id int) *TemplateDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*TemplateClient) GetX ¶
func (c *TemplateClient) GetX(ctx context.Context, id int) *Template
GetX is like Get, but panics if an error occurs.
func (*TemplateClient) Hooks ¶
func (c *TemplateClient) Hooks() []Hook
Hooks returns the client hooks.
func (*TemplateClient) Query ¶
func (c *TemplateClient) Query() *TemplateQuery
Query returns a query builder for Template.
func (*TemplateClient) QueryServer ¶
func (c *TemplateClient) QueryServer(t *Template) *ServerQuery
QueryServer queries the server edge of a Template.
func (*TemplateClient) QueryUser ¶
func (c *TemplateClient) QueryUser(t *Template) *UserQuery
QueryUser queries the user edge of a Template.
func (*TemplateClient) Update ¶
func (c *TemplateClient) Update() *TemplateUpdate
Update returns an update builder for Template.
func (*TemplateClient) UpdateOne ¶
func (c *TemplateClient) UpdateOne(t *Template) *TemplateUpdateOne
UpdateOne returns an update builder for the given entity.
func (*TemplateClient) UpdateOneID ¶
func (c *TemplateClient) UpdateOneID(id int) *TemplateUpdateOne
UpdateOneID returns an update builder for the given id.
func (*TemplateClient) Use ¶
func (c *TemplateClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `template.Hooks(f(g(h())))`.
type TemplateCreate ¶
type TemplateCreate struct {
// contains filtered or unexported fields
}
TemplateCreate is the builder for creating a Template entity.
func (*TemplateCreate) AddServer ¶
func (tc *TemplateCreate) AddServer(s ...*Server) *TemplateCreate
AddServer adds the server edges to Server.
func (*TemplateCreate) AddServerIDs ¶
func (tc *TemplateCreate) AddServerIDs(ids ...int) *TemplateCreate
AddServerIDs adds the server edge to Server by ids.
func (*TemplateCreate) AddUser ¶
func (tc *TemplateCreate) AddUser(u ...*User) *TemplateCreate
AddUser adds the user edges to User.
func (*TemplateCreate) AddUserIDs ¶
func (tc *TemplateCreate) AddUserIDs(ids ...int) *TemplateCreate
AddUserIDs adds the user edge to User by ids.
func (*TemplateCreate) Mutation ¶
func (tc *TemplateCreate) Mutation() *TemplateMutation
Mutation returns the TemplateMutation object of the builder.
func (*TemplateCreate) Save ¶
func (tc *TemplateCreate) Save(ctx context.Context) (*Template, error)
Save creates the Template in the database.
func (*TemplateCreate) SaveX ¶
func (tc *TemplateCreate) SaveX(ctx context.Context) *Template
SaveX calls Save and panics if Save returns an error.
func (*TemplateCreate) SetCreatedAt ¶
func (tc *TemplateCreate) SetCreatedAt(t time.Time) *TemplateCreate
SetCreatedAt sets the created_at field.
func (*TemplateCreate) SetDeletedAt ¶
func (tc *TemplateCreate) SetDeletedAt(t time.Time) *TemplateCreate
SetDeletedAt sets the deleted_at field.
func (*TemplateCreate) SetDescription ¶
func (tc *TemplateCreate) SetDescription(s string) *TemplateCreate
SetDescription sets the description field.
func (*TemplateCreate) SetName ¶
func (tc *TemplateCreate) SetName(s string) *TemplateCreate
SetName sets the name field.
func (*TemplateCreate) SetNillableCreatedAt ¶
func (tc *TemplateCreate) SetNillableCreatedAt(t *time.Time) *TemplateCreate
SetNillableCreatedAt sets the created_at field if the given value is not nil.
func (*TemplateCreate) SetNillableDeletedAt ¶
func (tc *TemplateCreate) SetNillableDeletedAt(t *time.Time) *TemplateCreate
SetNillableDeletedAt sets the deleted_at field if the given value is not nil.
func (*TemplateCreate) SetNillableDescription ¶
func (tc *TemplateCreate) SetNillableDescription(s *string) *TemplateCreate
SetNillableDescription sets the description field if the given value is not nil.
func (*TemplateCreate) SetTemplate ¶
func (tc *TemplateCreate) SetTemplate(s string) *TemplateCreate
SetTemplate sets the template field.
func (*TemplateCreate) SetVariables ¶
func (tc *TemplateCreate) SetVariables(cv *common.TemplateVariables) *TemplateCreate
SetVariables sets the variables field.
type TemplateCreateBulk ¶
type TemplateCreateBulk struct {
// contains filtered or unexported fields
}
TemplateCreateBulk is the builder for creating a bulk of Template entities.
type TemplateDelete ¶
type TemplateDelete struct {
// contains filtered or unexported fields
}
TemplateDelete is the builder for deleting a Template entity.
func (*TemplateDelete) Exec ¶
func (td *TemplateDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*TemplateDelete) ExecX ¶
func (td *TemplateDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*TemplateDelete) Where ¶
func (td *TemplateDelete) Where(ps ...predicate.Template) *TemplateDelete
Where adds a new predicate to the delete builder.
type TemplateDeleteOne ¶
type TemplateDeleteOne struct {
// contains filtered or unexported fields
}
TemplateDeleteOne is the builder for deleting a single Template entity.
func (*TemplateDeleteOne) Exec ¶
func (tdo *TemplateDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*TemplateDeleteOne) ExecX ¶
func (tdo *TemplateDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type TemplateEdges ¶
type TemplateEdges struct { // User holds the value of the user edge. User []*User // Server holds the value of the server edge. Server []*Server // contains filtered or unexported fields }
TemplateEdges holds the relations/edges for other nodes in the graph.
func (TemplateEdges) ServerOrErr ¶
func (e TemplateEdges) ServerOrErr() ([]*Server, error)
ServerOrErr returns the Server value or an error if the edge was not loaded in eager-loading.
func (TemplateEdges) UserOrErr ¶
func (e TemplateEdges) UserOrErr() ([]*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading.
type TemplateGroupBy ¶
type TemplateGroupBy struct {
// contains filtered or unexported fields
}
TemplateGroupBy is the builder for group-by Template entities.
func (*TemplateGroupBy) Aggregate ¶
func (tgb *TemplateGroupBy) Aggregate(fns ...AggregateFunc) *TemplateGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TemplateGroupBy) Bool ¶
func (tgb *TemplateGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from group-by. It is only allowed when querying group-by with one field.
func (*TemplateGroupBy) BoolX ¶
func (tgb *TemplateGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*TemplateGroupBy) Bools ¶
func (tgb *TemplateGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when querying group-by with one field.
func (*TemplateGroupBy) BoolsX ¶
func (tgb *TemplateGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*TemplateGroupBy) Float64 ¶
func (tgb *TemplateGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from group-by. It is only allowed when querying group-by with one field.
func (*TemplateGroupBy) Float64X ¶
func (tgb *TemplateGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*TemplateGroupBy) Float64s ¶
func (tgb *TemplateGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when querying group-by with one field.
func (*TemplateGroupBy) Float64sX ¶
func (tgb *TemplateGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*TemplateGroupBy) Int ¶
func (tgb *TemplateGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from group-by. It is only allowed when querying group-by with one field.
func (*TemplateGroupBy) IntX ¶
func (tgb *TemplateGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*TemplateGroupBy) Ints ¶
func (tgb *TemplateGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when querying group-by with one field.
func (*TemplateGroupBy) IntsX ¶
func (tgb *TemplateGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*TemplateGroupBy) Scan ¶
func (tgb *TemplateGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scan the result into the given value.
func (*TemplateGroupBy) ScanX ¶
func (tgb *TemplateGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*TemplateGroupBy) String ¶
func (tgb *TemplateGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from group-by. It is only allowed when querying group-by with one field.
func (*TemplateGroupBy) StringX ¶
func (tgb *TemplateGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type TemplateMutation ¶
type TemplateMutation struct {
// contains filtered or unexported fields
}
TemplateMutation represents an operation that mutate the Templates nodes in the graph.
func (*TemplateMutation) AddField ¶
func (m *TemplateMutation) AddField(name string, value ent.Value) error
AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.
func (*TemplateMutation) AddServerIDs ¶
func (m *TemplateMutation) AddServerIDs(ids ...int)
AddServerIDs adds the server edge to Server by ids.
func (*TemplateMutation) AddUserIDs ¶
func (m *TemplateMutation) AddUserIDs(ids ...int)
AddUserIDs adds the user edge to User by ids.
func (*TemplateMutation) AddedEdges ¶
func (m *TemplateMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*TemplateMutation) AddedField ¶
func (m *TemplateMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.
func (*TemplateMutation) AddedFields ¶
func (m *TemplateMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented or decremented during this mutation.
func (*TemplateMutation) AddedIDs ¶
func (m *TemplateMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all ids (to other nodes) that were added for the given edge name.
func (*TemplateMutation) ClearDeletedAt ¶
func (m *TemplateMutation) ClearDeletedAt()
ClearDeletedAt clears the value of deleted_at.
func (*TemplateMutation) ClearDescription ¶
func (m *TemplateMutation) ClearDescription()
ClearDescription clears the value of description.
func (*TemplateMutation) ClearEdge ¶
func (m *TemplateMutation) ClearEdge(name string) error
ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.
func (*TemplateMutation) ClearField ¶
func (m *TemplateMutation) ClearField(name string) error
ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.
func (*TemplateMutation) ClearServer ¶
func (m *TemplateMutation) ClearServer()
ClearServer clears the server edge to Server.
func (*TemplateMutation) ClearUser ¶
func (m *TemplateMutation) ClearUser()
ClearUser clears the user edge to User.
func (*TemplateMutation) ClearedEdges ¶
func (m *TemplateMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*TemplateMutation) ClearedFields ¶
func (m *TemplateMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (TemplateMutation) Client ¶
func (m TemplateMutation) 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 (*TemplateMutation) CreatedAt ¶
func (m *TemplateMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the created_at value in the mutation.
func (*TemplateMutation) DeletedAt ¶
func (m *TemplateMutation) DeletedAt() (r time.Time, exists bool)
DeletedAt returns the deleted_at value in the mutation.
func (*TemplateMutation) DeletedAtCleared ¶
func (m *TemplateMutation) DeletedAtCleared() bool
DeletedAtCleared returns if the field deleted_at was cleared in this mutation.
func (*TemplateMutation) Description ¶
func (m *TemplateMutation) Description() (r string, exists bool)
Description returns the description value in the mutation.
func (*TemplateMutation) DescriptionCleared ¶
func (m *TemplateMutation) DescriptionCleared() bool
DescriptionCleared returns if the field description was cleared in this mutation.
func (*TemplateMutation) EdgeCleared ¶
func (m *TemplateMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.
func (*TemplateMutation) Field ¶
func (m *TemplateMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean value indicates that this field was not set, or was not define in the schema.
func (*TemplateMutation) FieldCleared ¶
func (m *TemplateMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicates if this field was cleared in this mutation.
func (*TemplateMutation) Fields ¶
func (m *TemplateMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that, in order to get all numeric fields that were in/decremented, call AddedFields().
func (*TemplateMutation) ID ¶
func (m *TemplateMutation) ID() (id int, exists bool)
ID returns the id value in the mutation. Note that, the id is available only if it was provided to the builder.
func (*TemplateMutation) Name ¶
func (m *TemplateMutation) Name() (r string, exists bool)
Name returns the name value in the mutation.
func (*TemplateMutation) OldCreatedAt ¶
OldCreatedAt returns the old created_at value of the Template. If the Template 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 database query fails.
func (*TemplateMutation) OldDeletedAt ¶
OldDeletedAt returns the old deleted_at value of the Template. If the Template 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 database query fails.
func (*TemplateMutation) OldDescription ¶
func (m *TemplateMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old description value of the Template. If the Template 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 database query fails.
func (*TemplateMutation) 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 was failed.
func (*TemplateMutation) OldName ¶
func (m *TemplateMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old name value of the Template. If the Template 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 database query fails.
func (*TemplateMutation) OldTemplate ¶
func (m *TemplateMutation) OldTemplate(ctx context.Context) (v string, err error)
OldTemplate returns the old template value of the Template. If the Template 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 database query fails.
func (*TemplateMutation) OldVariables ¶
func (m *TemplateMutation) OldVariables(ctx context.Context) (v *common.TemplateVariables, err error)
OldVariables returns the old variables value of the Template. If the Template 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 database query fails.
func (*TemplateMutation) RemoveServerIDs ¶
func (m *TemplateMutation) RemoveServerIDs(ids ...int)
RemoveServerIDs removes the server edge to Server by ids.
func (*TemplateMutation) RemoveUserIDs ¶
func (m *TemplateMutation) RemoveUserIDs(ids ...int)
RemoveUserIDs removes the user edge to User by ids.
func (*TemplateMutation) RemovedEdges ¶
func (m *TemplateMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*TemplateMutation) RemovedIDs ¶
func (m *TemplateMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.
func (*TemplateMutation) RemovedServerIDs ¶
func (m *TemplateMutation) RemovedServerIDs() (ids []int)
RemovedServer returns the removed ids of server.
func (*TemplateMutation) RemovedUserIDs ¶
func (m *TemplateMutation) RemovedUserIDs() (ids []int)
RemovedUser returns the removed ids of user.
func (*TemplateMutation) ResetCreatedAt ¶
func (m *TemplateMutation) ResetCreatedAt()
ResetCreatedAt reset all changes of the "created_at" field.
func (*TemplateMutation) ResetDeletedAt ¶
func (m *TemplateMutation) ResetDeletedAt()
ResetDeletedAt reset all changes of the "deleted_at" field.
func (*TemplateMutation) ResetDescription ¶
func (m *TemplateMutation) ResetDescription()
ResetDescription reset all changes of the "description" field.
func (*TemplateMutation) ResetEdge ¶
func (m *TemplateMutation) ResetEdge(name string) error
ResetEdge resets all changes in the mutation regarding the given edge name. It returns an error if the edge is not defined in the schema.
func (*TemplateMutation) ResetField ¶
func (m *TemplateMutation) ResetField(name string) error
ResetField resets all changes in the mutation regarding the given field name. It returns an error if the field is not defined in the schema.
func (*TemplateMutation) ResetName ¶
func (m *TemplateMutation) ResetName()
ResetName reset all changes of the "name" field.
func (*TemplateMutation) ResetServer ¶
func (m *TemplateMutation) ResetServer()
ResetServer reset all changes of the "server" edge.
func (*TemplateMutation) ResetTemplate ¶
func (m *TemplateMutation) ResetTemplate()
ResetTemplate reset all changes of the "template" field.
func (*TemplateMutation) ResetUser ¶
func (m *TemplateMutation) ResetUser()
ResetUser reset all changes of the "user" edge.
func (*TemplateMutation) ResetVariables ¶
func (m *TemplateMutation) ResetVariables()
ResetVariables reset all changes of the "variables" field.
func (*TemplateMutation) ServerCleared ¶
func (m *TemplateMutation) ServerCleared() bool
ServerCleared returns if the edge server was cleared.
func (*TemplateMutation) ServerIDs ¶
func (m *TemplateMutation) ServerIDs() (ids []int)
ServerIDs returns the server ids in the mutation.
func (*TemplateMutation) SetCreatedAt ¶
func (m *TemplateMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the created_at field.
func (*TemplateMutation) SetDeletedAt ¶
func (m *TemplateMutation) SetDeletedAt(t time.Time)
SetDeletedAt sets the deleted_at field.
func (*TemplateMutation) SetDescription ¶
func (m *TemplateMutation) SetDescription(s string)
SetDescription sets the description field.
func (*TemplateMutation) SetField ¶
func (m *TemplateMutation) SetField(name string, value ent.Value) error
SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.
func (*TemplateMutation) SetName ¶
func (m *TemplateMutation) SetName(s string)
SetName sets the name field.
func (*TemplateMutation) SetTemplate ¶
func (m *TemplateMutation) SetTemplate(s string)
SetTemplate sets the template field.
func (*TemplateMutation) SetVariables ¶
func (m *TemplateMutation) SetVariables(cv *common.TemplateVariables)
SetVariables sets the variables field.
func (*TemplateMutation) Template ¶
func (m *TemplateMutation) Template() (r string, exists bool)
Template returns the template value in the mutation.
func (TemplateMutation) Tx ¶
func (m TemplateMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*TemplateMutation) Type ¶
func (m *TemplateMutation) Type() string
Type returns the node type of this mutation (Template).
func (*TemplateMutation) UserCleared ¶
func (m *TemplateMutation) UserCleared() bool
UserCleared returns if the edge user was cleared.
func (*TemplateMutation) UserIDs ¶
func (m *TemplateMutation) UserIDs() (ids []int)
UserIDs returns the user ids in the mutation.
func (*TemplateMutation) Variables ¶
func (m *TemplateMutation) Variables() (r *common.TemplateVariables, exists bool)
Variables returns the variables value in the mutation.
type TemplateQuery ¶
type TemplateQuery struct {
// contains filtered or unexported fields
}
TemplateQuery is the builder for querying Template entities.
func (*TemplateQuery) All ¶
func (tq *TemplateQuery) All(ctx context.Context) ([]*Template, error)
All executes the query and returns a list of Templates.
func (*TemplateQuery) AllX ¶
func (tq *TemplateQuery) AllX(ctx context.Context) []*Template
AllX is like All, but panics if an error occurs.
func (*TemplateQuery) Clone ¶
func (tq *TemplateQuery) Clone() *TemplateQuery
Clone returns a duplicate of the query builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*TemplateQuery) Count ¶
func (tq *TemplateQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*TemplateQuery) CountX ¶
func (tq *TemplateQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*TemplateQuery) Exist ¶
func (tq *TemplateQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*TemplateQuery) ExistX ¶
func (tq *TemplateQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*TemplateQuery) First ¶
func (tq *TemplateQuery) First(ctx context.Context) (*Template, error)
First returns the first Template entity in the query. Returns *NotFoundError when no template was found.
func (*TemplateQuery) FirstID ¶
func (tq *TemplateQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Template id in the query. Returns *NotFoundError when no id was found.
func (*TemplateQuery) FirstIDX ¶
func (tq *TemplateQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*TemplateQuery) FirstX ¶
func (tq *TemplateQuery) FirstX(ctx context.Context) *Template
FirstX is like First, but panics if an error occurs.
func (*TemplateQuery) GroupBy ¶
func (tq *TemplateQuery) GroupBy(field string, fields ...string) *TemplateGroupBy
GroupBy 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.Template.Query(). GroupBy(template.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*TemplateQuery) IDs ¶
func (tq *TemplateQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of Template ids.