config

package
v0.0.0-...-232f911 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XdgRuntimeDir = "XDG_RUNTIME_DIR"

	KeyENV                          = "ENV"
	KeyTimeOut                      = "TIME_OUT"
	KeyLogLevel                     = "LOG_LEVEL"
	KeyLogOutput                    = "LOG_OUTPUT"
	KeyHostname                     = "HOSTNAME"
	KeyHTTPS                        = "HTTPS"
	KeyCertPath                     = "CERT_PATH"
	KeyKeyPath                      = "KEY_PATH"
	KeyListen                       = "LISTEN"
	KeyDBHost                       = "DB_HOST"
	KeyDBPort                       = "DB_PORT"
	KeyDBName                       = "DB_NAME"
	KeyDBUser                       = "DB_USER"
	KeyDBPw                         = "DB_PASSWORD"
	KeyStorage                      = "STORAGE"
	KeyStoragePath                  = "STORAGE_PATH"
	KeyCacheDisable                 = "DISABLE_CACHE"
	KeyStorageCacheDisable          = "DISABLE_STORAGE_CACHE"
	KeyRequestCacheDisable          = "DISABLE_REQUEST_CACHE"
	KeyStorageIndexDisable          = "DISABLE_STORAGE_INDEX"
	KeyMastodonCompatibilityDisable = "DISABLE_MASTODON_COMPATIBILITY"

	StorageBoltDB   = StorageType("boltdb")
	StorageFS       = StorageType("fs")
	StorageBadger   = StorageType("badger")
	StoragePostgres = StorageType("postgres")
	StorageSqlite   = StorageType("sqlite")
)
View Source
const DefaultStorage = StorageFS

Variables

View Source
var (
	Prefix         = "fedbox"
	BaseRuntimeDir = "/var/run"
)

Functions

func Getval

func Getval(name, def string) string

Types

type BackendConfig

type BackendConfig struct {
	Enabled bool
	Host    string
	Port    int64
	User    string
	Pw      string
	Name    string
}

type Options

type Options struct {
	AppName            string
	Version            string
	Env                env.Type
	LogLevel           lw.Level
	LogOutput          string
	TimeOut            time.Duration
	Secure             bool
	CertPath           string
	KeyPath            string
	Hostname           string
	Listen             string
	BaseURL            string
	Storage            StorageType
	StoragePath        string
	StorageCache       bool
	RequestCache       bool
	UseIndex           bool
	Profile            bool
	MastodonCompatible bool
	ShuttingDown       bool
}

func Load

func Load(path string, e env.Type, timeOut time.Duration) (Options, error)

func LoadFromEnv

func LoadFromEnv() Options

func (Options) BaseStoragePath

func (o Options) BaseStoragePath() (string, error)

func (Options) DefaultSocketPath

func (o Options) DefaultSocketPath() string

func (Options) PidPath

func (o Options) PidPath() string

func (Options) ReadPid

func (o Options) ReadPid() (int, error)

func (Options) RuntimePath

func (o Options) RuntimePath() string

func (Options) WritePid

func (o Options) WritePid() error

type StorageType

type StorageType string

Jump to

Keyboard shortcuts

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