httpapi

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RouteHealthz = "/healthz"
	RouteLivez   = "/livez"
	RouteReadyz  = "/readyz"
)

Variables

This section is empty.

Functions

func AuthorizationHandler added in v0.4.2

func AuthorizationHandler(options AuthzOptions) fiber.Handler

AuthorizationHandler installs the access session and applies evaluator decisions at the Fiber boundary.

func ClassifyError added in v0.4.2

func ClassifyError(ctx context.Context, err error) errorapi.APIError

ClassifyError converts an application error into the public API error envelope. The original error remains available to the boundary logger and is never used as a response message for server failures.

func FiberErrorHandler added in v0.4.2

func FiberErrorHandler(c fiber.Ctx, err error) error

FiberErrorHandler converts errors returned through Fiber into the same API error contract used by explicit handler rejections.

func HandleError added in v0.4.2

func HandleError(c fiber.Ctx, err error) error

func NewAPIError added in v0.4.2

func NewAPIError(ctx context.Context, code errorapi.ErrorCode, status int, msg string) errorapi.APIError

NewAPIError builds the shared wire payload for Fiber and generated handlers.

func RegisterRoutes

func RegisterRoutes(app fiber.Router, deps Dependencies, options Options)

func Reject added in v0.4.2

func Reject(c fiber.Ctx, status int, msg string) error

func RequestIDHandler added in v0.4.2

func RequestIDHandler(logger *slog.Logger) fiber.Handler

RequestIDHandler adds the request ID to context and response headers while recording the request lifecycle at the HTTP boundary.

Types

type AuthzOptions added in v0.4.2

type AuthzOptions struct {
	Mode      string
	Evaluator access.Evaluator
}

type Dependencies

type Dependencies struct {
	ServiceInfo    generated.N200ServiceInfo
	Objects        *objects.Service
	Transfers      *transfers.Service
	LFS            *transferlfs.Service
	UsageIngest    usage.Ingestor
	UsageReports   usage.Reporter
	Buckets        *buckets.Service
	ProjectStorage *projectstorage.Service
	Authorization  fiber.Handler
	RequestIDs     fiber.Handler
	Health         *Health
}

type Health added in v0.4.2

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

Health owns process-serving state separately from dependency readiness. Liveness never performs I/O; readiness performs one bounded dependency check and is flipped false before owned resources are closed.

func NewHealth added in v0.4.2

func NewHealth(check func(context.Context) error, timeout time.Duration) *Health

func (*Health) StopServing added in v0.4.2

func (h *Health) StopServing()

type LFSOptions added in v0.4.2

type LFSOptions struct {
	MaxBatchObjects              int
	MaxBatchBodyBytes            int64
	MaxUploadObjectBytes         int64
	RequestLimitPerMinute        int
	BandwidthLimitBytesPerMinute int64
}

type Options

type Options struct {
	Docs                 bool
	GA4GH                bool
	Metrics              bool
	Internal             bool
	LFS                  bool
	LFSProtocol          LFSOptions
	MaxBulkRequestLength int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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