connection

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Deliver creates a Deliver stream
	Deliver = func(client pb.DeliverClient) (deliverStream, func(), error) {
		ctx, cancel := context.WithCancel(context.Background())
		stream, err := client.Deliver(ctx)
		return stream, cancel, err
	}

	// DeliverFiltered creates a DeliverFiltered stream
	DeliverFiltered = func(client pb.DeliverClient) (deliverStream, func(), error) {
		ctx, cancel := context.WithCancel(context.Background())
		stream, err := client.DeliverFiltered(ctx)
		return stream, cancel, err
	}
)

Functions

This section is empty.

Types

type DeliverConnection

type DeliverConnection struct {
	*comm.StreamConnection
	// contains filtered or unexported fields
}

DeliverConnection manages the connection to the deliver server

func New

func New(ctx fabcontext.Client, chConfig fab.ChannelCfg, streamProvider StreamProvider, url string, opts ...options.Opt) (*DeliverConnection, error)

New returns a new Deliver Server connection

func (*DeliverConnection) Receive

func (c *DeliverConnection) Receive(eventch chan<- interface{})

Receive receives events from the deliver server

func (*DeliverConnection) Send

func (c *DeliverConnection) Send(seekInfo *ab.SeekInfo) error

Send sends a seek request to the deliver server

type Event

type Event struct {
	SourceURL string
	Event     interface{}
}

Event contains the deliver event as well as the event source

func NewEvent

func NewEvent(event interface{}, sourceURL string) *Event

NewEvent returns a deliver event

type StreamProvider

type StreamProvider func(pb.DeliverClient) (stream deliverStream, cancel func(), err error)

StreamProvider creates a deliver stream

Jump to

Keyboard shortcuts

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