scheduler

package
v0.0.0-...-8eba3d0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ItemCallback

type ItemCallback func(ctx context.Context, item QueuedItem) error

ItemCallback is the type of the callback functions

type QueuedItem

type QueuedItem struct {
	Collection string `json:"collection"`
	ID         string `json:"id"`
}

QueuedItem contains basic data

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service contains the base url for the endpoints

func New

func New(endpoint string, queueID string) *Service

New returns a new Service

func (*Service) HandleRequest

func (s *Service) HandleRequest(ctx *gin.Context) []error

HandleRequest handles the request after it has been returned

func (*Service) OnRequest

func (s *Service) OnRequest(callback ItemCallback)

OnRequest register a callback to trigger when the task is returned

func (*Service) Queue

func (s *Service) Queue(ctx context.Context, collection string, id string, at time.Time) error

Queue a specific message

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL