api

package
v0.0.0-...-cce48a0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthCredentials

type AuthCredentials struct {
	AccessKey string
	Secret    string
}

type HTTPServer

type HTTPServer interface {
	ListenAndServe(listenAddr string) error
	ServeHTTP(w http.ResponseWriter, r *http.Request)
	Stop(ctx context.Context) error
}

func NewServer

func NewServer(
	auth AuthCredentials,
	svc JobService,
) (HTTPServer, error)

type JobCreateRequest

type JobCreateRequest struct {
	JobID  string        `json:"jobId"`
	Name   string        `json:"type"`
	Params model.JobSpec `json:"params"`
}

type JobHandleResponse

type JobHandleResponse struct {
	ID string `json:"id"`
}

type JobRunRequest

type JobRunRequest struct {
	JobID  string `json:"jobID"`
	Result string `json:"result"`
}

type JobService

type JobService interface {
	StartJob(jobID string, spec *model.JobSpec) error
	RunJob(jobID, result string) error
	StopJob(jobID string) error
}

Jump to

Keyboard shortcuts

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