http_plugin

package
v0.0.0-...-c626c17 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HttpPlug = PluginTypeName("HttpPlugin")
)

Variables

This section is empty.

Functions

func HandleException

func HandleException(e interface{}, apiName, callName, body string, cb UrlResponseCallback)

Types

type ErrorDetail

type ErrorDetail struct {
	Message    string
	File       string
	LineNumber uint64
	Method     string
}

type ErrorInfo

type ErrorInfo struct {
	Code    int64
	Name    string
	What    string
	Details []ErrorDetail
}

type ErrorResults

type ErrorResults struct {
	Code    uint16
	Message string
	Error   ErrorInfo
}

type HttpPlugin

type HttpPlugin struct {
	AbstractPlugin
	// contains filtered or unexported fields
}

func NewHttpPlugin

func NewHttpPlugin(io *asio.IoContext) *HttpPlugin

func (*HttpPlugin) AddHandler

func (h *HttpPlugin) AddHandler(url string, handler UrlHandler)

func (*HttpPlugin) Handler

func (h *HttpPlugin) Handler(ctx *fasthttp.RequestCtx)

func (*HttpPlugin) IsOnLoopBack

func (h *HttpPlugin) IsOnLoopBack() bool

func (*HttpPlugin) IsSecure

func (h *HttpPlugin) IsSecure() bool

func (*HttpPlugin) PluginInitialize

func (h *HttpPlugin) PluginInitialize(c *cli.Context)

func (*HttpPlugin) PluginShutdown

func (h *HttpPlugin) PluginShutdown()

func (*HttpPlugin) PluginStartup

func (h *HttpPlugin) PluginStartup()

func (*HttpPlugin) SetProgramOptions

func (h *HttpPlugin) SetProgramOptions(options *[]cli.Flag)

func (*HttpPlugin) VerboseErrors

func (h *HttpPlugin) VerboseErrors() bool

type HttpPluginImpl

type HttpPluginImpl struct {
	UrlHandlers map[string]UrlHandler

	AccessControlAllowOrigin      string
	AccessControlAllowHeaders     string
	AccessControlMaxAge           string
	AccessControlAllowCredentials bool //default false
	MaxBodySize                   common.SizeT

	ListenEndpoint      *http.ServeMux
	HttpsListenEndpoint *http.ServeMux

	Listener net.Listener
	// contains filtered or unexported fields
}

func NewHttpPluginImpl

func NewHttpPluginImpl(io *asio.IoContext) *HttpPluginImpl

type NextFunction

type NextFunction = func(interface{})

type UrlHandler

type UrlHandler = func(source string, body []byte, cb UrlResponseCallback)

type UrlResponseCallback

type UrlResponseCallback = func(int, []byte)

Jump to

Keyboard shortcuts

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