startkeys

package
v0.0.0-...-73e55f4 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StartKeys

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

StartKeys maps each source ID and prefix to the key that ingestion will start from.

A nil value of StartKeys supports Get, Set and IsDirty, but have no effect.

func New

func New() *StartKeys

New creates a new instance of StartKeys.

func (*StartKeys) Get

func (sk *StartKeys) Get(id, prefix string) string

Get returns the corresponding start key for the supplied id and prefix. If the key is not present an empty string will be returned.

An empty string will also be returned for a nil StartKeys.

func (*StartKeys) IsDirty

func (sk *StartKeys) IsDirty() bool

IsDirty returns true if the internal state of the keys has changed, and requires persistence to storage.

The function will always return false if StartKeys is nil.

func (*StartKeys) ReadYAML

func (sk *StartKeys) ReadYAML(r io.Reader) error

ReadYAML populates the data from the supplied reader containing YAML content.

func (*StartKeys) Set

func (sk *StartKeys) Set(id, prefix, key string)

Set stores the key for the supplied id and prefix. If the key results in a value changing IsDirty() will return true.

The function will no-op if StartKeys is nil.

func (*StartKeys) WriteYAML

func (sk *StartKeys) WriteYAML(w io.Writer) error

ToYAML serializes the keys to YAML and writes it to the supplied writer w.

Jump to

Keyboard shortcuts

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