Documentation ¶
Overview ¶
Package http implements an HTTP CloudEvents binding.
Index ¶
- Constants
- func EncodeHttpRequest(ctx context.Context, m binding.Message, req *http.Request, ...) error
- func EncodeHttpResponse(ctx context.Context, m binding.Message, res *http.Response, ...) error
- func NewSender(client *http.Client, target *url.URL, options ...SenderOptionFunc) binding.Sender
- type Message
- type Receiver
- type Sender
- type SenderOptionFunc
Constants ¶
View Source
const ContentType = "Content-Type"
Variables ¶
This section is empty.
Functions ¶
func EncodeHttpRequest ¶
func EncodeHttpRequest(ctx context.Context, m binding.Message, req *http.Request, transformerFactories binding.TransformerFactories) error
Fill the provided req with the message m. Using context you can tweak the encoding processing (more details on binding.Translate documentation).
func EncodeHttpResponse ¶
func EncodeHttpResponse(ctx context.Context, m binding.Message, res *http.Response, transformerFactories binding.TransformerFactories) error
Fill the provided res with the message m. Using context you can tweak the encoding processing (more details on binding.Translate documentation).
Types ¶
type Message ¶
type Message struct { Header nethttp.Header BodyReader io.ReadCloser OnFinish func(error) error // contains filtered or unexported fields }
Message holds the Header and Body of a HTTP Request or Response.
func NewMessage ¶
NewMessage returns a Message with header and data from body. Reads and closes body.
func (*Message) Structured ¶
type Receiver ¶
type Receiver struct {
// contains filtered or unexported fields
}
Receiver for CloudEvents as HTTP requests. Implements http.Handler, To receive messages, associate it with a http.Server.
type Sender ¶
type SenderOptionFunc ¶
type SenderOptionFunc func(sender *Sender)
func WithTranscoder ¶
func WithTranscoder(factory binding.TransformerFactory) SenderOptionFunc
Click to show internal directories.
Click to hide internal directories.