apiserver

package
v0.0.0-...-5222202 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

GENERATED DO NOT EDIT GENERATOR: scripts/gencode/gencode.go ARGUMENTS: --component server --config ../../api/api.yml --package apiserver --out-dir ./ --out ./apiserver.gen.go --model-package github.com/adamlouis/goq/pkg/goqmodel

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetErrorCode

func GetErrorCode(err error) int

func RegisterRouter

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

Types

type APIHandler

type APIHandler interface {
	ListJobs(ctx context.Context, queryParams *goqmodel.ListJobsQueryParams) (*goqmodel.ListJobsResponse, error)
	SearchJobs(ctx context.Context, body *goqmodel.SearchJobsRequest) (*goqmodel.SearchJobsResponse, error)
	GetJob(ctx context.Context, pathParams *goqmodel.GetJobPathParams) (*goqmodel.Job, error)
	DeleteJob(ctx context.Context, pathParams *goqmodel.DeleteJobPathParams) error
	QueueJob(ctx context.Context, body *goqmodel.Job) (*goqmodel.Job, error)
	ClaimSomeJob(ctx context.Context, body *goqmodel.ClaimSomeJobRequest) (*goqmodel.Job, error)
	ClaimJob(ctx context.Context, pathParams *goqmodel.ClaimJobPathParams) (*goqmodel.Job, error)
	ReleaseJob(ctx context.Context, pathParams *goqmodel.ReleaseJobPathParams) (*goqmodel.Job, error)
	SetJobSuccess(ctx context.Context, pathParams *goqmodel.SetJobSuccessPathParams, body *goqmodel.Job) (*goqmodel.Job, error)
	SetJobError(ctx context.Context, pathParams *goqmodel.SetJobErrorPathParams, body *goqmodel.Job) (*goqmodel.Job, error)
	ListSchedulers(ctx context.Context, queryParams *goqmodel.ListSchedulersRequest) (*goqmodel.ListSchedulersResponse, error)
	PostScheduler(ctx context.Context, body *goqmodel.Scheduler) (*goqmodel.Scheduler, error)
	GetScheduler(ctx context.Context, pathParams *goqmodel.GetSchedulerPathParams) (*goqmodel.Scheduler, error)
	PutScheduler(ctx context.Context, pathParams *goqmodel.PutSchedulerPathParams, body *goqmodel.Scheduler) (*goqmodel.Scheduler, error)
	DeleteScheduler(ctx context.Context, pathParams *goqmodel.DeleteSchedulerPathParams) error
}

func NewAPIHandler

func NewAPIHandler(ctx context.Context, jobDB, schedulerDB *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)
	SearchJobs(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)
	ListSchedulers(w http.ResponseWriter, req *http.Request)
	PostScheduler(w http.ResponseWriter, req *http.Request)
	GetScheduler(w http.ResponseWriter, req *http.Request)
	PutScheduler(w http.ResponseWriter, req *http.Request)
	DeleteScheduler(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