config

package
v0.0.0-...-e558f2e Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAddress        = "localhost:3434"
	DefaultMaxMessageSize = 10_000
	DefaultMaxConnections = 100
	DefaultIdleTimeout    = time.Minute

	DefaultWALFlushingBatchSize    = 100
	DefaultWALFlushingBatchTimeout = 20 * time.Millisecond
	DefaultWALMaxSegmentSize       = 4 * 1024 * 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientOptions

type ClientOptions struct {
	Address        string
	MaxMessageSize int
	IdleTimeout    time.Duration
}

func LoadClientOptions

func LoadClientOptions() (ClientOptions, error)

type Engine

type Engine struct {
	Type string `yaml:"type"`
}

func (Engine) Validate

func (e Engine) Validate(ctx context.Context, validator *validation.Validator) error

type Logging

type Logging struct {
	Level  string
	Output string
}

func (Logging) Validate

func (l Logging) Validate(ctx context.Context, validator *validation.Validator) error

type Network

type Network struct {
	Address        string
	MaxConnections int
	MaxMessageSize int
	IdleTimeout    time.Duration
	OnServerStart  func()
}

func (Network) Validate

func (n Network) Validate(ctx context.Context, validator *validation.Validator) error

type ServerOptions

type ServerOptions struct {
	FS      afero.Fs
	Engine  Engine
	WAL     WAL
	Network Network
	Logging Logging
}

func DefaultServerOptions

func DefaultServerOptions() *ServerOptions

func LoadServerOptions

func LoadServerOptions() (*ServerOptions, error)

func (*ServerOptions) Validate

func (p *ServerOptions) Validate(ctx context.Context, validator *validation.Validator) error

type WAL

type WAL struct {
	Enabled              bool
	FlushingBatchSize    int
	FlushingBatchTimeout time.Duration
	MaxSegmentSize       int
	DataDirectory        string
}

func (WAL) Validate

func (w WAL) Validate(ctx context.Context, validator *validation.Validator) error

Jump to

Keyboard shortcuts

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