api

package
v0.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityHandler added in v0.4.4

type ActivityHandler struct {
	// contains filtered or unexported fields
}

ActivityHandler serves the read-only activity ("Intervention Skyline") API.

func NewActivityHandler added in v0.4.4

func NewActivityHandler(store ActivityStore) *ActivityHandler

NewActivityHandler builds an activity API handler.

func (*ActivityHandler) RegisterRoutesWithMiddleware added in v0.4.4

func (h *ActivityHandler) RegisterRoutesWithMiddleware(mux *http.ServeMux, middleware func(http.Handler) http.Handler)

RegisterRoutesWithMiddleware registers activity routes under the default /api prefix.

func (*ActivityHandler) RegisterRoutesWithPrefix added in v0.4.4

func (h *ActivityHandler) RegisterRoutesWithPrefix(mux *http.ServeMux, prefix string, middleware func(http.Handler) http.Handler)

RegisterRoutesWithPrefix registers activity routes under prefix.

type ActivityStore added in v0.4.4

type ActivityStore interface {
	ActivitySummary(context.Context, *persistence.ActivityFilter) (*persistence.ActivitySummary, error)
}

ActivityStore provides the read method required by the activity API.

type BenchmarkHandler added in v0.4.0

type BenchmarkHandler struct {
	// contains filtered or unexported fields
}

BenchmarkHandler serves the read-only benchmark API.

func NewBenchmarkHandler added in v0.4.0

func NewBenchmarkHandler(store BenchmarkStore) *BenchmarkHandler

NewBenchmarkHandler builds a benchmark API handler.

func (*BenchmarkHandler) RegisterRoutesWithMiddleware added in v0.4.0

func (h *BenchmarkHandler) RegisterRoutesWithMiddleware(mux *http.ServeMux, middleware func(http.Handler) http.Handler)

RegisterRoutesWithMiddleware registers benchmark routes with optional middleware.

type EventStore added in v0.4.2

type EventStore interface {
	ListEvents(context.Context, *persistence.EventListFilter) (*persistence.EventListPage, error)
}

EventStore provides the read methods required by the global events API.

type EventsHandler added in v0.4.2

type EventsHandler struct {
	// contains filtered or unexported fields
}

EventsHandler serves the read-only global action-event API.

func NewEventsHandler added in v0.4.2

func NewEventsHandler(store EventStore) *EventsHandler

NewEventsHandler builds an events API handler.

func (*EventsHandler) RegisterRoutesWithMiddleware added in v0.4.2

func (h *EventsHandler) RegisterRoutesWithMiddleware(mux *http.ServeMux, middleware func(http.Handler) http.Handler)

RegisterRoutesWithMiddleware registers event routes with optional middleware.

func (*EventsHandler) RegisterRoutesWithPrefix added in v0.4.3

func (h *EventsHandler) RegisterRoutesWithPrefix(mux *http.ServeMux, prefix string, middleware func(http.Handler) http.Handler)

RegisterRoutesWithPrefix registers event routes under prefix.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler serves the read-only task run API.

func NewHandler

func NewHandler(store Store) *Handler

NewHandler builds an API handler bound to a persistence store.

func (*Handler) RegisterRoutes

