config

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aptly added in v0.13.0

type Aptly struct {
	APIURL            *url.URL `toml:"api_url"`
	RepositoryBaseURL *url.URL `toml:"repository_base_url"`
}

Aptly holds configuration related to aptly

type AuthConfig

type AuthConfig struct {
	AuthentificationBackend string       `toml:"backend"`
	OAuth                   *OAuthConfig `toml:"oauth"`
}

AuthConfig holds configuration related to the authentification backend

type Config

type Config struct {
	DB                    *DBConfig         `toml:"database"`
	HTTP                  *HTTPServerConfig `toml:"http"`
	Auth                  *AuthConfig       `toml:"authentication"`
	ServerURL             *url.URL          `toml:"server_url"`
	Aptly                 *Aptly            `toml:"aptly"`
	DataDirectory         string            `toml:"data_directory"`
	TemplatesDirectory    string            `toml:"templates_directory"`
	StaticFilesDirectory  string            `toml:"static_files_directory"`
	TemplatesCacheEnabled bool              `toml:"templates_cache_enabled"`
	LogLevel              log.Level         `toml:"log_level"`
}

Config holds configuration that is needed by Server to initialize all of its dependencies.

func ParseConfig added in v0.9.0

func ParseConfig(filepath string, fs filesystem.FS) (*Config, error)

ParseConfig parses a configuration file to create a server config

type DBConfig

type DBConfig struct {
	Driver           string `toml:"driver"`
	ConnectionString string `toml:"connection_string"`
}

DBConfig holds configuration related to the database

type HTTPServerConfig

type HTTPServerConfig struct {
	Address string `toml:"address"`
}

HTTPServerConfig holds configuration related to the HTTP server

type OAuthConfig

type OAuthConfig struct {
	Provider     string `toml:"provider"`
	BaseURL      string `toml:"base_url"`
	ClientID     string `toml:"client_id"`
	ClientSecret string `toml:"client_secret"`
}

OAuthConfig holds configuration related to the OAuth provider

Jump to

Keyboard shortcuts

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