Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
func Middleware(ctrl Controller) func(http.Handler) http.Handler
Middleware returns a standard net/http middleware that disables scale-to-zero at the start of each request and re-enables it after the handler completes. Connections from loopback addresses are ignored and do not affect the scale-to-zero state.
Types ¶
type Controller ¶
type Controller interface {
// Disable turns scale-to-zero off.
Disable(ctx context.Context) error
// Enable re-enables scale-to-zero after it has previously been disabled.
Enable(ctx context.Context) error
}
func NewDebouncedController ¶
func NewDebouncedController(ctrl Controller) Controller
func NewUnikraftCloudController ¶
func NewUnikraftCloudController() Controller
type DebouncedController ¶
type DebouncedController struct {
// contains filtered or unexported fields
}
type NoopController ¶
type NoopController struct{}
func NewNoopController ¶
func NewNoopController() *NoopController
Click to show internal directories.
Click to hide internal directories.