httpserver

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultHTTPServerBufferSize is the default size of the
	// buffer of in-coming HTTP request messages.
	DefaultHTTPServerBufferSize = 1024
)

Functions

func NewHTTPServerChan

func NewHTTPServerChan(ctx *dsl.Ctx, opts interface{}) (dsl.Chan, error)

Types

type HTTPServer

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

HTTPServer is an HTTP server Chan.

An HTTPServer will emit the requests it receives from HTTP clients, and the server should receive the responses to forward to those clients.

To use this channel, you first 'recv' a client request, and then you 'pub' the response, which the Chan will forward to the HTTP client.

Note that you have to do 'pub' each specific response for each client request.

func (*HTTPServer) Close

func (c *HTTPServer) Close(ctx *dsl.Ctx) error

func (*HTTPServer) DocSpec

func (c *HTTPServer) DocSpec() *dsl.DocSpec

func (*HTTPServer) Kill

func (c *HTTPServer) Kill(ctx *dsl.Ctx) error

func (*HTTPServer) Kind

func (c *HTTPServer) Kind() dsl.ChanKind

func (*HTTPServer) Open

func (c *HTTPServer) Open(ctx *dsl.Ctx) error

func (*HTTPServer) Pub

func (c *HTTPServer) Pub(ctx *dsl.Ctx, m dsl.Msg) error

func (*HTTPServer) Recv

func (c *HTTPServer) Recv(ctx *dsl.Ctx) chan dsl.Msg

func (*HTTPServer) Sub

func (c *HTTPServer) Sub(ctx *dsl.Ctx, topic string) error

func (*HTTPServer) To

func (c *HTTPServer) To(ctx *dsl.Ctx, m dsl.Msg) error

type HTTPServerOpts

type HTTPServerOpts struct {
	Host      string `json:"host"`
	Port      int    `json:"port"`
	ParseJSON bool   `json:"parsejson" yaml:"parsejson"`
}

HTTPServerOpts configures an HTTPServer channel.

Jump to

Keyboard shortcuts

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