config

package
v0.0.0-...-2802c91 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DriverPG     = "pgx"
	DriverSqlite = "sqlite"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	SessionDuration time.Duration `group:"auth" default:"24h" env:"OXIDRIVE_SESSION_DURATION"`
}

type Config

type Config struct {
	PublicURL *url.URL `env:"PUBLIC_URL" required:"" help:"The public URL where the Oxidrive UI and API are exposed"`

	LogLevel  zerolog.Level `env:"LOG_LEVEL" default:"info"`
	LogFormat LogFormat     `env:"LOG_FORMAT" default:"json"`

	Host string `env:"HOST" default:"127.0.0.1"`
	Port int16  `env:"PORT" default:"4000"`

	AssetsFolder string `env:"OXIDRIVE_ASSETS_FOLDER" default:"./assets"`

	AuthConfig

	DatabaseConfig

	StorageConfig
}

func Parse

func Parse() Config

func (*Config) AssetsFolderPath

func (c *Config) AssetsFolderPath() string

func (*Config) ListenAddress

func (c *Config) ListenAddress() string

type DatabaseConfig

type DatabaseConfig struct {
	Url *url.URL `` /* 231-byte string literal not displayed */

	PostgresHost     string `group:"postgresql" xor:"host" required:"" env:"POSTGRES_HOST"`
	PostgresPort     string `group:"postgresql" xor:"port" required:"" env:"POSTGRES_PORT"`
	PostgresUser     string `group:"postgresql" xor:"user" env:"POSTGRES_USER"`
	PostgresPassword string `group:"postgresql" xor:"pwd" env:"POSTGRES_PASSWORD"`
	PostgresDB       string `group:"postgresql" xor:"db" env:"POSTGRES_DB"`
	PostgresArgs     string `group:"postgresql" xor:"args" env:"POSTGRES_ARGS"`
}

func (*DatabaseConfig) DatabaseDriver

func (p *DatabaseConfig) DatabaseDriver() string

func (*DatabaseConfig) DatabaseName

func (p *DatabaseConfig) DatabaseName() string

func (*DatabaseConfig) DatabaseSource

func (p *DatabaseConfig) DatabaseSource() string

func (*DatabaseConfig) DatabaseUrl

func (p *DatabaseConfig) DatabaseUrl() *url.URL

type LogFormat

type LogFormat string
const (
	FormatJson LogFormat = "json"
	FormatText LogFormat = "text"
)

type StorageConfig

type StorageConfig struct {
	StoragePrefix      string `group:"storage" default:"/files" env:"OXIDRIVE_STORAGE_PREFIX"`
	ThroughputInByte   int    `` /* 160-byte string literal not displayed */
	MultipartMaxMemory int64  `` /* 139-byte string literal not displayed */

	StorageFSConfig
}

type StorageFSConfig

type StorageFSConfig struct {
	StorageFSDataDir string `group:"storage" type:"path" env:"OXIDRIVE_STORAGE_FS_DATA_DIR"`
}

Jump to

Keyboard shortcuts

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