Documentation
¶
Index ¶
- func Authenticator(metadataManager *metadata.Manager, config *Config) *auth.Authenticator
- func SetupRoutes(r *teapot.Router, deps RouteDependencies)
- func SetupVHostRoutes(r *teapot.Router, deps RouteDependencies, canonicalDomain string)
- type Config
- type RouteDependencies
- type Server
- func (s *Server) ActiveRequests() int32
- func (s *Server) Auth() *auth.Authenticator
- func (s *Server) InShutdown() bool
- func (s *Server) Metadata() *metadata.Manager
- func (s *Server) PolicyEngine() *policy.Engine
- func (s *Server) Router() *teapot.Router
- func (s *Server) SetConsole(h *teapot.Router, port int)
- func (s *Server) Start(ctx context.Context) error
- func (s *Server) Storage() *storage.Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authenticator ¶
func Authenticator(metadataManager *metadata.Manager, config *Config) *auth.Authenticator
func SetupRoutes ¶
func SetupRoutes(r *teapot.Router, deps RouteDependencies)
SetupRoutes configures all application routes on the provided router. When deps is nil, routes are registered with nil handlers (for CLI route listing).
func SetupVHostRoutes ¶
func SetupVHostRoutes(r *teapot.Router, deps RouteDependencies, canonicalDomain string)
SetupVHostRoutes configures the S3 data-plane routes for virtual-hosted-style addressing on a dedicated router. Only called when CanonicalDomain is set.
Unlike SetupRoutes, this does not register /.dirio/*, /minio/admin/*, or any other non-bucket-scoped routes — AWS's vhost-style endpoints are S3-data-plane-only, and control-plane traffic always goes through the path router (bare canonical domain or an IP).
Types ¶
type Config ¶
type Config struct {
DataDir string
Port int
AccessKey string // CLI admin credentials
SecretKey string // CLI admin credentials
// mDNS settings
MDNSEnabled bool
MDNSName string
MDNSHostname string
MDNSMode string
// URL generation
CanonicalDomain string
// Debug mode
Debug bool
// DataConfig provides alternative admin credentials from .dirio/config.json.
// Always populated when coming from the Starter (serve command).
DataConfig *data.ConfigData
// CLICredentialsExplicitlySet tracks whether AccessKey/SecretKey were
// explicitly provided (via env, flag, or config) vs using defaults.
CLICredentialsExplicitlySet bool
// ShutdownTimeout is how long to wait for in-flight requests to finish
// during graceful shutdown before connections are forcefully closed.
ShutdownTimeout time.Duration
// Pre-initialised components supplied by the Starter.
// Both fields are required; server.New does not construct them itself.
RootFS billy.Filesystem
Metadata *metadata.Manager
// Telemetry is the OTel provider. When non-nil the server registers the
// Prometheus metrics endpoint and adds the otelhttp middleware.
Telemetry *telemetry.Provider
}
Config holds server configuration.
type RouteDependencies ¶
type RouteDependencies struct {
APIHandler *api.Handler
// Modern Deps
Health health.RouteHandlers
Metrics metrics.RouteHandlers
Minio minioHTTP.RouteHandlers
Pprof prof.RouteHandlers
DirioAPI dirioapi.RouteHandlers
// contains filtered or unexported fields
}
RouteDependencies contains all dependencies needed for route handlers.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the S3-compatible HTTP server.
func New ¶
New creates a new Server from a fully-prepared Config.
The Config must carry RootFS and metadata from the Starter — server.New no longer constructs those itself, ensuring MinIO import and DataConfig finalisation have already completed before the HTTP layer is wired up.
func (*Server) ActiveRequests ¶
ActiveRequests returns the current number of in-flight requests. Exposed for debug endpoints and tests.
func (*Server) Auth ¶
func (s *Server) Auth() *auth.Authenticator
Auth returns the authenticator (used by the console wire file for admin credential validation).
func (*Server) InShutdown ¶
InShutdown reports whether the server has begun graceful shutdown.
func (*Server) PolicyEngine ¶
PolicyEngine returns the policy engine (used by the console wire file).
func (*Server) Router ¶
Router returns the S3 router (used by the console wire file for URL generation).
func (*Server) SetConsole ¶
SetConsole registers the console handler with the server. When port is 0 the console is mounted at /dirio/ui/ on the main port. When port is non-zero (e.g. 9001) a separate listener is started for the console. Must be called before Start.