Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a struct that holds registered middlewares and provides methods to run these middlewares on an HTTP handler.
type HandlerFunc ¶
HandlerFunc is a type alias for a function that takes an http.Handler and returns a new http.Handler.
type Middleware ¶
type Middleware interface {
Handler(logger log.Logger) HandlerFunc
}
Middleware is an interface representing a middleware with a Handler method.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is a struct that holds a list of registered middlewares.
func GetRegistry ¶
func GetRegistry() *Registry
GetRegistry returns a singleton instance of the Registry.
func (*Registry) GetRegistered ¶
func (r *Registry) GetRegistered() []Middleware
GetRegistered returns a list of registered middlewares.
func (*Registry) Register ¶
func (r *Registry) Register(m Middleware)
Register adds a Middleware to the list of registered middlewares in the Registry.
type StatusMiddleware ¶
type StatusMiddleware struct {
// contains filtered or unexported fields
}
StatusMiddleware is a struct that holds the health status of the node.
func NewStatusMiddleware ¶
func NewStatusMiddleware(healthStatus *sharedtypes.HealthStatus) *StatusMiddleware
NewStatusMiddleware creates and returns a new Status instance with the given healthStatus.
func (*StatusMiddleware) Handler ¶
func (s *StatusMiddleware) Handler(logger log.Logger) HandlerFunc
Handler returns a MiddlewareFunc that checks the node's health status.