iterator

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CDCIterator

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

func NewCDCIterator

func NewCDCIterator(
	ctx context.Context,
	username, apiToken, domain string,
	pollingPeriod time.Duration,
	tp *position.TicketPosition,
	cursors ...ZendeskCursor,
) (*CDCIterator, error)

NewCDCIterator will initialize CDCIterator parameters and also initialize goroutine to fetch records from server

func (*CDCIterator) HasNext

func (c *CDCIterator) HasNext(_ context.Context) bool

HasNext return true when buffer is not empty

func (*CDCIterator) Next

func (c *CDCIterator) Next(ctx context.Context) (sdk.Record, error)

Next will check the case whether to push data into buffer

func (*CDCIterator) Stop

func (c *CDCIterator) Stop()

type ZendeskCursor

type ZendeskCursor interface {
	FetchRecords(ctx context.Context) ([]sdk.Record, error)
	Close()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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