Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseService ¶
BaseService provides a basic implementation of the Service interface.
func NewBaseService ¶
func NewBaseService(logger zerolog.Logger, name string, impl Service) *BaseService
NewBaseService creates a new BaseService. The provided implementation (impl) should be the "subclass" that implements Run.
func (*BaseService) Run ¶
func (bs *BaseService) Run(ctx context.Context) error
Run implements the Service interface. It logs the start of the service, then defers to the implementation's Run method to do the actual work. If impl is nil or the same as bs, it uses the default implementation.
func (*BaseService) SetLogger ¶
func (bs *BaseService) SetLogger(l zerolog.Logger)
SetLogger sets the logger.
func (*BaseService) String ¶
func (bs *BaseService) String() string
String returns the service name.
Click to show internal directories.
Click to hide internal directories.