Documentation ¶
Index ¶
- func HealthCheckStatusStrings() []string
- func RunService(ctx context.Context, s RunnerCloser) error
- type Closer
- type HealthCheckStatus
- type Runner
- type RunnerCloser
- type Service
- func (s *Service) Close(ctx context.Context) error
- func (s *Service) Error() error
- func (s *Service) Run() error
- func (s *Service) Start(ctx context.Context) <-chan struct{}
- func (s *Service) With(sub RunnerCloser)
- func (s *Service) WithCleanupFunc(cleanupFunc func())
- func (s *Service) WithCloser(closer Closer)
- type Starter
- type Transactioner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HealthCheckStatusStrings ¶ added in v0.0.28
func HealthCheckStatusStrings() []string
HealthCheckStatusStrings returns a slice of all String values of the enum
func RunService ¶
func RunService(ctx context.Context, s RunnerCloser) error
RunService runs the service and locks the thread while running given service.
Types ¶
type HealthCheckStatus ¶ added in v0.0.28
type HealthCheckStatus int
HealthCheckStatus gets the status of the health check.
const ( HealthCheckStatusUnknown HealthCheckStatus = iota HealthCheckStatusServing HealthCheckStatusNotServing HealthCheckStatusServiceUnknown )
Health check predefined statuses.
func HealthCheckStatusString ¶ added in v0.0.28
func HealthCheckStatusString(s string) (HealthCheckStatus, error)
HealthCheckStatusString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func HealthCheckStatusValues ¶ added in v0.0.28
func HealthCheckStatusValues() []HealthCheckStatus
HealthCheckStatusValues returns all values of the enum
func (HealthCheckStatus) IsAHealthCheckStatus ¶ added in v0.0.28
func (i HealthCheckStatus) IsAHealthCheckStatus() bool
IsAHealthCheckStatus returns "true" if the value is listed in the enum definition. "false" otherwise
func (HealthCheckStatus) MarshalText ¶ added in v0.0.28
func (i HealthCheckStatus) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface for HealthCheckStatus
func (HealthCheckStatus) String ¶ added in v0.0.28
func (i HealthCheckStatus) String() string
func (*HealthCheckStatus) UnmarshalText ¶ added in v0.0.28
func (i *HealthCheckStatus) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface for HealthCheckStatus
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) WithCleanupFunc ¶ added in v0.1.0
func (s *Service) WithCleanupFunc(cleanupFunc func())
WithCleanupFunc adds the cleanup function to the list of service closers.
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.