config

package
v1.5.5-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Hostname    string `env:"HOSTNAME,required"`
	Development bool   `env:"DEVELOPMENT,default=false"`
	// LogLevel string `env:"LOG_LEVEL,default=info"`
	Http HttpConfig
}

func ParseServerConfiguration

func ParseServerConfiguration(ctx context.Context, logger *logrus.Logger) *Config

type Dependencies

type Dependencies struct {
	Log      *logrus.Logger
	Database database.DB
	Config   *Config
	Domains  struct {
		Auth     domains.AccountsDomain
		Archiver domains.ArchiverDomain
	}
}

func NewDependencies

func NewDependencies(log *logrus.Logger, db database.DB, cfg *Config) *Dependencies

type HttpConfig

type HttpConfig struct {
	Enabled   bool   `env:"HTTP_ENABLED,default=True"`
	Port      int    `env:"HTTP_PORT,default=8080"`
	Address   string `env:"HTTP_ADDRESS,default=:"`
	RootPath  string `env:"HTTP_ROOT_PATH,default=/"`
	AccessLog bool   `env:"HTTP_ACCESS_LOG,default=True"`
	SecretKey string `env:"HTTP_SECRET_KEY"`
	// Fiber Specific
	BodyLimit                    int           `env:"HTTP_BODY_LIMIT,default=1024"`
	ReadTimeout                  time.Duration `env:"HTTP_READ_TIMEOUT,default=10s"`
	WriteTimeout                 time.Duration `env:"HTTP_WRITE_TIMEOUT,default=10s"`
	IDLETimeout                  time.Duration `env:"HTTP_IDLE_TIMEOUT,default=10s"`
	DisableKeepAlive             bool          `env:"HTTP_DISABLE_KEEP_ALIVE,default=true"`
	DisablePreParseMultipartForm bool          `env:"HTTP_DISABLE_PARSE_MULTIPART_FORM,default=true"`
	Routes                       struct {
		Bookmark struct {
			Path string `env:"ROUTES_BOOKMARK_PATH,default=/bookmark"`
		}
		Frontend struct {
			Path   string        `env:"ROUTES_STATIC_PATH,default=/"`
			MaxAge time.Duration `env:"ROUTES_STATIC_MAX_AGE,default=720h"`
		}
		System struct {
			Path string `env:"ROUTES_SYSTEM_PATH,default=/system"`
		}
		API struct {
			Path string `env:"ROUTE_API_PATH,default=/api/v1"`
		}
	}
	Storage struct {
		DataDir string `env:"DATA_DIR"`
	}
}

Jump to

Keyboard shortcuts

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