gochan

package
v2.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2022 License: Apache-2.0 Imports: 6 Imported by: 7

Documentation

Overview

Package gochan implements the CloudEvent transport implementation using go chan.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChanResponderResponse

type ChanResponderResponse struct {
	Message binding.Message
	Result  protocol.Result
}

type Receiver

type Receiver <-chan binding.Message

Receiver implements Receiver by receiving Messages from a channel.

func (Receiver) Receive

func (r Receiver) Receive(ctx context.Context) (binding.Message, error)

type Requester

type Requester struct {
	Ch    chan<- binding.Message
	Reply func(message binding.Message) (binding.Message, error)
}

func (*Requester) Close

func (s *Requester) Close(ctx context.Context) (err error)

func (*Requester) Request

func (s *Requester) Request(ctx context.Context, m binding.Message, transformers ...binding.Transformer) (res binding.Message, err error)

func (*Requester) Send

func (s *Requester) Send(ctx context.Context, m binding.Message, transformers ...binding.Transformer) (err error)

type Responder

type Responder struct {
	In  <-chan binding.Message
	Out chan<- ChanResponderResponse
}

Responder implements Responder by receiving Messages from a channel and outputting the result in an output channel. All message received in the `Out` channel must be finished

func (*Responder) Respond

type SendReceiver

type SendReceiver struct {
	// contains filtered or unexported fields
}

SendReceiver is a reference implementation for using the CloudEvents binding integration.

func New

func New() *SendReceiver

func (*SendReceiver) Close added in v2.10.0

func (sr *SendReceiver) Close(ctx context.Context) error

func (*SendReceiver) Receive

func (sr *SendReceiver) Receive(ctx context.Context) (binding.Message, error)

func (*SendReceiver) Send

func (sr *SendReceiver) Send(ctx context.Context, in binding.Message, transformers ...binding.Transformer) (err error)

type Sender

type Sender chan<- binding.Message

Sender implements Sender by sending Messages on a channel.

func (Sender) Close

func (s Sender) Close(ctx context.Context) (err error)

func (Sender) Send

func (s Sender) Send(ctx context.Context, m binding.Message, transformers ...binding.Transformer) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL