Documentation
¶
Index ¶
- type AdminOpt
- func WithAdminCORSAllowOrigin(origin string) AdminOpt
- func WithAdminClientIPHeader(header string) AdminOpt
- func WithAdminConcurrencyLimiter(maxConnections, maxRequests int) AdminOpt
- func WithAdminDebug() AdminOpt
- func WithAdminPathPrefix(prefix string) AdminOpt
- func WithAdminQuiet() AdminOpt
- func WithAdminRoute(method, path string, handlers ...fiber.Handler) AdminOpt
- func WithAdminSocketPerm(perm os.FileMode) AdminOpt
- func WithAdminSrvTLS(cs *netutil.CertStorage) AdminOpt
- func WithAdminTrustedProxies(trusted utils.TrustedProxies) AdminOpt
- type Option
- func WithAdminServer() Option
- func WithAdminServerPathPrefix(prefix string) Option
- func WithCORSAllowOrigin(origin string) Option
- func WithClientIPHeader(header string) Option
- func WithConcurrencyLimiter(maxConnections, maxRequests int) Option
- func WithDisableACL() Option
- func WithDisableSSECTLS() Option
- func WithHealth(health string) Option
- func WithHostStyle(virtualDomain string) Option
- func WithKeepAlive() Option
- func WithMiddleware(prefix string, handler fiber.Handler) Option
- func WithMpMaxParts(n int) Option
- func WithOnListen(fn func()) Option
- func WithOnListenAddrs(fn func(addrs []net.Addr)) Option
- func WithQuiet() Option
- func WithReadOnly() Option
- func WithRoute(method, path string, handlers ...fiber.Handler) Option
- func WithSocketPerm(perm os.FileMode) Option
- func WithTLS(cs *netutil.CertStorage) Option
- func WithTrustedProxies(trusted utils.TrustedProxies) Option
- func WithWebUI(prefix string, cfg *webui.ServerConfig) Option
- type S3AdminRouter
- type S3AdminServer
- type S3ApiRouter
- type S3ApiServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminOpt ¶
type AdminOpt func(s *S3AdminServer)
func WithAdminCORSAllowOrigin ¶ added in v1.1.0
WithAdminCORSAllowOrigin sets the default CORS Access-Control-Allow-Origin value for the standalone admin server.
func WithAdminClientIPHeader ¶ added in v1.10.0
WithAdminClientIPHeader is WithClientIPHeader for the standalone admin server.
func WithAdminConcurrencyLimiter ¶ added in v1.3.0
WithAdminConcurrencyLimiter sets the admin standalone server's maximum connection limit and the hard limit for in-flight requests.
func WithAdminDebug ¶ added in v1.0.17
func WithAdminDebug() AdminOpt
WithAdminDebug enables the debug logging
func WithAdminPathPrefix ¶ added in v1.9.0
WithAdminPathPrefix mounts all admin routes under the given path prefix (e.g. "/admin").
func WithAdminQuiet ¶ added in v1.0.17
func WithAdminQuiet() AdminOpt
WithQuiet silences default logging output
func WithAdminRoute ¶ added in v1.9.0
WithAdminRoute registers a route on the standalone admin server, after the built-in admin routes and their middleware chain. Use it for admin-surface endpoints that do not fit the S3 admin controller shape.
func WithAdminSocketPerm ¶ added in v1.4.1
WithAdminSocketPerm sets the file-mode permissions applied to file-backed UNIX domain sockets after binding. It has no effect on TCP/IP or abstract namespace sockets.
func WithAdminSrvTLS ¶
func WithAdminSrvTLS(cs *netutil.CertStorage) AdminOpt
func WithAdminTrustedProxies ¶ added in v1.10.0
func WithAdminTrustedProxies(trusted utils.TrustedProxies) AdminOpt
WithAdminTrustedProxies sets the peers whose client IP header is trusted for the standalone admin server. It only has an effect together with WithAdminClientIPHeader.
type Option ¶
type Option func(*S3ApiServer)
Option sets various options for New()
func WithAdminServer ¶
func WithAdminServer() Option
WithAdminServer runs admin endpoints with the gateway in the same network
func WithAdminServerPathPrefix ¶ added in v1.9.0
WithAdminServerPathPrefix mounts the admin endpoints served with the gateway under the given path prefix (e.g. "/admin").
func WithCORSAllowOrigin ¶ added in v1.1.0
WithCORSAllowOrigin sets the default CORS Access-Control-Allow-Origin value. This is applied when no bucket CORS configuration exists, and for admin APIs.
func WithClientIPHeader ¶ added in v1.10.0
WithClientIPHeader records the client address from the named proxy header in the request log and the S3 access logs. The accepted values are utils.ClientIPHeaderForwardedFor and utils.ClientIPHeaderRealIP; an empty value (the default) keeps the socket peer address. The header is only honoured from a peer listed in WithTrustedProxies. ctx.IP() is not changed, so IAM aws:SourceIp conditions keep evaluating the socket address.
func WithConcurrencyLimiter ¶ added in v1.3.0
WithConcurrencyLimiter sets the server's maximum connection limit and the hard limit for in-flight requests.
func WithDisableACL ¶ added in v1.3.0
func WithDisableACL() Option
WithDisableACL disables the s3 api server ACLs, by ignoring all bucket/object ACL headers
func WithDisableSSECTLS ¶ added in v1.9.0
func WithDisableSSECTLS() Option
WithDisableSSECTLS disables the TLS requirement for SSE-C requests.
func WithHostStyle ¶ added in v1.0.14
WithHostStyle enabled host-style bucket addressing on the server
func WithKeepAlive ¶ added in v1.0.19
func WithKeepAlive() Option
WithKeepAlive enables the server keep alive
func WithMiddleware ¶ added in v1.5.0
WithMiddleware mounts a Fiber middleware after the gateway rate limiter and before the S3 route table is registered. The middleware must call ctx.Next() for requests it does not fully handle.
func WithMpMaxParts ¶ added in v1.4.0
WithMpMaxParts sets the maximum number of parts allowed in a multipart upload.
func WithOnListen ¶ added in v1.6.0
func WithOnListen(fn func()) Option
WithOnListen registers a callback that is invoked once the server is bound and ready to accept requests. It is called from the fiber OnListen hook, which fires immediately before the server begins serving the first connection. Use this instead of a fixed sleep to detect readiness reliably.
func WithOnListenAddrs ¶ added in v1.9.0
WithOnListenAddrs is WithOnListen with the addresses the server bound passed to the callback: one per listener, in the order of the port specifications given to ServeMultiPort, with a specification that resolves to several addresses contributing one each. This is how a caller that asked for port 0 learns which port the kernel chose; the server does not report it anywhere else.
func WithReadOnly ¶
func WithReadOnly() Option
func WithRoute ¶ added in v1.5.0
WithRoute registers a top-level Fiber route after the gateway rate limiter and before S3 routes are registered. Handlers are terminal unless they explicitly call ctx.Next().
func WithSocketPerm ¶ added in v1.4.1
WithSocketPerm sets the file-mode permissions applied to file-backed UNIX domain sockets after binding. It has no effect on TCP/IP or abstract namespace sockets.
func WithTrustedProxies ¶ added in v1.10.0
func WithTrustedProxies(trusted utils.TrustedProxies) Option
WithTrustedProxies sets the peers whose client IP header is trusted, as parsed by utils.ParseTrustedProxies. It only has an effect together with WithClientIPHeader.
type S3AdminRouter ¶
type S3AdminRouter struct {
// contains filtered or unexported fields
}
func (*S3AdminRouter) Init ¶
func (ar *S3AdminRouter) Init(app fiber.Router, be backend.Backend, iam auth.IAMService, logger s3log.AuditLogger, root middlewares.RootUserConfig, region string, debug bool, corsAllowOrigin string)
type S3AdminServer ¶
type S3AdminServer struct {
CertStorage *netutil.CertStorage
// contains filtered or unexported fields
}
func NewAdminServer ¶
func NewAdminServer(be backend.Backend, root middlewares.RootUserConfig, region string, iam auth.IAMService, l s3log.AuditLogger, ctrl controllers.S3ApiController, opts ...AdminOpt) *S3AdminServer
func (*S3AdminServer) ServeMultiPort ¶ added in v1.3.0
func (sa *S3AdminServer) ServeMultiPort(ports []string) error
ServeMultiPort creates listeners for multiple port specifications and serves on all of them simultaneously. This supports listening on multiple ports and/or addresses (e.g., [":8080", "localhost:8081"]).
func (S3AdminServer) Shutdown ¶ added in v1.0.19
func (sa S3AdminServer) Shutdown() error
ShutDown gracefully shuts down the server with a context timeout
type S3ApiRouter ¶
type S3ApiRouter struct {
WithAdmSrv bool
Ctrl controllers.S3ApiController
// contains filtered or unexported fields
}
func (*S3ApiRouter) Init ¶
func (sa *S3ApiRouter) Init()
type S3ApiServer ¶
type S3ApiServer struct {
Router *S3ApiRouter
CertStorage *netutil.CertStorage
// contains filtered or unexported fields
}
func New ¶
func New( be backend.Backend, root middlewares.RootUserConfig, region string, iam auth.IAMService, l s3log.AuditLogger, adminLogger s3log.AuditLogger, evs s3event.S3EventSender, mm metrics.Manager, opts ...Option, ) (*S3ApiServer, error)
func (*S3ApiServer) ServeMultiPort ¶ added in v1.3.0
func (sa *S3ApiServer) ServeMultiPort(ports []string) error
ServeMultiPort creates listeners for multiple port specifications and serves on all of them simultaneously. This supports listening on multiple ports and/or addresses (e.g., [":7070", "localhost:8080", "0.0.0.0:9090"]).
func (*S3ApiServer) ShutDown ¶ added in v1.0.19
func (sa *S3ApiServer) ShutDown() error
ShutDown gracefully shuts down the server with a context timeout