service

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2018 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbstractService

type AbstractService struct {
}

AbstractService implements an empty service

func (AbstractService) Init

func (AbstractService) Init() error

Init does nothing

func (AbstractService) Start

func (AbstractService) Start() error

Start does nothing

func (AbstractService) Stop

func (AbstractService) Stop() error

Stop does nothing

type CompositeService

type CompositeService struct {
	AbstractService
	Services []Service
}

CompositeService is a service that contains multiple child services

func (*CompositeService) AddService

func (s *CompositeService) AddService(ss Service)

AddService adds another service as the child service of this one

func (*CompositeService) Init

func (s *CompositeService) Init() error

Init initiates all child services

func (*CompositeService) Start

func (s *CompositeService) Start() error

Start starts all child services

func (*CompositeService) Stop

func (s *CompositeService) Stop() error

Stop stops all child services

type Service

type Service interface {
	// Init initiates the service
	Init() error
	// Start starts the service
	Start() error
	// Stop stops the service
	Stop() error
}

Service defines the lifecycle of a service

Jump to

Keyboard shortcuts

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