server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(db *gorm.DB) error

Migrate brings the schema up to date. See internal/migrations.

func New

func New(d Deps) (http.Handler, error)

New builds the HTTP handler with all routes wired. Used by cmd/libraryz and integration tests so production and tests exercise the same router.

Types

type Deps

type Deps struct {
	DB             *gorm.DB
	Storage        storage.Storage
	MaxUploadBytes int64
	// UploadQuota is the per-account upload allowance; the zero value means
	// none. See catalog.UploadQuota.
	UploadQuota catalog.UploadQuota
	// AllowedOrigins is the exact-match CORS allowlist for browser clients.
	// Empty = dev mode (localhost / 127.0.0.1 origins only). See cors.
	AllowedOrigins []string
	// AllowPrivateLAN additionally permits RFC-1918 private-IP origins in dev
	// mode (when AllowedOrigins is empty). Ignored otherwise.
	AllowPrivateLAN bool
	// JWTSecret signs access tokens (at least 32 bytes); JWTPreviousSecret
	// still verifies them during a rotation. See auth.Config.
	JWTSecret         string
	JWTPreviousSecret string
	// Token lifetimes; zero means the auth package defaults.
	AccessTokenTTL  time.Duration
	RefreshTokenTTL time.Duration
	SessionMaxAge   time.Duration
	// VerifySessionOnAccess makes revocation immediate (one lookup per
	// authenticated request). See auth.Config.
	VerifySessionOnAccess bool
	// LoadSubjectOnAccess makes role changes and disabled users take effect
	// at once. See auth.Config.
	LoadSubjectOnAccess bool
	// Login throttles; nil means per-process in-memory limiters.
	LoginLimiterPerAccount ratelimit.Limiter
	LoginLimiterPerIP      ratelimit.Limiter
	// TrustedProxies whose X-Forwarded-For names the client IP (Kong).
	TrustedProxies []netip.Prefix
	// Mail sends password-reset and verification emails; the zero value
	// means mail is off (requests are still answered as usual).
	Mail auth.Mail
}

type ReadyResponse

type ReadyResponse struct {
	Status string            `json:"status"` // "ready" | "unavailable"
	Checks map[string]string `json:"checks"` // dependency -> "ok" | "unavailable"
}

ReadyResponse is the body of GET /ready.

Jump to

Keyboard shortcuts

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