schema

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadConfiguration = errors.New("bad configuration")

Functions

func WithCleanupPolicy

func WithCleanupPolicy(policy string) option

WithCleanupPolicy set cleanup policy.

func WithCompressionType

func WithCompressionType(compression string) option

func WithDeleteRetentionDur

func WithDeleteRetentionDur(dur time.Duration) option

WithDeleteRetentionDur надгробия удаленных сообщений будут находиться в топике как минимум dur. Далее - могут быть удалены.

func WithKV

func WithKV(key, value string) option

WithKV проверит только ключ на его "известность" в документации. В случае если вы хотите добавить неизвестную опцию - используйте схему FromRawMap.

func WithMinCleanableDirtyRatio

func WithMinCleanableDirtyRatio(ratio float64) option

WithMinCleanableDirtyRatio допускается минимум (ratio * 100)% дубликатов в логе. Влияет на частоту удаления сегментов. Пока порог не превышен - чистка не начнется.

func WithRetentionDur

func WithRetentionDur(dur time.Duration) option

WithRetentionDur сообщение будет точно находиться в логе как минимум dur времени. Далее - может быть удалено.

func WithSegmentDur

func WithSegmentDur(dur time.Duration) option

WithSegmentDur каждый dur кафка будет принудительно создавать новый сегмент на диске. Удаление может производиться только по-сегментно.

Types

type Schema

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

Schema describe a topic schema. Just keep all topic parameters.

func FromRawMap

func FromRawMap(m map[string]string) *Schema

FromRawMap create a config from raw map without any validation.

func New

func New(opts ...option) (*Schema, error)

New creates a new configuration from options with validation.

func ServerDefault

func ServerDefault() *Schema

ServerDefault returns default server-defined schema. With this schema you will create a topic with default configuration like with command:

func (Schema) KvPairs

func (s Schema) KvPairs() map[string]string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