Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
Server allows you to simply serve HTTP handlers and a CloudEvent receiver side-by-side.
func NewServer ¶
func NewServer(conf *ServerConfig) (*Server, error)
func (*Server) CloudEventClient ¶
func (s *Server) CloudEventClient() cloudevents.Client
CloudEventClient returns the Server's client for CloudEvents.
func (*Server) HandleCloudEvents ¶
func (s *Server) HandleCloudEvents(handler cloudeventsclient.ReceiveFull)
HandleCloudEvents sets the handler for CloudEvent receiveing. There can only be one.
func (*Server) ListenAndServe ¶
ListenAndServe starts serving the HTTP handlers and CloudEvent receiver, blocking until termination.
type ServerConfig ¶
type ServerConfig struct { // Port is the port that serves both HTTP handlers and CloudEvent receiving. // Defaults to 80. // +optional Port string // CloudEventReceivePath is the path reserved for CloudEvents. // If omitted, defaults to "/". // +optional CloudEventReceivePath string // CloudEventTargets is a slice of targets that the client will send CloudEvents on. // +optional CloudEventTargets []string // ConvertFn is a function to convert non-CloudEvent requests to the CloudEventReceivePath into CloudEvents. // +optional ConvertFn cloudevents.ConvertFn // TransportOptions are forwarded directly to CloudEvent transport construction. // +optional TransportOptions []cloudeventshttp.Option // ClientOptions are forwarded directly to CloudEvent client construction. // +optional ClientOptions []cloudeventsclient.Option }
ServerConfig is a struct for options when constructing a new HTTP server.
Click to show internal directories.
Click to hide internal directories.