config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: Apache-2.0 Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host                    string                    `yaml:"host"`
	Port                    int                       `yaml:"port"`
	GRPCPort                int                       `yaml:"grpc_port"`
	ProfileHost             string                    `yaml:"profile_host"`
	ProfilePort             int                       `yaml:"profile_port"`
	Dir                     string                    `yaml:"dir"`
	MaxSize                 int                       `yaml:"max_size"`
	HtpasswdFile            string                    `yaml:"htpasswd_file"`
	TLSCertFile             string                    `yaml:"tls_cert_file"`
	TLSKeyFile              string                    `yaml:"tls_key_file"`
	S3CloudStorage          *S3CloudStorageConfig     `yaml:"s3_proxy"`
	GoogleCloudStorage      *GoogleCloudStorageConfig `yaml:"gcs_proxy"`
	HTTPBackend             *HTTPBackendConfig        `yaml:"http_proxy"`
	IdleTimeout             time.Duration             `yaml:"idle_timeout"`
	DisableHTTPACValidation bool                      `yaml:"disable_http_ac_validation"`
	DisableGRPCACDepsCheck  bool                      `yaml:"disable_grpc_ac_deps_check"`
	EnableEndpointMetrics   bool                      `yaml:"enable_endpoint_metrics"`
}

Config holds the top-level configuration for bazel-remote.

func New

func New(dir string, maxSize int, host string, port int, grpcPort int,
	profileHost string, profilePort int, htpasswdFile string,
	tlsCertFile string, tlsKeyFile string, idleTimeout time.Duration,
	s3 *S3CloudStorageConfig, disableHTTPACValidation bool,
	disableGRPCACDepsCheck bool, enableEndpointMetrics bool) (*Config, error)

New returns a validated Config with the specified values, and an error if there were any problems with the validation.

func NewFromYamlFile

func NewFromYamlFile(path string) (*Config, error)

NewFromYamlFile reads configuration settings from a YAML file then returns a validated Config with those settings, and an error if there were any problems.

type GoogleCloudStorageConfig

type GoogleCloudStorageConfig struct {
	Bucket                string `yaml:"bucket"`
	UseDefaultCredentials bool   `yaml:"use_default_credentials"`
	JSONCredentialsFile   string `yaml:"json_credentials_file"`
}

GoogleCloudStorageConfig stores the configuration of a GCS proxy backend.

type HTTPBackendConfig

type HTTPBackendConfig struct {
	BaseURL string `yaml:"url"`
}

HTTPBackendConfig stores the configuration for a HTTP proxy backend.

type S3CloudStorageConfig

type S3CloudStorageConfig struct {
	Endpoint        string `yaml:"endpoint"`
	Bucket          string `yaml:"bucket"`
	Prefix          string `yaml:"prefix"`
	AccessKeyID     string `yaml:"access_key_id"`
	SecretAccessKey string `yaml:"secret_access_key"`
	DisableSSL      bool   `yaml:"disable_ssl"`
	IAMRoleEndpoint string `yaml:"iam_role_endpoint"`
	Region          string `yaml:"region"`
}

S3CloudStorageConfig stores the configuration of an S3 API proxy backend.

Jump to

Keyboard shortcuts

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