Documentation
¶
Index ¶
- func New(config Config) (http.Handler, error)
- type AuditView
- type CacheView
- type ClockView
- type Config
- type LogView
- type OperationDetailView
- type OperationResourceView
- type OperationView
- type ProjectView
- type QueueView
- type ResourceSampleView
- type ResourceView
- type Route
- type RouteKind
- type SQLiteSource
- func (s *SQLiteSource) Authenticate(ctx context.Context, token string) (control.Principal, error)
- func (s *SQLiteSource) Authorize(ctx context.Context, principal control.Principal, route Route) error
- func (s *SQLiteSource) Snapshot(ctx context.Context, principal control.Principal, route Route) (Snapshot, error)
- func (s *SQLiteSource) SubscribeChanges() (<-chan struct{}, func())
- func (s *SQLiteSource) SubscribeLog(ctx context.Context, principal control.Principal, route Route) (<-chan LogView, error)
- type SQLiteSourceConfig
- type ServiceView
- type SessionView
- type Snapshot
- type Source
- type StatusView
- type WorkerView
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type OperationDetailView ¶
type OperationResourceView ¶
type OperationView ¶
type OperationView struct {
Kind string `json:"kind"`
ID string `json:"id"`
Project string `json:"project"`
ProjectName string `json:"projectName"`
Status string `json:"status"`
Command string `json:"command"`
Image string `json:"image"`
CreatedAt time.Time `json:"createdAt"`
StartedAt *time.Time `json:"startedAt"`
FinishedAt *time.Time `json:"finishedAt"`
ExitCode *int `json:"exitCode"`
QueueWaitMillis *int64 `json:"queueWaitMillis"`
Resources OperationResourceView `json:"resources"`
}
type ProjectView ¶
type ResourceSampleView ¶
type ResourceView ¶
type ResourceView struct {
Samples []ResourceSampleView `json:"samples"`
SampleCount int `json:"sampleCount"`
ActiveSampleCount int `json:"activeSampleCount"`
CPUCores int `json:"cpuCores"`
MemoryTotalBytes uint64 `json:"memoryTotalBytes"`
DiskUsageBytes uint64 `json:"diskUsageBytes"`
DiskTotalBytes uint64 `json:"diskTotalBytes"`
BusyRatio float64 `json:"busyRatio"`
CPUAverage float64 `json:"cpuAverage"`
CPUPeak float64 `json:"cpuPeak"`
MemoryAverage float64 `json:"memoryAverage"`
MemoryPeak float64 `json:"memoryPeak"`
MemoryBytesPeak uint64 `json:"memoryBytesPeak"`
QueueWaitP95Millis int64 `json:"queueWaitP95Millis"`
}
ResourceView describes the shared runner capacity for the selected route. Samples are intentionally bounded and normalized so the browser only renders an authorized read model, never raw host or database state.
type SQLiteSource ¶
type SQLiteSource struct {
// contains filtered or unexported fields
}
func NewSQLiteSource ¶
func NewSQLiteSource(config SQLiteSourceConfig) (*SQLiteSource, error)
func (*SQLiteSource) Authenticate ¶
func (*SQLiteSource) SubscribeChanges ¶
func (s *SQLiteSource) SubscribeChanges() (<-chan struct{}, func())
func (*SQLiteSource) SubscribeLog ¶
func (s *SQLiteSource) SubscribeLog(ctx context.Context, principal control.Principal, route Route) (<-chan LogView, error)
SubscribeLog returns a bounded live tail for an authorized job detail route. Other routes have no log stream and receive an already-closed channel.
type SQLiteSourceConfig ¶
type ServiceView ¶
type SessionView ¶
type SessionView struct {
User string `json:"user"`
Admin bool `json:"admin"`
Projects []ProjectView `json:"projects"`
}
type Snapshot ¶
type Snapshot struct {
Revision int64
Session SessionView
Service ServiceView
Worker WorkerView
Clock ClockView
Resources ResourceView
Queue []QueueView
Operations []OperationView
Operation *OperationDetailView
Log LogView
Audit []AuditView
Status StatusView
}
type Source ¶
type Source interface {
Authenticate(context.Context, string) (control.Principal, error)
Authorize(context.Context, control.Principal, Route) error
Snapshot(context.Context, control.Principal, Route) (Snapshot, error)
SubscribeChanges() (<-chan struct{}, func())
SubscribeLog(context.Context, control.Principal, Route) (<-chan LogView, error)
}
type StatusView ¶
Click to show internal directories.
Click to hide internal directories.