jobserver

package
v0.0.0-...-daf4bef Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

GENERATED DO NOT EDIT GENERATOR: scripts/gencode/gencode.go ARGUMENTS: --component server --config ../../../../config/api.job.yml --package jobserver --out-dir . --out ./jobserver.gen.go --model-package github.com/adamlouis/squirrelbyte/server/pkg/model/jobmodel

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRouter

func RegisterRouter(apiHandler APIHandler, r *mux.Router, c ErrorCoder)

Types

type APIHandler

type APIHandler interface {
	ListJobs(ctx context.Context, queryParams *jobmodel.ListJobsQueryParams) (*jobmodel.ListJobsResponse, error)
	GetJob(ctx context.Context, pathParams *jobmodel.GetJobPathParams) (*jobmodel.Job, error)
	DeleteJob(ctx context.Context, pathParams *jobmodel.DeleteJobPathParams) error
	QueueJob(ctx context.Context, body *jobmodel.Job) (*jobmodel.Job, error)
	ClaimSomeJob(ctx context.Context, body *jobmodel.ClaimSomeJobRequest) (*jobmodel.Job, error)
	ClaimJob(ctx context.Context, pathParams *jobmodel.ClaimJobPathParams) (*jobmodel.Job, error)
	ReleaseJob(ctx context.Context, pathParams *jobmodel.ReleaseJobPathParams) (*jobmodel.Job, error)
	SetJobSuccess(ctx context.Context, pathParams *jobmodel.SetJobSuccessPathParams) (*jobmodel.Job, error)
	SetJobError(ctx context.Context, pathParams *jobmodel.SetJobErrorPathParams) (*jobmodel.Job, error)
}

func NewAPIHandler

func NewAPIHandler(db *sqlx.DB) APIHandler

type CommitFn

type CommitFn func() error

type ErrorCoder

type ErrorCoder func(e error) int

type HTTPHandler

type HTTPHandler interface {
	ListJobs(w http.ResponseWriter, req *http.Request)
	GetJob(w http.ResponseWriter, req *http.Request)
	DeleteJob(w http.ResponseWriter, req *http.Request)
	QueueJob(w http.ResponseWriter, req *http.Request)
	ClaimSomeJob(w http.ResponseWriter, req *http.Request)
	ClaimJob(w http.ResponseWriter, req *http.Request)
	ReleaseJob(w http.ResponseWriter, req *http.Request)
	SetJobSuccess(w http.ResponseWriter, req *http.Request)
	SetJobError(w http.ResponseWriter, req *http.Request)
}

type RollbackFn

type RollbackFn func() error

Jump to

Keyboard shortcuts

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