config

package
v0.0.0-...-317d7e6 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load()

Load loads the current config from environment variables and an optional .env file

Types

type AutoDeleteConfig

type AutoDeleteConfig struct {
	Enabled      bool
	Lifetime     time.Duration
	TaskInterval time.Duration
}

AutoDeleteConfig represents the configuration specific for the AutoDelete behaviour

type Config

type Config struct {
	WebAddress                  string
	StorageType                 shared.StorageType
	HastebinSupport             bool
	IDLength                    int
	IDCharacters                string
	ModificationTokens          bool
	ModificationTokenMaster     string
	ModificationTokenLength     int
	ModificationTokenCharacters string
	RateLimit                   string
	LengthCap                   int
	AutoDelete                  *AutoDeleteConfig
	Reports                     *ReportConfig
	File                        *FileConfig
	Postgres                    *PostgresConfig
	MongoDB                     *MongoDBConfig
	S3                          *S3Config
}

Config represents the general application configuration structure

var Current *Config

Current holds the currently loaded config

type FileConfig

type FileConfig struct {
	Path string
}

FileConfig represents the configuration specific for the file storage driver

type MongoDBConfig

type MongoDBConfig struct {
	DSN        string
	Database   string
	Collection string
}

MongoDBConfig represents the configuration specific for the MongoDB storage driver

type PostgresConfig

type PostgresConfig struct {
	DSN string
}

PostgresConfig represents the configuration specific for the Postgres storage driver

type ReportConfig

type ReportConfig struct {
	Reports            bool
	ReportWebhook      string
	ReportWebhookToken string
}

ReportConfig represents the configuration specific for the report system

type S3Config

type S3Config struct {
	Endpoint        string
	AccessKeyID     string
	SecretAccessKey string
	SecretToken     string
	Secure          bool
	Region          string
	Bucket          string
}

S3Config represents the configuration specific for the S3 storage driver

Jump to

Keyboard shortcuts

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