func (h *Handler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers the task run API routes on the provided mux.

func (*Handler) RegisterRoutesWithMiddleware

func (h *Handler) RegisterRoutesWithMiddleware(mux *http.ServeMux, middleware func(http.Handler) http.Handler)

RegisterRoutesWithMiddleware registers the task run API routes and wraps each endpoint with the provided middleware when present.

func (*Handler) RegisterRoutesWithPrefix added in v0.4.3

func (h *Handler) RegisterRoutesWithPrefix(mux *http.ServeMux, prefix string, middleware func(http.Handler) http.Handler)

RegisterRoutesWithPrefix registers task run API routes under prefix.

type PrincipalNamer added in v0.4.4

type PrincipalNamer interface {
	PrincipalNames(ctx context.Context) (map[string]string, error)
}

PrincipalNamer resolves principal ids to human-readable display names. It is optional; a nil namer (or one returning an empty map) falls back to raw ids.

type PrincipalRef added in v0.4.4

type PrincipalRef struct {
	ID          string `json:"id"`
	DisplayName string `json:"displayName"`
}

PrincipalRef is one principal option for a filter dropdown.

type PrincipalStore added in v0.4.4

type PrincipalStore interface {
	DistinctPrincipals(ctx context.Context, start, end int64) ([]string, error)
}

PrincipalStore provides the distinct-principal lookup for the principals API.

type PrincipalsHandler added in v0.4.4

type PrincipalsHandler struct {
	// contains filtered or unexported fields
}

PrincipalsHandler serves the read-only list of principals seen in events, labeled with display names where available.

func NewPrincipalsHandler added in v0.4.4

func NewPrincipalsHandler(store PrincipalStore, namer PrincipalNamer) *PrincipalsHandler

NewPrincipalsHandler builds a principals API handler. namer may be nil.

func (*PrincipalsHandler) RegisterRoutesWithMiddleware added in v0.4.4

func (h *PrincipalsHandler) RegisterRoutesWithMiddleware(mux *http.ServeMux, middleware func(http.Handler) http.Handler)

RegisterRoutesWithMiddleware registers principal routes under the default /api prefix.

func (*PrincipalsHandler) RegisterRoutesWithPrefix added in v0.4.4

func (h *PrincipalsHandler) RegisterRoutesWithPrefix(mux *http.ServeMux, prefix string, middleware func(http.Handler) http.Handler)

RegisterRoutesWithPrefix registers principal routes under prefix.

type ProjectSummary added in v0.4.3

type ProjectSummary struct {
	Slug                    string `json:"slug"`
	Name                    string `json:"name"`
	Description             string `json:"description,omitempty"`
	IsDefault               bool   `json:"isDefault"`
	UIEnabled               bool   `json:"uiEnabled"`
	EventStorageEnabled     bool   `json:"eventStorageEnabled"`
	TaskVerificationEnabled bool   `json:"taskVerificationEnabled"`
}

ProjectSummary describes one configured project exposed to the UI.

type ProjectSummaryFilter added in v0.4.3

type ProjectSummaryFilter func(*http.Request, ProjectSummary) bool

ProjectSummaryFilter filters project metadata for the current request.

type ProjectsHandler added in v0.4.3

type ProjectsHandler struct {
	// contains filtered or unexported fields
}

ProjectsHandler serves configured project metadata.

func NewProjectsHandler added in v0.4.3

func NewProjectsHandler(projects []ProjectSummary) *ProjectsHandler

NewProjectsHandler builds a project metadata API handler.

func (*ProjectsHandler) RegisterRoutesWithMiddleware added in v0.4.3

func (h *ProjectsHandler) RegisterRoutesWithMiddleware(mux *http.ServeMux, middleware func(http.Handler) http.Handler)

RegisterRoutesWithMiddleware registers project metadata routes.

func (*ProjectsHandler) WithFilter added in v0.4.3

func (h *ProjectsHandler) WithFilter(filter ProjectSummaryFilter) *ProjectsHandler

WithFilter returns the handler with a request-scoped project filter attached.

type Store

type Store interface {
	ListTaskRuns(ctx context.Context, filter persistence.TaskRunFilter) ([]persistence.TaskRunSummary, error)
	GetTaskRun(ctx context.Context, runID string) (*persistence.TaskRunSummary, error)
	GetTaskRunSnapshot(ctx context.Context, runID string) (*persistence.TaskRunSnapshotRecord, error)
	ListTaskRunBenchmarkLinks(ctx context.Context, runID string) ([]persistence.TaskRunBenchmarkLink, error)
	GetTaskRunEvents(ctx context.Context, runID string) ([]persistence.TaskRunEvent, error)
}

Store provides the persistence-backed projections required by the API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL