api

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package api is the HTTP layer: routing and handlers. It depends on the files service only; it never reaches into storage or metadata directly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Router

func Router(deps Deps) http.Handler

Router builds the HTTP handler with all routes registered, instrumented with per-route request metrics.

Types

type Deps

type Deps struct {
	Files          *files.Service
	ReadyCheck     ReadyFunc
	Logger         *slog.Logger
	PresignTTL     time.Duration
	MaxUploadBytes int64
}

Deps are the collaborators the HTTP layer needs, injected at the composition root. ReadyCheck reports whether downstream dependencies are reachable; it is nil-safe (a nil check means "always ready"). Logger and PresignTTL fall back to sensible defaults when zero. MaxUploadBytes caps upload body size; zero means uncapped.

type ReadyFunc

type ReadyFunc func(ctx context.Context) error

ReadyFunc reports readiness; a nil error means ready. Implementations should honor the context deadline when probing dependencies.

Jump to

Keyboard shortcuts

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