config

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServerConfig

type ServerConfig struct {
	Addr                  string        `yaml:"addr"`
	StorePath             string        `yaml:"storePath"`
	MaxTextSize           int64         `yaml:"maxTextSize"`
	MaxFileSize           int64         `yaml:"maxFileSize"`
	DefaultTTL            time.Duration `yaml:"-"`
	MinTTL                time.Duration `yaml:"-"`
	MaxTTL                time.Duration `yaml:"-"`
	TTLOptions            []string      `yaml:"ttlOptions"`
	BlurDisconnectTimeout time.Duration `yaml:"-"`
	WSReadTimeout         time.Duration `yaml:"-"`
	WSHeartbeatInterval   time.Duration `yaml:"-"`
	WSSendBufferSize      int           `yaml:"wsSendBufferSize"`
}

ServerConfig holds all server configuration loaded from config.yaml.

func Load

func Load(path string) (*ServerConfig, error)

Load reads and parses a YAML config file, applying defaults for missing fields.

func (*ServerConfig) Limits

func (c *ServerConfig) Limits() ServerLimits

Limits returns the ServerLimits derived from this config.

type ServerLimits

type ServerLimits struct {
	MaxTextSize           int64    `json:"maxTextSize"`
	MaxFileSize           int64    `json:"maxFileSize"`
	TTLOptions            []string `json:"ttlOptions"`
	DefaultTTL            string   `json:"defaultTTL"`
	BlurDisconnectTimeout int      `json:"blurDisconnectTimeout"` // seconds
	HeartbeatInterval     int      `json:"heartbeatInterval"`     // seconds
}

ServerLimits is the subset of config exposed to the frontend via WebSocket.

Jump to

Keyboard shortcuts

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