harvester

package
v1.1.81 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Cfg    *Config
	Client api.Client
	URL    string
	// contains filtered or unexported fields
}

Client for connecting to harvester

func NewClient

func NewClient(cfg *Config) *Client

NewClient creates a new harvester client

func (*Client) EventCatchUp

func (h *Client) EventCatchUp(link string, events chan *proto.Event) error

EventCatchUp syncs all events

func (*Client) ReceiveSyncEvents

func (h *Client) ReceiveSyncEvents(topicSelfLink string, sequenceID int64, eventCh chan *proto.Event) (int64, error)

ReceiveSyncEvents fetches events based on the sequence id and watch topic self link, and publishes the events to the event channel

type Config

type Config struct {
	ClientTimeout    time.Duration
	Host             string
	PageSize         int
	Port             uint32
	Protocol         string
	ProxyURL         string
	SequenceProvider events.SequenceProvider
	TenantID         string
	TLSCfg           *tls.Config
	TokenGetter      func() (string, error)
	// contains filtered or unexported fields
}

Config for harvester

func NewConfig

func NewConfig(cfg config.CentralConfig, getToken auth.TokenGetter, seq events.SequenceProvider) *Config

NewConfig creates a config for harvester connections

type ErrSeqGone added in v1.1.44

type ErrSeqGone struct {
}

ErrSeqGone - error for purged sequence

func (*ErrSeqGone) Error added in v1.1.44

func (e *ErrSeqGone) Error() string

type Harvest

type Harvest interface {
	EventCatchUp(link string, events chan *proto.Event) error
	ReceiveSyncEvents(topicSelfLink string, sequenceID int64, eventCh chan *proto.Event) (int64, error)
}

Harvest is an interface for retrieving harvester events

Jump to

Keyboard shortcuts

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