Help us shape the future of Go! Take the 2026 Go Developer Survey

httpapi

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package httpapi serves POST /v1/jobs, GET /v1/jobs/{id}, and GET /v1/jobs/{id}/report over a coachapi.JobStore, an authz.RepoAuthorizer, and a queue.TaskQueue. Every store or authorizer failure that is not a clean miss answers 503 with the stable error envelope.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is the /v1/jobs HTTP surface.

func NewServer

func NewServer(cfg ServerConfig) (*Server, error)

NewServer requires cfg.Store, cfg.Authorizer, and cfg.Queue.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler is the /v1/jobs HTTP surface. It expects a Principal via coachapi.WithPrincipal and does not authenticate requests itself: the composition root wraps it in internal/authn's middleware. Missing Principal yields 401.

type ServerConfig

type ServerConfig struct {
	Store      coachapi.JobStore
	Authorizer authz.RepoAuthorizer
	Queue      queue.TaskQueue
	Now        func() time.Time
	NewJobID   func() string
}

Jump to

Keyboard shortcuts

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