from enum import Enum

PING_MODULE = 'ping'
TRACE_MODULE = 'trace'
SPEEDTEST_MODULE = 'speedtest'
HTTP_MODULE = 'http'

MODULES = (PING_MODULE, TRACE_MODULE, SPEEDTEST_MODULE, HTTP_MODULE)

MODULE_LOOP_SUFFIX = '_module'
PING_MODULE_LOOP = PING_MODULE + MODULE_LOOP_SUFFIX
TRACE_MODULE_LOOP = TRACE_MODULE + MODULE_LOOP_SUFFIX
SPEEDTEST_MODULE_LOOP = SPEEDTEST_MODULE + MODULE_LOOP_SUFFIX
HTTP_MODULE_LOOP = HTTP_MODULE + MODULE_LOOP_SUFFIX
CONSUMER_LOOP = 'consumer'
SUBMITTER_LOOP = 'submitter'
PURGER_LOOP = 'purger'
COMMUNICATION_LOOP = 'communication'
HEARTBEAT_LOOP = 'heartbeat'
GUARD_LOOP = 'guard'
STATUS_LOOP = 'status'

LOOPS = (PING_MODULE_LOOP, TRACE_MODULE_LOOP, SPEEDTEST_MODULE_LOOP, HTTP_MODULE_LOOP,
         CONSUMER_LOOP, SUBMITTER_LOOP, PURGER_LOOP, COMMUNICATION_LOOP, HEARTBEAT_LOOP,
         GUARD_LOOP, STATUS_LOOP)

RELOAD_EVENT = 'reload'
RESTART_EVENT = 'restart'
REBOOT_EVENT = 'reboot'
UPGRADE_EVENT = 'upgrade'
HEARTBEAT_EVENT = 'heartbeat'


class ErrorSide(Enum):
    SERVER = 1
    CLIENT = 2
