config

package
v0.0.0-...-4528f7a Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLIConfig

type CLIConfig struct {
	// Backend is the backend to use for storing files
	Backend string `yaml:"backend"`

	FileBackendRoot string `yaml:"file_backend_root"`

	SizeLimitBytes int64 `yaml:"size_limit_bytes"`

	// ListenAddr is the address to listen on for incoming connections
	ListenAddr string `yaml:"listen_addr"`

	// HTTPListenAddr is the address to listen on for incoming HTTP connections
	HttpListenAddr string `yaml:"http_listen_addr"`

	// Domain is the domain to use for generating URLs
	Domain string `yaml:"domain"`

	// TLS is whether or not to use TLS
	TLS TLSConfig `yaml:"tls"`

	Transformers []string `yaml:"transformers"`

	AESTransform struct {
		Key string `yaml:"key"`
	} `yaml:"aes_transform"`

	PgxConfig struct {
		ConnString   string `yaml:"conn_string"`
		CreateTables bool   `yaml:"create_tables"`
	} `yaml:"postgres"`

	SQLiteConfig struct {
		Path         string `yaml:"path"`
		CreateTables bool   `yaml:"create_tables"`
	} `yaml:"sqlite"`

	S3Config struct {
		aws.Config `yaml:"config"`
		Bucket     string `yaml:"bucket"`
	} `yaml:"s3"`

	RedisConfig redis.Options `yaml:"redis"`
}

func (*CLIConfig) GetBackend

func (config *CLIConfig) GetBackend() (backends.Backend, error)

GetBackend creates a new backend based on the provided configuration.

func (*CLIConfig) GetTransforms

func (config *CLIConfig) GetTransforms() ([]transforms.Transformer, error)

type TLSConfig

type TLSConfig struct {
	// CertFile is the path to the certificate file
	CertFile string `yaml:"cert_file"`

	// KeyFile is the path to the key file
	KeyFile string `yaml:"key_file"`
}

Jump to

Keyboard shortcuts

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