inmemory

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Service represents in-memory service for store information about background jobs.

func New

func New() *Service

New creates new in-memory jobs service.

func (*Service) Get

func (s *Service) Get(_ context.Context, id string) (background.Job, error)

Get retrieves job information by job ID.

func (*Service) JobCompleted

func (s *Service) JobCompleted(
	_ context.Context,
	id string,
	response background.Response,
) error

JobCompleted saves that background job is completed.

func (*Service) JobStarted

func (s *Service) JobStarted(
	_ context.Context,
	kind string,
) (background.Job, error)

JobStarted saves initial information about new background job.

func (*Service) Jobs

func (s *Service) Jobs() ([]background.Job, error)

Jobs retrieves all jobs.

func (*Service) Ping

func (s *Service) Ping(_ context.Context, id string) error

Jobs sets that job is working.

Jump to

Keyboard shortcuts

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