config

package
v0.0.0-...-f191575 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	Enabled         bool      `toml:"enabled"`
	Keys            []AuthKey `toml:"keys"`
	PublicEndpoints []string  `toml:"public_endpoints"`
	JWT             JWTConfig `toml:"jwt"`
}

type AuthKey

type AuthKey struct {
	Key         string   `toml:"key"`
	Name        string   `toml:"name"`
	Permissions string   `toml:"permissions"`
	Buckets     []string `toml:"buckets"`
}

type Config

type Config struct {
	Server     ServerConfig     `toml:"server"`
	Storage    StorageConfig    `toml:"storage"`
	Auth       AuthConfig       `toml:"auth"`
	Rate       RateConfig       `toml:"rate"`
	Upload     UploadConfig     `toml:"upload"`
	Presign    PresignConfig    `toml:"presign"`
	Lifecycle  LifecycleConfig  `toml:"lifecycle"`
	Encryption EncryptionConfig `toml:"-"`
}

func Load

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

type EncryptionConfig

type EncryptionConfig struct {
	Enabled   bool
	MasterKey *crypto.MasterKey
}

type JWTConfig

type JWTConfig struct {
	Enabled   bool     `toml:"enabled"`
	Secrets   []string `toml:"secrets"`
	Issuer    string   `toml:"issuer"`
	Audience  string   `toml:"audience"`
	LeewaySec int64    `toml:"leeway_sec"`
}

type LifecycleConfig

type LifecycleConfig struct {
	Enabled            bool `toml:"enabled"`
	CleanupIntervalSec int  `toml:"cleanup_interval_sec"`
}

type PresignConfig

type PresignConfig struct {
	Enabled          bool   `toml:"enabled"`
	Secret           string `toml:"secret"`
	DefaultExpirySec int64  `toml:"default_expiry_sec"`
	MaxExpirySec     int64  `toml:"max_expiry_sec"`
}

type RateConfig

type RateConfig struct {
	Enabled         bool    `toml:"enabled"`
	ReadPerSecond   float64 `toml:"read_per_second"`
	ReadBurst       int     `toml:"read_burst"`
	WritePerSecond  float64 `toml:"write_per_second"`
	WriteBurst      int     `toml:"write_burst"`
	CleanupInterval int     `toml:"cleanup_interval"`
}

type ServerConfig

type ServerConfig struct {
	Host         string `toml:"host"`
	Port         int    `toml:"port"`
	Domain       string `toml:"domain"`
	TLS          bool   `toml:"tls"`
	CertDir      string `toml:"cert_dir"`
	ReadTimeout  int    `toml:"read_timeout"`
	WriteTimeout int    `toml:"write_timeout"`
	IdleTimeout  int    `toml:"idle_timeout"`
}

type StorageConfig

type StorageConfig struct {
	Paths    []string `toml:"paths"`
	Database string   `toml:"database"`
}

type UploadConfig

type UploadConfig struct {
	MaxFileSize     int64  `toml:"max_file_size"`
	ChunkSize       int64  `toml:"chunk_size"`
	SessionTimeout  int    `toml:"session_timeout"`
	CleanupInterval int    `toml:"cleanup_interval"`
	TempDir         string `toml:"temp_dir"`
}

Jump to

Keyboard shortcuts

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