config

package
v0.0.0-...-ca5cfa8 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	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"
	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"

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 {
	Env                env.Type
	LogLevel           lw.Level
	LogOutput          string
	TimeOut            time.Duration
	Secure             bool
	CertPath           string
	KeyPath            string
	Host               string
	Listen             string
	BaseURL            string
	Storage            StorageType
	StoragePath        string
	StorageCache       bool
	RequestCache       bool
	Profile            bool
	MastodonCompatible bool
}

func LoadFromEnv

func LoadFromEnv(e env.Type, timeOut time.Duration) (Options, error)

func (Options) BaseStoragePath

func (o Options) BaseStoragePath() string

type StorageType

type StorageType string

Jump to

Keyboard shortcuts

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