koonkie

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: MIT Imports: 7 Imported by: 1

README

Koonkie

Burmese for "schoolmaster". A well-trained domestic elephant; often a tuskless male between 45-50 years of age, chosen for his dociliry and patience. Used for catching and training working elephants.

M. Philip Kahl & Charles Santiapillai, A Glossary of Elephant Terms

Koonkie helps you with building integrations with the elephant repository.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FollowerMetrics

type FollowerMetrics interface {
	SetPosition(state string, position int64)
}

type FollowerOptions

type FollowerOptions struct {
	Metrics      FollowerMetrics
	DocType      string
	StartAfter   int64
	CaughtUp     bool
	WaitDuration time.Duration
}

type LogFollower

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

func NewLogFollower

func NewLogFollower(
	docs repository.Documents,
	opts FollowerOptions,
) *LogFollower

NewLogFollower creates a new follower

func (*LogFollower) GetNext

func (lf *LogFollower) GetNext(
	ctx context.Context,
) ([]*repository.EventlogItem, error)

func (*LogFollower) GetState

func (lf *LogFollower) GetState() (int64, bool)

GetState returns the current log position and a boolean that is we have caught up with the log and have switched from the compacted log to streaming the eventlog.

func (*LogFollower) SetState added in v0.1.2

func (lf *LogFollower) SetState(pos int64, caughtUp bool)

SetState sets the current log position and caught up-state, see GetState().

type PrometheusFollowerMetrics

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

func NewPrometheusFollowerMetrics

func NewPrometheusFollowerMetrics(
	reg prometheus.Registerer, followerName string,
) (*PrometheusFollowerMetrics, error)

func (*PrometheusFollowerMetrics) SetPosition

func (p *PrometheusFollowerMetrics) SetPosition(state string, position int64)

SetPosition implements FollowerMetrics.

func (*PrometheusFollowerMetrics) WithName added in v0.1.1

func (p *PrometheusFollowerMetrics) WithName(followerName string) *PrometheusFollowerMetrics

WithName creates a separate instance with another follower name.

Jump to

Keyboard shortcuts

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