config

package
v0.0.0-...-14d2bb4 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConfig

func InitConfig(rootCmd *cobra.Command)

Types

type AuthBackend

type AuthBackend int64
const (
	None AuthBackend = iota
	Basic
)

type Config

type Config struct {
	BaseURL          string `mapstructure:"base_url"`
	Port             int
	DefaultRedirect  string `mapstructure:"default_redirect"`
	TerminalRedirect bool

	// TODO: Initialize backends outside of global config object
	// State
	StateBackend          StateBackend
	MongoConnectionString string `mapstructure:"mongo_uri"`

	BoltPath string `mapstructure:"bolt_path"`

	// Uploads
	UploadBackend   UploadBackend
	UploadDirectory string `mapstructure:"upload_directory"`

	// Auth
	AuthBackend   AuthBackend
	AdminUsername string `mapstructure:"admin_username"`
	AdminPassword string `mapstructure:"admin_password"`
}

func New

func New() *Config

type StateBackend

type StateBackend int64
const (
	MongoDB StateBackend = iota
)

type UploadBackend

type UploadBackend int64
const (
	Directory UploadBackend = iota
)

Jump to

Keyboard shortcuts

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