api

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIN_PORT = 8000
	MAX_PORT = 8100
)

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)

func (*API) Shutdown

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

func (*API) Start

func (s *API) Start() error

type Config

type Config struct {
	Broker      mq.Broker
	DataStore   datastore.Datastore
	Address     string
	Middlewares []request.MiddlewareFunc
	Endpoints   map[string]request.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) JSON

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

func (*Context) Request

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

func (*Context) String

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

func (*Context) SubmitJob

func (c *Context) SubmitJob(ij *input.Job, listeners ...request.JobListener) (*tork.Job, error)

Jump to

Keyboard shortcuts

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