Documentation ¶
Index ¶
- Variables
- type CollectionsInterface
- type EventError
- type EventHandlerInterface
- type Level
- type MeasurementEvent
- type MetricType
- type MonitoringInterface
- type PreloadingServiceInterface
- type RepositoryInterface
- type SenderServiceInterface
- type TaskManagerInterface
- type TaskToSendInterface
- type Topic
- type TriggerHookInterface
- type WaitingServiceInterface
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TmErrorCreatingTasks = errors.New("cannot create task") TmErrorUuidIsNotCorrect = errors.New("uuid of the task is not correct") TmErrorTaskExist = errors.New("task with this uuid already exist") TmErrorConfirmationTasks = errors.New("cannot confirm execution of tasks") TmErrorGetTasks = errors.New("cannot get any tasks") TmErrorCollectionsNotFound = errors.New("collections not found") TmErrorDeletingTask = errors.New("cannot delete task") TmErrorTaskNotFound = errors.New("task not found") )
View Source
var ( RepoErrorCountingTasks = errors.New("counting the task was fail") RepoErrorCreatingTask = errors.New("creating the task was fail") RepoErrorDeletingTask = errors.New("deleting the task was fail") RepoErrorGettingTasks = errors.New("getting the tasks were fail") RepoErrorFindingTasks = errors.New("finding the tasks were fail") RepoErrorNoTasksFound = errors.New("no tasks found") RepoErrorNoCollections = errors.New("collections are over") RepoErrorTaskExist = errors.New("task with the uuid already exist") RepoErrorDeadlock = errors.New("deadlock, please retry") RepoErrorLockWaitTimeout = errors.New("lock wait timeout exceeded") RepoErrorSchemaSetup = errors.New("schema setup failed") )
View Source
var ( MonitoringErrorTopicIsNotInitialized = errors.New("the topic is not initialized") MonitoringErrorTopicExist = errors.New("the topic exist") )
Functions ¶
This section is empty.
Types ¶
type CollectionsInterface ¶
type EventError ¶
type EventHandlerInterface ¶
type MeasurementEvent ¶
type MetricType ¶
type MetricType int
const ( /* Measures the value at regular intervals */ ValueMetricType MetricType = iota /* Measures the number of elements in a time period */ VelocityMetricType /* Summarizes the measured values. Does not depend on the measurement period */ IntegralMetricType )
type MonitoringInterface ¶
type MonitoringInterface interface { /* Init measurement */ Init(topic Topic, metricType MetricType) error /* Publishing measurement events */ Publish(topic Topic, measurement int64) error /* Listening to the measurement with periodMeasure */ Listen(topic Topic, callback func() int64) error /* Launch monitoring */ Run() }
type PreloadingServiceInterface ¶
type PreloadingServiceInterface interface { AddNewTask(ctx context.Context, task *domain.Task) error GetPreloadedChan() <-chan domain.Task Run() }
-------------------------------------------------- Preloading task service
type RepositoryInterface ¶
type RepositoryInterface interface { Create(ctx context.Context, task domain.Task, isTaken bool) error Delete(ctx context.Context, tasks []domain.Task) (int64, error) FindBySecToExecTime(ctx context.Context, preloadingTimeRange time.Duration) (CollectionsInterface, error) Up() error Count() (int, error) }
-------------------------------------------------- Repository
type SenderServiceInterface ¶
type SenderServiceInterface interface { Run() Consume() TaskToSendInterface }
type TaskManagerInterface ¶
type TaskManagerInterface interface { Create(ctx context.Context, task *domain.Task, isTaken bool) error Delete(ctx context.Context, taskId string) error GetTasksToComplete(ctx context.Context, preloadingTimeRange time.Duration) (CollectionsInterface, error) ConfirmExecution(ctx context.Context, task []domain.Task) error }
-------------------------------------------------- Task manager
type TaskToSendInterface ¶
type Topic ¶
type Topic string
var ( /* Number of tasks waiting for confirmation after sending */ WaitingForConfirmation Topic = "waiting_for_confirmation" /* The rate of confirmation of the sending task */ ConfirmationRate Topic = "confirmation_rate" /* Number of preloaded tasks */ Preloaded Topic = "preloaded" /* Speed of preloading */ PreloadingRate Topic = "preloading_rate" /* Deprecated Number of tasks waiting for sending */ WaitingForSending Topic = "waiting_for_sending" CreatingRate Topic = "creating_rate" DeletingRate Topic = "deleting_rate" SendingRate Topic = "sending_rate" /* Number of all tasks */ All Topic = "all" )
type TriggerHookInterface ¶
type TriggerHookInterface interface { // Deprecated Create(task *domain.Task) error // Deprecated Delete(taskId string) error CreateCtx(ctx context.Context, task *domain.Task) error DeleteCtx(ctx context.Context, taskId string) error Consume() TaskToSendInterface /* LAUNCHER TRIGGER HOOK :) !!! */ Run() error }
Click to show internal directories.
Click to hide internal directories.