Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Up ¶
Up manages the lifecycle of a service. It blocks until the service shuts down or the service.Start() method returns. It listens to specific signals and gracefully shut down the service when any of these signals are received:
syscall.SIGINT syscall.SIGTERM syscall.SIGQUIT syscall.SIGABRT
It exits with a non-zero status code if an error occurs during either the startup or shutdown process.
Types ¶
type Service ¶
type Service interface { // Start should initiate the startup of the service. // It returns an error if the startup process encounters any issues. Start() error // Stop should initiate the shutdown of the service. // It returns an error if the shutdown process encounters any issues. Stop() error }
Service represents a generic service that goarc framework can Start and Stop.
type ServiceFunc ¶ added in v0.9.0
ServiceFunc serves as an adapter, enabling the utilization of regular functions as goarc services. If f is a function with the correct signature, ServiceFunc(f) creates a Service that invokes f. The function f receives a boolean parameter indicating whether it's invoked as Start (true) or Stop (false).