Documentation
¶
Index ¶
- type CountNodesPageParams
- type DBTX
- type ListNodesPageParams
- type Node
- type NodeHeartbeatParams
- type Queries
- func (q *Queries) CountNodesPage(ctx context.Context, arg CountNodesPageParams) (int64, error)
- func (q *Queries) DeleteNode(ctx context.Context, id string) (int64, error)
- func (q *Queries) ListNodes(ctx context.Context) ([]Node, error)
- func (q *Queries) ListNodesPage(ctx context.Context, arg ListNodesPageParams) ([]Node, error)
- func (q *Queries) NodeExists(ctx context.Context, id string) (bool, error)
- func (q *Queries) NodeHeartbeat(ctx context.Context, arg NodeHeartbeatParams) (pgtype.Timestamptz, error)
- func (q *Queries) RequestDrain(ctx context.Context, id string) (int64, error)
- func (q *Queries) RetentionNodes(ctx context.Context) (int64, error)
- func (q *Queries) StopNode(ctx context.Context, id string) error
- func (q *Queries) UpsertNode(ctx context.Context, arg UpsertNodeParams) error
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type UpsertNodeParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CountNodesPageParams ¶
type ListNodesPageParams ¶
type ListNodesPageParams struct {
Pattern string `json:"pattern"`
State string `json:"state"`
LostBefore pgtype.Timestamptz `json:"lost_before"`
Stale bool `json:"stale"`
Queues []string `json:"queues"`
EncodeOnly bool `json:"encode_only"`
AfterAt pgtype.Timestamptz `json:"after_at"`
AfterID string `json:"after_id"`
Lim int32 `json:"lim"`
}
type Node ¶
type Node struct {
ID string `json:"id"`
Hostname string `json:"hostname"`
Cpus int32 `json:"cpus"`
Queues []string `json:"queues"`
Slots []int32 `json:"slots"`
Version string `json:"version"`
Os string `json:"os"`
Arch string `json:"arch"`
MemoryBytes pgtype.Int8 `json:"memory_bytes"`
DiskBytes pgtype.Int8 `json:"disk_bytes"`
Ffmpeg string `json:"ffmpeg"`
Gpu string `json:"gpu"`
Encoders []string `json:"encoders"`
Load1 pgtype.Float4 `json:"load1"`
MemoryFreeBytes pgtype.Int8 `json:"memory_free_bytes"`
DiskFreeBytes pgtype.Int8 `json:"disk_free_bytes"`
StartedAt pgtype.Timestamptz `json:"started_at"`
LastSeenAt pgtype.Timestamptz `json:"last_seen_at"`
DrainRequestedAt pgtype.Timestamptz `json:"drain_requested_at"`
StoppedAt pgtype.Timestamptz `json:"stopped_at"`
}
type NodeHeartbeatParams ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CountNodesPage ¶
func (*Queries) DeleteNode ¶
A node can be forgotten once it has stopped, or has been silent long enough to be presumed gone.
func (*Queries) ListNodesPage ¶
Searches the host name and id, newest start first, continuing after the (after_at, after_id) row. lost_before is when a node counts as lost; stale keeps running nodes whose version isn't the newest running node's.
func (*Queries) NodeExists ¶
func (*Queries) NodeHeartbeat ¶
func (q *Queries) NodeHeartbeat(ctx context.Context, arg NodeHeartbeatParams) (pgtype.Timestamptz, error)
func (*Queries) RequestDrain ¶
func (*Queries) RetentionNodes ¶
Nodes a week after they stopped or went silent.
func (*Queries) UpsertNode ¶
func (q *Queries) UpsertNode(ctx context.Context, arg UpsertNodeParams) error
type UpsertNodeParams ¶
type UpsertNodeParams struct {
ID string `json:"id"`
Hostname string `json:"hostname"`
Cpus int32 `json:"cpus"`
Queues []string `json:"queues"`
Slots []int32 `json:"slots"`
Version string `json:"version"`
Os string `json:"os"`
Arch string `json:"arch"`
MemoryBytes pgtype.Int8 `json:"memory_bytes"`
DiskBytes pgtype.Int8 `json:"disk_bytes"`
Ffmpeg string `json:"ffmpeg"`
Gpu string `json:"gpu"`
Encoders []string `json:"encoders"`
}
Click to show internal directories.
Click to hide internal directories.