api

package
v0.1.161 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	MIN_PORT                = 8000
	MAX_PORT                = 8100
	MAX_LOG_PAGE_SIZE       = 100
	MAX_EXECUTION_PAGE_SIZE = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func NewAPI

func NewAPI(cfg Config) (*API, error)

@host localhost:8000 @BasePath / @schemes http

func (*API) Shutdown

func (s *API) Shutdown(ctx context.Context) error

func (*API) Start

func (s *API) Start() error

func (*API) SubmitJob added in v0.1.7

func (s *API) SubmitJob(ctx context.Context, ji *input.Job) (*tork.Job, error)

type Config

type Config struct {
	Broker     broker.Broker
	DataStore  datastore.Datastore
	Address    string
	Middleware Middleware
	Endpoints  map[string]web.HandlerFunc
	Enabled    map[string]bool
}

type Context

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

func (*Context) Bind

func (c *Context) Bind(i any) error

func (*Context) Done

func (c *Context) Done() <-chan any

func (*Context) Error

func (c *Context) Error(code int, err error)

func (*Context) Get added in v0.1.6

func (c *Context) Get(key any) any

func (*Context) JSON

func (c *Context) JSON(code int, data any) error

func (*Context) NoContent added in v0.1.6

func (c *Context) NoContent(code int) error

func (*Context) Request

func (c *Context) Request() *http.Request

func (*Context) Response added in v0.1.6

func (c *Context) Response() http.ResponseWriter

func (*Context) Set added in v0.1.77

func (c *Context) Set(key any, val any)

func (*Context) String

func (c *Context) String(code int, s string) error

type HealthResponse added in v0.1.7

type HealthResponse struct {
	Status string `json:"status"`
}

type Middleware added in v0.1.6

type Middleware struct {
	Web  []web.MiddlewareFunc
	Job  []job.MiddlewareFunc
	Task []task.MiddlewareFunc
	Log  []logmw.MiddlewareFunc
	Echo []echo.MiddlewareFunc
}

Jump to

Keyboard shortcuts

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