gochan

package
v2.0.0-preview7 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Apache-2.0 Imports: 6 Imported by: 7

Documentation

Overview

Package channel 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) (res binding.Message, err error)

func (*Requester) Send

func (s *Requester) Send(ctx context.Context, m binding.Message) (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.

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) Receive

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

func (*SendReceiver) Send

func (s *SendReceiver) Send(ctx context.Context, in binding.Message) (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) (err error)

Jump to

Keyboard shortcuts

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