Documentation
¶
Index ¶
- Variables
- func NewHTTPServerChan(ctx *dsl.Ctx, opts interface{}) (dsl.Chan, error)
- type HTTPServer
- func (c *HTTPServer) Close(ctx *dsl.Ctx) error
- func (c *HTTPServer) DocSpec() *dsl.DocSpec
- func (c *HTTPServer) Kill(ctx *dsl.Ctx) error
- func (c *HTTPServer) Kind() dsl.ChanKind
- func (c *HTTPServer) Open(ctx *dsl.Ctx) error
- func (c *HTTPServer) Pub(ctx *dsl.Ctx, m dsl.Msg) error
- func (c *HTTPServer) Recv(ctx *dsl.Ctx) chan dsl.Msg
- func (c *HTTPServer) Sub(ctx *dsl.Ctx, topic string) error
- func (c *HTTPServer) To(ctx *dsl.Ctx, m dsl.Msg) error
- type HTTPServerOpts
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 ¶
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) DocSpec ¶
func (c *HTTPServer) DocSpec() *dsl.DocSpec
func (*HTTPServer) Kind ¶
func (c *HTTPServer) Kind() dsl.ChanKind
type HTTPServerOpts ¶
type HTTPServerOpts struct {
Host string `json:"host"`
Port int `json:"port"`
ParseJSON bool `json:"parsejson" yaml:"parsejson"`
}
HTTPServerOpts configures an HTTPServer channel.
Click to show internal directories.
Click to hide internal directories.