Documentation ¶
Index ¶
- Variables
- func NewHandler(ctx context.Context, options ...HandlerOption) (*handler, error)
- func NewMultiTopicDecoupleSink(ctx context.Context, options ...MultiTopicDecoupleSinkOption) (*multiTopicDecoupleSink, error)
- type DecoupleSink
- type HandlerOption
- type HttpMessageReceiver
- type MultiTopicDecoupleSinkOption
Constants ¶
This section is empty.
Variables ¶
var ErrIncomplete = errors.New("incomplete config")
ErrIncomplete is the error when a broker entry exists in the configmap but its decouple queue is nil or empty. This should never happen unless there is a bug in the controller.
var ErrNotFound = errors.New("not found")
ErrNotFound is the error when a broker doesn't exist in the configmap. This can happen if the clients specifies invalid broker in the path, or the configmap volume hasn't been updated.
Functions ¶
func NewHandler ¶
func NewHandler(ctx context.Context, options ...HandlerOption) (*handler, error)
NewHandler creates a new ingress handler.
func NewMultiTopicDecoupleSink ¶
func NewMultiTopicDecoupleSink(ctx context.Context, options ...MultiTopicDecoupleSinkOption) (*multiTopicDecoupleSink, error)
NewMultiTopicDecoupleSink creates a new multiTopicDecoupleSink.
Types ¶
type DecoupleSink ¶
type DecoupleSink interface { // Send sends the event from a broker to the corresponding decoupling sink. Send(ctx context.Context, ns, broker string, event cev2.Event) protocol.Result }
DecoupleSink is an interface to send events to a decoupling sink (e.g., pubsub).
type HandlerOption ¶
type HandlerOption func(*handler) error
HandlerOption is the option to configure ingress handler.
func WithPort ¶
func WithPort(port int) HandlerOption
WithPort specifies the port number that ingress listens on. It will create an HttpMessageReceiver for that port.
func WithProjectID ¶
func WithProjectID(id string) HandlerOption
WithProjectID creates a pubsub client for the given project ID to communicate with pubsusb decouple topics.
type HttpMessageReceiver ¶
type HttpMessageReceiver interface {
StartListen(ctx context.Context, handler nethttp.Handler) error
}
HttpMessageReceiver is an interface to listen on http requests.
type MultiTopicDecoupleSinkOption ¶
type MultiTopicDecoupleSinkOption func(sink *multiTopicDecoupleSink)
MultiTopicDecoupleSinkOption is the option to configure multiTopicDecoupleSink.
func WithBrokerConfig ¶
func WithBrokerConfig(brokerConfig config.ReadonlyTargets) MultiTopicDecoupleSinkOption
WithBrokerConfig specifies the broker config. It can be created by reading a configmap mount.
func WithPubsubClient ¶
func WithPubsubClient(client cloudevents.Client) MultiTopicDecoupleSinkOption
WithPubsubClient specifies the pubsub client to use.