config

package
v0.0.0-...-1f6db0e Latest Latest
Warning

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

Go to latest
Published: Dec 14, 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()

Types

type AuthBackend

type AuthBackend struct {
	Basic *BasicAuthBackendOptions `yaml:"basic,omitempty"`
}

type BasicAuthBackendOptions

type BasicAuthBackendOptions struct {
	Username string `mapstructure:"username" yaml:"username"`
	Password string `mapstructure:"password" yaml:"password"`
}

type BoltStateBackendOptions

type BoltStateBackendOptions struct {
	Path string `mapstructure:"path" yaml:"path"`
}

type Config

type Config struct {
	Host               string `mapstructure:"host" yaml:"host,omitempty"`
	Port               int    `yaml:"port"`
	DefaultRedirect    string `mapstructure:"default_redirect" yaml:"default_redirect,omitempty"`
	DefaultRedirectSsl bool   `mapstructure:"default_redirect_ssl" yaml:"default_redirect_ssl,omitempty"`

	// Curl-able homepage
	DefaultTerminalString string `mapstructure:"default_terminal_string" yaml:"default_terminal_string"`

	// TODO: Initialize backends outside of global config object
	// State
	StateBackend *StateBackend `mapstructure:"state" yaml:"state"`

	// Uploads
	UploadBackend *UploadBackend `mapstructure:"uploads" yaml:"uploads"`

	// Auth
	AuthBackend *AuthBackend `mapstructure:"auth" yaml:"auth,omitempty"`

	// Tracker Removal
	RemoveQueryParametersMatchingHosts *[]string `mapstructure:"remove_query_parameters_matching_hosts" yaml:"remove_query_parameters_matching_hosts,omitempty"`
	ResolveURLMatchingHosts            *[]string `mapstructure:"resolve_urls_matching_hosts" yaml:"resolve_urls_matching_hosts,omitempty"`
}

func New

func New() *Config

type DirectoryUploadBackendOptions

type DirectoryUploadBackendOptions struct {
	Path string `yaml:"path"`
}

type MongoStateBackendOptions

type MongoStateBackendOptions struct {
	ConnectionString string `mapstructure:"connection_string" yaml:"connection_string"`
}

type StateBackend

type StateBackend struct {
	Mongo *MongoStateBackendOptions `mapstructure:"mongodb" yaml:"mongodb,omitempty"`
	Bolt  *BoltStateBackendOptions  `mapstructure:"bolt" yaml:"bolt,omitempty"`
}

type StateBackendOptions

type StateBackendOptions interface {
	MongoStateBackendOptions | BoltStateBackendOptions
}

type UploadBackend

type UploadBackend struct {
	Directory *DirectoryUploadBackendOptions `mapstructure:"directory" yaml:"directory,omitempty"`
}

Jump to

Keyboard shortcuts

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