Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunService ¶
func RunService(ctx context.Context, s RunnerCloser) error
RunService runs the service and locks the thread while running given service.
Types ¶
type Runner ¶
type Runner interface {
Run() error
}
Runner is an interface used for the services which allows to runSub it.
type RunnerCloser ¶
RunnerCloser is the interface used as one of the service ports.
type Service ¶
type Service struct { RunWithoutRunners bool // contains filtered or unexported fields }
Service is an implementation of the service that allows to start and close ports and other RunnerCloser.
func (*Service) Start ¶
Start locks the thread and serves the service runners. The resultant channel closes when the service is finished.
func (*Service) With ¶
func (s *Service) With(sub RunnerCloser)
With sets the sub runner (port) that would be started and closed along with the service.
func (*Service) WithCloser ¶
WithCloser adds the closer to the given service, which would be closed along with the service.
type Starter ¶ added in v0.0.4
Starter is an interface used for the services that starts and blocks it's thread.
type Transactioner ¶
Transactioner is an interface used as a transaction base, responsible for committing and rolling back the transaction.