Documentation
¶
Index ¶
Constants ¶
const ( ExitSuccess = iota ExitInvalidApikey ExitInvalidConfiguration ExitRedisInitializationFailed ExitErrorDB ExitTaskInitialization ExitAdminError ExitUndefined )
Exit codes
Variables ¶
var ErrShutdownAlreadyRegistered = errors.New("shutdown handler already scheduled")
ErrShutdownAlreadyRegistered is returned when trying to register the shutdown handler more than once
Functions ¶
This section is empty.
Types ¶
type InitializationError ¶
type InitializationError struct {
// contains filtered or unexported fields
}
InitializationError wraps an error and an exit code
func NewInitError ¶
func NewInitError(err error, exitCode int) *InitializationError
NewInitError constructs an initialization error
func (*InitializationError) Error ¶
func (e *InitializationError) Error() string
Error returns the string representation of the error causing the initialization failure
func (*InitializationError) ExitCode ¶
func (e *InitializationError) ExitCode() int
ExitCode is the number to return to the OS
type RuntimeImpl ¶
type RuntimeImpl struct {
// contains filtered or unexported fields
}
RuntimeImpl provides an implementation for the Runtime interface
func NewRuntime ¶
func NewRuntime( proxy bool, syncManager synchronizer.Manager, logger logging.LoggerInterface, dashboardTitle string, listener impressionlistener.ImpressionBulkListener, slackWriter *log.SlackWriter, appMonitor application.MonitorIterface, servicesMonitor services.MonitorIterface, ) *RuntimeImpl
NewRuntime constructs a RuntimeImpl object
func (*RuntimeImpl) Block ¶
func (r *RuntimeImpl) Block()
Block puts the current goroutine on hold until Shutdown is complete
func (*RuntimeImpl) Kill ¶
func (r *RuntimeImpl) Kill()
Kill sends a SIGKILL and aborts the app immediately
func (*RuntimeImpl) RegisterShutdownHandler ¶
func (r *RuntimeImpl) RegisterShutdownHandler() error
RegisterShutdownHandler installs a shutdown handler that will be triggered when a SIGTERM/SIGQUIT/SIGINT is received
func (*RuntimeImpl) Shutdown ¶
func (r *RuntimeImpl) Shutdown()
Shutdown stops sends a SIGTERM to the current process
func (*RuntimeImpl) Uptime ¶
func (r *RuntimeImpl) Uptime() time.Duration
Uptime returns how long the sync has been running