Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequestPayload ¶
RequestPayload takes a *http.Request and returns the payload If the request is a GET the query string parameters are extracted and marshaled to JSON and the raw bytes are returned. If the request method is a POST the request body is read and returned
func WithEndpoint ¶
func WithEndpoint(e *Endpoint) server.HandlerOption
Types ¶
type Endpoint ¶
type Endpoint struct {
// RPC Method e.g. Greeter.Hello
Name string
// Description e.g what's this endpoint for
Description string
// API Handler e.g rpc, proxy
Handler string
// HTTP Host e.g example.com
Host []string
// HTTP Methods e.g GET, POST
Method []string
// HTTP Path e.g /greeter. Expect POSIX regex
Path []string
// Body destination
// "*" or "" - top level message value
// "string" - inner message value
Body string
// Stream flag
Stream bool
}
Endpoint is a mapping between an RPC method and HTTP endpoint
type Option ¶
type Option func(*Options)
func ACMEProvider ¶
func EnableACME ¶
func EnableCORS ¶
func WrapHandler ¶
type Server ¶
type Server interface {
Address() string
Init(opts ...Option) error
Handle(path string, handler http.Handler)
Start() error
Stop() error
}
Server serves api requests
Directories
¶
| Path | Synopsis |
|---|---|
|
Package handler provides http handlers
|
Package handler provides http handlers |
|
api
Package api provides an http-rpc handler which provides the entire http request over rpc
|
Package api provides an http-rpc handler which provides the entire http request over rpc |
|
event
Package event provides a handler which publishes an event
|
Package event provides a handler which publishes an event |
|
http
Package http is a http reverse proxy handler
|
Package http is a http reverse proxy handler |
|
rpc
Package rpc is a go-micro rpc handler.
|
Package rpc is a go-micro rpc handler. |
|
web
Package web contains the web handler including websocket support
|
Package web contains the web handler including websocket support |
|
Package resolver resolves a http request to an endpoint
|
Package resolver resolves a http request to an endpoint |
|
grpc
Package grpc resolves a grpc service like /greeter.Say/Hello to greeter service
|
Package grpc resolves a grpc service like /greeter.Say/Hello to greeter service |
|
host
Package host resolves using http host
|
Package host resolves using http host |
|
path
Package path resolves using http path
|
Package path resolves using http path |
|
subdomain
Package subdomain is a resolver which uses the subdomain to determine the domain to route to.
|
Package subdomain is a resolver which uses the subdomain to determine the domain to route to. |
|
vpath
Package vpath resolves using http path and recognised versioned urls
|
Package vpath resolves using http path and recognised versioned urls |
|
Package router provides api service routing
|
Package router provides api service routing |
|
registry
Package registry provides a dynamic api service router
|
Package registry provides a dynamic api service router |
|
http
Package http provides a http server with features; acme, cors, etc
|
Package http provides a http server with features; acme, cors, etc |
Click to show internal directories.
Click to hide internal directories.