Documentation
¶
Index ¶
- type AssignUnassignedWorkParams
- type ChangeOccurenceStatusParams
- type CreateHistoryParams
- type CreateOccurenceParams
- type CreateScheduleParams
- type DBTX
- type History
- type ListHistoryParams
- type ListHistoryRow
- type ListSchedulesParams
- type ListSchedulesRow
- type ListWorkersParams
- type NextOccurence
- type NullStatus
- type PunchCard
- type Querier
- type Queries
- func (q *Queries) AssignUnassignedWork(ctx context.Context, arg AssignUnassignedWorkParams) error
- func (q *Queries) ChangeOccurenceStatus(ctx context.Context, arg ChangeOccurenceStatusParams) error
- func (q *Queries) CreateHistory(ctx context.Context, arg CreateHistoryParams) (History, error)
- func (q *Queries) CreateOccurence(ctx context.Context, arg CreateOccurenceParams) (NextOccurence, error)
- func (q *Queries) CreateSchedule(ctx context.Context, arg CreateScheduleParams) (Schedule, error)
- func (q *Queries) CreateWorker(ctx context.Context, id uuid.UUID) (PunchCard, error)
- func (q *Queries) DeleteOccurence(ctx context.Context, id int32) error
- func (q *Queries) DeleteSchedule(ctx context.Context, id uuid.UUID) error
- func (q *Queries) DeleteWorker(ctx context.Context, id uuid.UUID) error
- func (q *Queries) GetNextImmediateWork(ctx context.Context, worker uuid.NullUUID) (time.Time, error)
- func (q *Queries) GetOccurence(ctx context.Context, id int32) (NextOccurence, error)
- func (q *Queries) GetSchedule(ctx context.Context, id uuid.UUID) (Schedule, error)
- func (q *Queries) GetWorker(ctx context.Context, id uuid.UUID) (PunchCard, error)
- func (q *Queries) ListHistory(ctx context.Context, arg ListHistoryParams) ([]ListHistoryRow, error)
- func (q *Queries) ListSchedules(ctx context.Context, arg ListSchedulesParams) ([]ListSchedulesRow, error)
- func (q *Queries) ListWorkers(ctx context.Context, arg ListWorkersParams) ([]PunchCard, error)
- func (q *Queries) MyExpiredWork(ctx context.Context, worker uuid.NullUUID) ([]NextOccurence, error)
- func (q *Queries) ProveLiveliness(ctx context.Context, id uuid.UUID) error
- func (q *Queries) RemoveDeadWorkers(ctx context.Context) error
- func (q *Queries) UpdateSchedule(ctx context.Context, arg UpdateScheduleParams) (Schedule, error)
- func (q *Queries) UpdateStatusAndDetails(ctx context.Context, arg UpdateStatusAndDetailsParams) (History, error)
- func (q *Queries) ValidSchedulesWithoutOccurence(ctx context.Context) ([]Schedule, error)
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type SQLStore
- func (store *SQLStore) Close() error
- func (store *SQLStore) CreateScheduleAddNextOccurence(ctx context.Context, scheduleParams CreateScheduleParams, ...) (Schedule, error)
- func (store *SQLStore) UpdateHistoryAndDeleteOccurence(ctx context.Context, params UpdateHistoryAndDeleteOccurenceParams) error
- func (store *SQLStore) UpdateHistoryAndOccurence(ctx context.Context, schedule Schedule, occurence NextOccurence) error
- type Schedule
- type Status
- type Store
- type UpdateHistoryAndDeleteOccurenceParams
- type UpdateScheduleParams
- type UpdateStatusAndDetailsParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateHistoryParams ¶
type CreateHistoryParams struct { OccurenceID int32 `json:"occurence_id"` Schedule uuid.UUID `json:"schedule"` Status Status `json:"status"` Details string `json:"details"` Manual bool `json:"manual"` ScheduledAt time.Time `json:"scheduled_at"` StartedAt time.Time `json:"started_at"` CompletedAt time.Time `json:"completed_at"` }
type CreateOccurenceParams ¶
type CreateScheduleParams ¶
type History ¶
type History struct { OccurenceID int32 `json:"occurence_id"` Schedule uuid.UUID `json:"schedule"` Status Status `json:"status"` Details string `json:"details"` Manual bool `json:"manual"` ScheduledAt time.Time `json:"scheduled_at"` StartedAt time.Time `json:"started_at"` CompletedAt time.Time `json:"completed_at"` }
type ListHistoryParams ¶
type ListHistoryRow ¶
type ListHistoryRow struct { OccurenceID int32 `json:"occurence_id"` Schedule uuid.UUID `json:"schedule"` Status Status `json:"status"` Details string `json:"details"` Manual bool `json:"manual"` ScheduledAt time.Time `json:"scheduled_at"` StartedAt time.Time `json:"started_at"` CompletedAt time.Time `json:"completed_at"` TotalRecords int64 `json:"-"` }
type ListSchedulesParams ¶
type ListSchedulesRow ¶
type ListSchedulesRow struct { ID uuid.UUID `json:"id"` Cron string `json:"cron"` Hook string `json:"hook"` Owner string `json:"owner"` Data string `json:"data"` Active bool `json:"active"` Till time.Time `json:"till"` CreatedAt time.Time `json:"created_at"` LastModified time.Time `json:"last_modified"` TotalRecords int64 `json:"total_records"` }
type ListWorkersParams ¶
type NextOccurence ¶
type NullStatus ¶
func (*NullStatus) Scan ¶
func (ns *NullStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type Querier ¶
type Querier interface { AssignUnassignedWork(ctx context.Context, arg AssignUnassignedWorkParams) error ChangeOccurenceStatus(ctx context.Context, arg ChangeOccurenceStatusParams) error CreateHistory(ctx context.Context, arg CreateHistoryParams) (History, error) CreateOccurence(ctx context.Context, arg CreateOccurenceParams) (NextOccurence, error) CreateSchedule(ctx context.Context, arg CreateScheduleParams) (Schedule, error) CreateWorker(ctx context.Context, id uuid.UUID) (PunchCard, error) DeleteOccurence(ctx context.Context, id int32) error DeleteSchedule(ctx context.Context, id uuid.UUID) error DeleteWorker(ctx context.Context, id uuid.UUID) error GetNextImmediateWork(ctx context.Context, worker uuid.NullUUID) (time.Time, error) GetOccurence(ctx context.Context, id int32) (NextOccurence, error) GetSchedule(ctx context.Context, id uuid.UUID) (Schedule, error) GetWorker(ctx context.Context, id uuid.UUID) (PunchCard, error) ListHistory(ctx context.Context, arg ListHistoryParams) ([]ListHistoryRow, error) ListSchedules(ctx context.Context, arg ListSchedulesParams) ([]ListSchedulesRow, error) ListWorkers(ctx context.Context, arg ListWorkersParams) ([]PunchCard, error) MyExpiredWork(ctx context.Context, worker uuid.NullUUID) ([]NextOccurence, error) ProveLiveliness(ctx context.Context, id uuid.UUID) error RemoveDeadWorkers(ctx context.Context) error UpdateSchedule(ctx context.Context, arg UpdateScheduleParams) (Schedule, error) UpdateStatusAndDetails(ctx context.Context, arg UpdateStatusAndDetailsParams) (History, error) ValidSchedulesWithoutOccurence(ctx context.Context) ([]Schedule, error) }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) AssignUnassignedWork ¶
func (q *Queries) AssignUnassignedWork(ctx context.Context, arg AssignUnassignedWorkParams) error
func (*Queries) ChangeOccurenceStatus ¶
func (q *Queries) ChangeOccurenceStatus(ctx context.Context, arg ChangeOccurenceStatusParams) error
func (*Queries) CreateHistory ¶
func (*Queries) CreateOccurence ¶
func (q *Queries) CreateOccurence(ctx context.Context, arg CreateOccurenceParams) (NextOccurence, error)
func (*Queries) CreateSchedule ¶
func (*Queries) CreateWorker ¶
func (*Queries) DeleteOccurence ¶
func (*Queries) DeleteSchedule ¶
func (*Queries) DeleteWorker ¶
func (*Queries) GetNextImmediateWork ¶
func (*Queries) GetOccurence ¶
func (*Queries) GetSchedule ¶
func (*Queries) ListHistory ¶
func (q *Queries) ListHistory(ctx context.Context, arg ListHistoryParams) ([]ListHistoryRow, error)
func (*Queries) ListSchedules ¶
func (q *Queries) ListSchedules(ctx context.Context, arg ListSchedulesParams) ([]ListSchedulesRow, error)
func (*Queries) ListWorkers ¶
func (*Queries) MyExpiredWork ¶
func (*Queries) ProveLiveliness ¶
func (*Queries) UpdateSchedule ¶
func (*Queries) UpdateStatusAndDetails ¶
func (*Queries) ValidSchedulesWithoutOccurence ¶
type SQLStore ¶
type SQLStore struct { *Queries // contains filtered or unexported fields }
store provides all functions to execute db queries and transactions.
func (*SQLStore) CreateScheduleAddNextOccurence ¶
func (store *SQLStore) CreateScheduleAddNextOccurence(ctx context.Context, scheduleParams CreateScheduleParams, occurenceParams CreateOccurenceParams) (Schedule, error)
func (*SQLStore) UpdateHistoryAndDeleteOccurence ¶
func (store *SQLStore) UpdateHistoryAndDeleteOccurence(ctx context.Context, params UpdateHistoryAndDeleteOccurenceParams) error
func (*SQLStore) UpdateHistoryAndOccurence ¶
type Schedule ¶
type Schedule struct { ID uuid.UUID `json:"id"` Cron string `json:"cron"` Hook string `json:"hook"` Owner string `json:"owner"` Data string `json:"data"` Active bool `json:"active"` // till what timestamp this schedule will run Till time.Time `json:"till"` CreatedAt time.Time `json:"created_at"` LastModified time.Time `json:"last_modified"` }
type Store ¶
type Store interface { Querier UpdateHistoryAndOccurence(ctx context.Context, schedule Schedule, occurence NextOccurence) error UpdateHistoryAndDeleteOccurence(ctx context.Context, params UpdateHistoryAndDeleteOccurenceParams) error CreateScheduleAddNextOccurence(ctx context.Context, schedule CreateScheduleParams, occurence CreateOccurenceParams) (Schedule, error) Close() error }
type UpdateHistoryAndDeleteOccurenceParams ¶
type UpdateHistoryAndDeleteOccurenceParams struct { Schedule Schedule Occurence NextOccurence Details string Status Status }
type UpdateScheduleParams ¶
Click to show internal directories.
Click to hide internal directories.