Versions in this module Expand all Collapse all v2 v2.0.2 Apr 16, 2020 v2.0.1 Apr 16, 2020 Changes in this version + const ContentLength + const ContentType + const DefaultShutdownTimeout + func NewResult(status int, messageFmt string, args ...interface{}) protocol.Result + func WriteRequest(ctx context.Context, m binding.Message, httpRequest *http.Request, ...) error + func WriteResponseWriter(ctx context.Context, m binding.Message, status int, rw http.ResponseWriter, ...) error + type Message struct + BodyReader io.ReadCloser + Header nethttp.Header + OnFinish func(error) error + func NewMessage(header nethttp.Header, body io.ReadCloser) *Message + func NewMessageFromHttpRequest(req *nethttp.Request) *Message + func NewMessageFromHttpResponse(req *nethttp.Response) *Message + func (m *Message) Finish(err error) error + func (m *Message) ReadBinary(ctx context.Context, encoder binding.BinaryWriter) error + func (m *Message) ReadEncoding() binding.Encoding + func (m *Message) ReadStructured(ctx context.Context, encoder binding.StructuredWriter) error + type Middleware func(next nethttp.Handler) nethttp.Handler + type Option func(*Protocol) error + func WithHTTPTransport(httpTransport nethttp.RoundTripper) Option + func WithHeader(key, value string) Option + func WithListener(l net.Listener) Option + func WithMiddleware(middleware Middleware) Option + func WithPath(path string) Option + func WithPort(port int) Option + func WithShutdownTimeout(timeout time.Duration) Option + func WithTarget(targetUrl string) Option + type Protocol struct + Client *http.Client + Handler *http.ServeMux + Path string + Port *int + RequestTemplate *http.Request + ShutdownTimeout *time.Duration + Target *url.URL + func New(opts ...Option) (*Protocol, error) + func (e *Protocol) GetPath() string + func (e *Protocol) GetPort() int + func (e *Protocol) HasTracePropagation() bool + func (e *Protocol) OpenInbound(ctx context.Context) error + func (p *Protocol) Receive(ctx context.Context) (binding.Message, error) + func (p *Protocol) Request(ctx context.Context, m binding.Message) (binding.Message, error) + func (p *Protocol) Respond(ctx context.Context) (binding.Message, protocol.ResponseFn, error) + func (p *Protocol) Send(ctx context.Context, m binding.Message) error + func (p *Protocol) ServeHTTP(rw http.ResponseWriter, req *http.Request) + type Result struct + Args []interface{} + Format string + Status int + func (e *Result) Error() string + func (e *Result) Is(target error) bool