tracking

package
v0.0.0-...-5983c14 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyStartedOrNotFound = errors.New("task already started or not found")
	ErrNotStartedOrNotFound     = errors.New("task not started or not found")
)

Functions

This section is empty.

Types

type Handler

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

func NewHandler

func NewHandler(service Service) *Handler

func (*Handler) PostTasksIdStart

func (h *Handler) PostTasksIdStart(w http.ResponseWriter, r *http.Request, id int)

PostTasksIdStart handles "POST /tasks/{id}/start".

func (*Handler) PostTasksIdStop

func (h *Handler) PostTasksIdStop(w http.ResponseWriter, r *http.Request, id int)

PostTasksIdStop handles "POST /tasks/{id}/stop".

type Service

type Service interface {
	StartTask(ctx context.Context, taskID TaskID, userID UserID) error
	StopTask(ctx context.Context, taskID TaskID, userID UserID) error
}

type ServiceImpl

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

func NewServiceImpl

func NewServiceImpl(db database.DB) *ServiceImpl

func (*ServiceImpl) StartTask

func (s *ServiceImpl) StartTask(ctx context.Context, taskID TaskID, userID UserID) error

func (*ServiceImpl) StopTask

func (s *ServiceImpl) StopTask(ctx context.Context, taskID TaskID, userID UserID) error

type TaskID

type TaskID int

type UserID

type UserID int

Jump to

Keyboard shortcuts

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