Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProfilingService ¶
type ProfilingService struct {
// contains filtered or unexported fields
}
ProfilingService is a service that returns profiling information via a HTTP server.
func NewProfilingService ¶
func NewProfilingService(address string) *ProfilingService
NewProfilingService creates a new ProfilingService instance bound to a specified address.
func (*ProfilingService) Name ¶
func (ps *ProfilingService) Name() string
Name returns a human-readable name for a ProfilingService.
func (*ProfilingService) Serve ¶
func (ps *ProfilingService) Serve() error
Serve runs a ProfilingService. It sets up the HTTP endpoint and services requests until the service is stopped. It runs on the calling Goroutine.
func (*ProfilingService) Stop ¶
func (ps *ProfilingService) Stop()
Stop stops a running ProfilingService.
type ServiceManager ¶
ServiceManager controls an arbitrary number of running services.
func NewServiceManager ¶
func NewServiceManager(options ...ServiceManagerOption) *ServiceManager
NewServiceManager creates a new ServiceManager instance.
func (*ServiceManager) RegisterService ¶
func (sm *ServiceManager) RegisterService(service Service)
RegisterService registers a Service for management with a ServiceManager.
func (*ServiceManager) Run ¶
func (sm *ServiceManager) Run()
Run starts and runs all services registered with a ServiceManager. This function does not return until the ServiceManager is stopped via Stop.
func (*ServiceManager) Stop ¶
func (sm *ServiceManager) Stop()
Stop stops a running ServiceManager. If the ServiceManager is not running, this function does nothing.
type ServiceManagerOption ¶
type ServiceManagerOption func(*serviceManagerOptions)
ServiceManagerOption represents options passed into the service manager constructor
func WithAllOrNothing ¶
func WithAllOrNothing() ServiceManagerOption
WithAllOrNothing specifies whether all services should exit upon a single service failure