services

package
v0.3.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

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 Service

type Service interface {
	Name() string
	Serve() error
	Stop()
}

Service is a service that is registered with and run by a ServiceManager

type ServiceManager

type ServiceManager struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ServiceManager controls an arbitrary number of running services.

func NewServiceManager

func NewServiceManager() *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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL