config

package
v1.76.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureConcurrencyLimits added in v0.43.0

func ConfigureConcurrencyLimits()

ConfigureConcurrencyLimits configures the per-repo, per RPC rate limits

func ConfigureLogging added in v0.11.0

func ConfigureLogging()

ConfigureLogging uses the global conf and environmental vars to configure log levels and format

func ConfigureRuby added in v0.60.0

func ConfigureRuby() error

ConfigureRuby validates the gitaly-ruby configuration and sets default values.

func GeneratedInternalSocketDir added in v1.75.0

func GeneratedInternalSocketDir() string

GeneratedInternalSocketDir returns the path to the generated internal socket directory

func GitalyInternalSocketPath added in v1.75.0

func GitalyInternalSocketPath() string

GitalyInternalSocketPath is the path to the internal gitaly socket

func InternalSocketDir added in v1.75.0

func InternalSocketDir() string

InternalSocketDir will generate a temp dir for internal sockets if one is not provided in the config

func Load

func Load(file io.Reader) error

Load initializes the Config variable from file and the environment.

Environment variables take precedence over the file.

func RegisterHook added in v1.46.0

func RegisterHook(f func(c Cfg) error)

RegisterHook adds a post-validation callback. Your hook should only access config via the Cfg instance it gets passed. This avoids race conditions during testing, when the global config.Config instance gets updated after these hooks have run.

func SetGitPath added in v0.18.0

func SetGitPath() error

SetGitPath populates the variable GitPath with the path to the `git` executable. It warns if no path was specified in the configuration.

func Validate added in v0.13.0

func Validate() error

Validate checks the current Config for sanity. It also runs all hooks registered with RegisterHook.

Types

type Cfg added in v1.47.0

type Cfg struct {
	SocketPath                 string            `toml:"socket_path" split_words:"true"`
	ListenAddr                 string            `toml:"listen_addr" split_words:"true"`
	TLSListenAddr              string            `toml:"tls_listen_addr" split_words:"true"`
	PrometheusListenAddr       string            `toml:"prometheus_listen_addr" split_words:"true"`
	BinDir                     string            `toml:"bin_dir"`
	Git                        Git               `toml:"git" envconfig:"git"`
	Storages                   []Storage         `toml:"storage" envconfig:"storage"`
	Logging                    Logging           `toml:"logging" envconfig:"logging"`
	Prometheus                 prometheus.Config `toml:"prometheus"`
	Auth                       auth.Config       `toml:"auth"`
	TLS                        TLS               `toml:"tls"`
	Ruby                       Ruby              `toml:"gitaly-ruby"`
	GitlabShell                GitlabShell       `toml:"gitlab-shell"`
	Concurrency                []Concurrency     `toml:"concurrency"`
	GracefulRestartTimeout     time.Duration
	GracefulRestartTimeoutToml duration `toml:"graceful_restart_timeout"`
	InternalSocketDir          string   `toml:"internal_socket_dir"`
}

Cfg is a container for all config derived from config.toml.

var (
	// Config stores the global configuration
	Config Cfg
)

func (Cfg) Storage added in v1.60.0

func (c Cfg) Storage(storageName string) (Storage, bool)

Storage looks up storageName.

func (Cfg) StoragePath added in v1.60.0

func (c Cfg) StoragePath(storageName string) (string, bool)

StoragePath looks up the base path for storageName. The second boolean return value indicates if anything was found.

type Concurrency added in v0.43.0

type Concurrency struct {
	RPC        string `toml:"rpc"`
	MaxPerRepo int    `toml:"max_per_repo"`
}

Concurrency allows endpoints to be limited to a maximum concurrency per repo

type Git added in v0.18.0

type Git struct {
	BinPath string `toml:"bin_path"`

	// ProtocolV2Enabled can be set to true to enable the newer Git protocol
	// version. This should not be enabled until GitLab *either* stops
	// using transfer.hideRefs for security purposes, *or* Git protocol v2
	// respects this setting:
	//
	// https://public-inbox.org/git/20181213155817.27666-1-avarab@gmail.com/T/
	//
	// This is not user-configurable. Once a new Git version has been released,
	// we can add code to enable it if the detected git binary is new enough
	ProtocolV2Enabled bool

	CatfileCacheSize int `toml:"catfile_cache_size"`
}

Git contains the settings for the Git executable

type GitlabShell added in v0.29.0

type GitlabShell struct {
	Dir string `toml:"dir"`
}

GitlabShell contains the settings required for executing `gitlab-shell`

type Logging added in v0.11.0

type Logging struct {
	internallog.Config
	Sentry

	RubySentryDSN string `toml:"ruby_sentry_dsn"`
}

Logging contains the logging configuration for Gitaly

type Ruby added in v0.26.0

type Ruby struct {
	Dir                        string `toml:"dir"`
	MaxRSS                     int    `toml:"max_rss"`
	GracefulRestartTimeout     time.Duration
	GracefulRestartTimeoutToml duration `toml:"graceful_restart_timeout"`
	RestartDelay               time.Duration
	RestartDelayToml           duration `toml:"restart_delay"`
	NumWorkers                 int      `toml:"num_workers"`
	LinguistLanguagesPath      string   `toml:"linguist_languages_path"`
	RuggedGitConfigSearchPath  string   `toml:"rugged_git_config_search_path"`
}

Ruby contains setting for Ruby worker processes

type Sentry added in v1.71.0

type Sentry sentry.Config

Sentry is a sentry.Config. We redefine this type to a different name so we can embed both structs into Logging

type Storage

type Storage struct {
	Name string
	Path string
}

Storage contains a single storage-shard

type TLS added in v1.5.0

type TLS struct {
	CertPath string `toml:"certificate_path"`
	KeyPath  string `toml:"key_path"`
}

TLS configuration

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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