config

package
v0.0.0-...-ff439f2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSegmentIncrement = 32
)

Defaults

View Source
const (
	ErrBackoffAlreadySet = "backoff algorithm already set in topic"
)

Error messages

View Source
const (
	ErrRetentionPolicyAlreadySet = "retention policy already set in topic"
)

Error messages

Variables

This section is empty.

Functions

func ApplyOptions

func ApplyOptions(c *Config, options ...Option) error

ApplyOptions applies Options to a topic

func Consumed

func Consumed(c *Config) error

Consumed applies a consumed Policy to the Topic

func Defaults

func Defaults(c *Config) error

Defaults applies default settings to a topic if they weren't explicitly set through some other Option

func Permanent

func Permanent(c *Config) error

Permanent applies a permanent Policy to the Topic

Types

type Config

type Config struct {
	RetentionPolicy  retention.Policy
	BackoffGenerator backoff.Generator
	SegmentIncrement uint16
}

Config conveys the properties of a Topic that one can configure using Options

func ApplyDefaults

func ApplyDefaults(c *Config) *Config

ApplyDefaults copies a Config instance and applies defaults to it

type Option

type Option func(*Config) error

Option applies an option to a topic configuration instance

func BackoffGenerator

func BackoffGenerator(b backoff.Generator) Option

BackoffGenerator applies a provided backoff Generator to the Topic

func Counted

func Counted(c retention.Count) Option

Counted applies a counted Policy to the Topic

func FibonacciBackoffSequence

func FibonacciBackoffSequence(unit, max time.Duration) Option

FibonacciBackoffSequence creates a Generator wherein every Duration follows the fibonacci sequence up to the specified maximum duration. Each fibonacci number is returned as many times as its value

func FixedBackoffSequence

func FixedBackoffSequence(ms time.Duration) Option

FixedBackoffSequence configures a Topic with a Generator wherein every Duration returned is the specified fixed amount

func RetentionPolicy

func RetentionPolicy(p retention.Policy) Option

RetentionPolicy applies a provided retention Policy to the Topic

func Timed

func Timed(d time.Duration) Option

Timed applies a timed Policy to the Topic

Jump to

Keyboard shortcuts

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