subscriber

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: May 27, 2021 License: MIT Imports: 16 Imported by: 12

Documentation

Index

Constants

Variables

This section is empty.

Functions

This section is empty.

Types

type InitialLoadOptions added in v0.0.10

type InitialLoadOptions struct {
	Enabled      bool
	OmittedCount uint64
}

type Message

type Message struct {
	PipelineID   uint64
	Subscription *Subscription
	Event        *gravity_sdk_types_event.Event
}

func (*Message) Ack

func (msg *Message) Ack()

type MessageHandler

type MessageHandler func(*Message)

type Options

type Options struct {
	WorkerCount int
	BufferSize  int
	ChunkSize   int
	Verbose     bool
	StateStore  StateStore
	InitialLoad InitialLoadOptions
}

func NewOptions

func NewOptions() *Options

type Pipeline

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

func NewPipeline

func NewPipeline(subscriber *Subscriber, id uint64, lastSeq uint64) *Pipeline

func (*Pipeline) Pull added in v0.0.10

func (pipeline *Pipeline) Pull() error

func (*Pipeline) UpdateLastSequence

func (pipeline *Pipeline) UpdateLastSequence(sequence uint64)

type PipelineState

type PipelineState interface {
	GetLastSequence() uint64
	UpdateLastSequence(uint64) error
}

type Snapshot added in v0.0.10

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

func NewSnapshot added in v0.0.10

func NewSnapshot(pipeline *Pipeline) *Snapshot

func (*Snapshot) Create added in v0.0.10

func (snapshot *Snapshot) Create() error

func (*Snapshot) Pull added in v0.0.10

func (snapshot *Snapshot) Pull() error

type StateStore

type StateStore interface {
	GetPipelineState(uint64) (PipelineState, error)
	GetPipelines() []uint64
}

type Subscriber

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

func NewSubscriber

func NewSubscriber(options *Options) *Subscriber

func NewSubscriberWithClient

func NewSubscriberWithClient(client *core.Client, options *Options) *Subscriber

func (*Subscriber) AddAllPipelines

func (sub *Subscriber) AddAllPipelines() error

func (*Subscriber) AddPipeline

func (sub *Subscriber) AddPipeline(pipeline *Pipeline) error

func (*Subscriber) Connect

func (sub *Subscriber) Connect(host string, options *core.Options) error

func (*Subscriber) Disconnect

func (sub *Subscriber) Disconnect()

func (*Subscriber) GetCollectionInfo

func (sub *Subscriber) GetCollectionInfo(collection string) []string

func (*Subscriber) GetPipelineCount

func (sub *Subscriber) GetPipelineCount() (uint64, error)

func (*Subscriber) Register

func (sub *Subscriber) Register(subscriberType subscriber_manager_pb.SubscriberType, component string, subscriberID string, name string) error

func (*Subscriber) Subscribe

func (sub *Subscriber) Subscribe(cb MessageHandler) (*Subscription, error)

func (*Subscriber) SubscribeToCollections

func (sub *Subscriber) SubscribeToCollections(colMap map[string][]string) error

type Subscription

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

func NewSubscription

func NewSubscription(subscriber *Subscriber, bufferSize int) *Subscription

func (*Subscription) Unsubscribe

func (s *Subscription) Unsubscribe() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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