api

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Docs

func Docs(s chi.Router, pattern string, swgui func(title, schemaURL, basePath string) http.Handler, collector *openapi.Collector, spec *openapi3.Spec)

Types

type API

type API struct {
	Server *web.Service
	Nodes  []*node.Node
	//Global middleware
	Middleware []func(next http.Handler) http.Handler
	Wraps      []func(next http.Handler) http.Handler
	Actions    map[string]map[string]node.Handler
	// Port Defines the listening TCP Port for this when started
	Ports struct {
		API     int
		Swagger int
	}
}

func New

func New(apiPort int, swaggerPort int, options ...func(s *web.Service, initialized bool)) *API

func (*API) Listen

func (a *API) Listen() error

func (*API) MountRoutes

func (a *API) MountRoutes() error

func (*API) Routes

func (a *API) Routes() string

Jump to

Keyboard shortcuts

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