config

package
v0.1.35 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLoggerConfig

func NewLoggerConfig(configPath Path, overrides Overrider) (*logger.Config, error)

NewLoggerConfig creates a new LoggerConfig

Types

type CITemplatesConfig

type CITemplatesConfig struct {
	Server            string `json:"server" yaml:"server"`
	Organization      string `json:"organization" yaml:"organization"`
	Tag               string `json:"tag" yaml:"tag"`
	CreateRepoTimeout int    `json:"create_repo_timeout" yaml:"create_repo_timeout"`
}

type Config

type Config struct {
	FileStoreRoot    string                 `json:"file_store_root" yaml:"file_store_root"`
	DefaultDomain    string                 `json:"default_domain" yaml:"default_domain"`
	Logging          logger.Config          `json:"logging" yaml:"logging"`
	CA               []string               `json:"ca" yaml:"ca"`
	Insecure         bool                   `json:"insecure" yaml:"insecure"`
	TokenDefaults    map[string]string      `json:"token_defaults" yaml:"token_defaults"`
	CITemplates      CITemplatesConfig      `json:"ci_templates" yaml:"ci_templates"`
	ContentTemplates ContentTemplatesConfig `json:"content_templates" yaml:"content_templates"`

	Servers map[string]ServerCredentials `json:"-" yaml:"-"`
}

Config holds the configuration for the app.

func NewConfig

func NewConfig(configPath Path, log *zerolog.Logger, overrides Overrider, certsGenerator *certs.Generator) (*Config, error)

NewConfig creates the configuration by reading env & files

func (*Config) LoadCreds

func (c *Config) LoadCreds() error

func (*Config) PoliciesRoot

func (c *Config) PoliciesRoot() string

func (*Config) ReplHistoryFile

func (c *Config) ReplHistoryFile() string

func (*Config) SaveCreds

func (c *Config) SaveCreds() error

type ContentTemplatesConfig

type ContentTemplatesConfig struct {
	Server       string `json:"server" yaml:"server"`
	Organization string `json:"organization" yaml:"organization"`
	Tag          string `json:"tag" yaml:"tag"`
}

type Overrider

type Overrider func(*Config)

Overrider is a func that mutates configuration

type Path

type Path string

Path is a string that points to a config file

type ServerCredentials

type ServerCredentials struct {
	Type     string `json:"type" yaml:"type"`
	Username string `json:"username" yaml:"username"`
	Password string `json:"password" yaml:"password"`
	Default  bool   `json:"default" yaml:"default"`
}

Jump to

Keyboard shortcuts

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