Documentation ¶
Index ¶
- func Drop()
- func HasMinAlertFields(strategy string, endpoint string, method string) bool
- func NewStorage(cfg *config.Configs) (Storage, Closer)
- func Seed()
- type APIStorage
- type Closer
- type CreateJobInput
- type JobUpdates
- type SQLStorage
- func (sqls *SQLStorage) Connected() bool
- func (sqls *SQLStorage) CreateJob(j CreateJobInput) error
- func (sqls *SQLStorage) GetAvailableJobs(limit int) []*job.Job
- func (sqls *SQLStorage) GetClaimedJobs(limit int, offset int) []*job.Job
- func (sqls *SQLStorage) GetClaimedJobsExecutions(jobId uuid.UUID, limit int, offset int) []*job.JobExecution
- func (sqls *SQLStorage) GetClient() *pgxpool.Pool
- func (s *SQLStorage) GetJobUpdates(jobId uuid.UUID) *JobUpdates
- func (sqls *SQLStorage) GetSSLVersion() (bool, string)
- func (s *SQLStorage) ListenForChanges(jobIDUpdatedCh chan uuid.UUID, ctx context.Context)
- func (sqls *SQLStorage) RegisterSelf()
- func (sqls *SQLStorage) ReleaseAll(j []*job.Job) error
- func (s *SQLStorage) StopListeningForChanges() error
- func (sqls *SQLStorage) UpdateJob(j UpdateJobInput) error
- func (sqls *SQLStorage) WriteDone(j *job.Job) error
- type SchedulerStorage
- type Storage
- type UpdateJobInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasMinAlertFields ¶
Types ¶
type APIStorage ¶
type CreateJobInput ¶
type CreateJobInput struct { Name string `json:"name"` CronExpString string `json:"cronexp"` MaxRetries int `json:"maxRetries"` Endpoint string `json:"endpoint"` HttpMethod string `json:"httpmethod"` Headers map[string]string `json:"headers"` SuccessStatuses []int `json:"successStatuses"` AlertStrategy string `json:"alertStrategy"` AlertMethod string `json:"alertMethod"` AlertEndpoint string `json:"alertEndpoint"` AlertPayload string `json:"alertPayload"` AlertHeaders map[string]string `json:"alertHeaders"` }
type JobUpdates ¶
type SQLStorage ¶
func (*SQLStorage) Connected ¶
func (sqls *SQLStorage) Connected() bool
func (*SQLStorage) CreateJob ¶
func (sqls *SQLStorage) CreateJob(j CreateJobInput) error
func (*SQLStorage) GetAvailableJobs ¶
func (sqls *SQLStorage) GetAvailableJobs(limit int) []*job.Job
Gets pending to be claimed jobs from the db and returns a list of all jobs that could be claimed
func (*SQLStorage) GetClaimedJobs ¶
func (sqls *SQLStorage) GetClaimedJobs(limit int, offset int) []*job.Job
Gets get jobs claimed by this instance
func (*SQLStorage) GetClaimedJobsExecutions ¶
func (sqls *SQLStorage) GetClaimedJobsExecutions(jobId uuid.UUID, limit int, offset int) []*job.JobExecution
Gets get jobs claimed by this instance
func (*SQLStorage) GetClient ¶
func (sqls *SQLStorage) GetClient() *pgxpool.Pool
Returns the raw client
func (*SQLStorage) GetJobUpdates ¶
func (s *SQLStorage) GetJobUpdates(jobId uuid.UUID) *JobUpdates
func (*SQLStorage) GetSSLVersion ¶
func (sqls *SQLStorage) GetSSLVersion() (bool, string)
Writes an execution result in the db
func (*SQLStorage) ListenForChanges ¶
func (s *SQLStorage) ListenForChanges(jobIDUpdatedCh chan uuid.UUID, ctx context.Context)
Creates a gorutine that waits for messages in a loop and sends them over "jobIDUpdatedCh".
It will block until the waiting loop starts
func (*SQLStorage) RegisterSelf ¶
func (sqls *SQLStorage) RegisterSelf()
Should register the url, name of the application and so on in the db
func (*SQLStorage) ReleaseAll ¶
func (sqls *SQLStorage) ReleaseAll(j []*job.Job) error
Writes an execution result in the db
func (*SQLStorage) StopListeningForChanges ¶
func (s *SQLStorage) StopListeningForChanges() error
func (*SQLStorage) UpdateJob ¶
func (sqls *SQLStorage) UpdateJob(j UpdateJobInput) error
type SchedulerStorage ¶
type SchedulerStorage interface { ListenForChanges(ch chan uuid.UUID, ctx context.Context) StopListeningForChanges() error GetJobUpdates(jobId uuid.UUID) *JobUpdates GetAvailableJobs(limit int) []*job.Job WriteDone(*job.Job) error RegisterSelf() GetClient() *pgxpool.Pool ReleaseAll(j []*job.Job) error }
type Storage ¶
type Storage interface { SchedulerStorage APIStorage }
An interface that should help to describe what the Storage is doing
type UpdateJobInput ¶
type UpdateJobInput struct { Id uuid.UUID `json:"id"` Name string `json:"name"` CronExpString string `json:"cronexp"` MaxRetries int `json:"maxRetries"` Endpoint string `json:"endpoint"` HttpMethod string `json:"httpmethod"` Headers map[string]string `json:"headers"` SuccessStatuses []int `json:"successStatuses"` AlertStrategy string `json:"alertStrategy"` AlertMethod string `json:"alertMethod"` AlertEndpoint string `json:"alertEndpoint"` AlertPayload string `json:"alertPayload"` AlertHeaders map[string]string `json:"alertHeaders"` }
Click to show internal directories.
Click to hide internal directories.