Documentation ¶
Overview ¶
Package sentinel provides a sentinel run group manager.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IgnoreError ¶
IgnoreError returns a func that returns true when passed errors match.
func IgnoreNetOpError ¶
IgnoreNetOpError returns true when the passed error is a net.OpError with error "use of closed network connection".
func IgnoreServerClosed ¶
IgnoreServerClosed returns true when the passed error is the http.ErrServerClosed error.
Types ¶
type Logger ¶ added in v1.0.0
type Logger interface{}
Logger is a logger interface.
Allowed types:
func(string, ...interface{}) func(string, ...interface{}) error func(string)
interface { Printf(string, ...interface{}) }
type Manager ¶ added in v1.0.0
type Manager struct {
// contains filtered or unexported fields
}
Manager is a sentinel run manager holding the specific start and shutdown funcs for a sentinel.
type Sentinel ¶
Sentinel is a sentinel run group manager.
func WithContext ¶ added in v1.0.1
WithContext creates a new sentinel run group manager.
func (*Sentinel) Manage ¶ added in v1.0.0
Manage creates and registers a manager to the sentinel for the provided start and shutdown funcs, adding any error ignores funcs to the run group.
func (*Sentinel) ManageHTTP ¶ added in v1.0.0
func (s *Sentinel) ManageHTTP(listener net.Listener, handler http.Handler, opts ...func(*http.Server) error) error
ManageHTTP creates and registers a manager for a HTTP server for the specified listener and handler, and registers the created HTTP server, its shutdown, and related ignore funcs (IgnoreServerClosed, IgnoreNetOpError) with the server sentinel group.