config

package
v1.2.2-dev.40 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigurationStruct

type ConfigurationStruct struct {
	Writable     WritableInfo
	Logging      bootstrapConfig.LoggingInfo
	SecretsSetup SecretsSetupInfo
}

func (*ConfigurationStruct) EmptyWritablePtr

func (c *ConfigurationStruct) EmptyWritablePtr() interface{}

EmptyWritablePtr returns a pointer to a service-specific empty WritableInfo struct. It is used by the bootstrap to provide the appropriate structure to registry.Client's WatchForChanges().

func (*ConfigurationStruct) GetBootstrap

GetBootstrap returns the configuration elements required by the bootstrap. Currently, a copy of the configuration data is returned. This is intended to be temporary -- since ConfigurationStruct drives the configuration.toml's structure -- until we can make backwards-breaking configuration.toml changes (which would consolidate these fields into an bootstrapConfig.BootstrapConfiguration struct contained within ConfigurationStruct).

func (*ConfigurationStruct) GetDatabaseInfo

func (c *ConfigurationStruct) GetDatabaseInfo() map[string]bootstrapConfig.Database

GetDatabaseInfo returns a database information map.

func (*ConfigurationStruct) GetLogLevel

func (c *ConfigurationStruct) GetLogLevel() string

GetLogLevel returns the current ConfigurationStruct's log level.

func (*ConfigurationStruct) GetRegistryInfo

func (c *ConfigurationStruct) GetRegistryInfo() bootstrapConfig.RegistryInfo

GetRegistryInfo returns the RegistryInfo from the ConfigurationStruct.

func (*ConfigurationStruct) UpdateFromRaw

func (c *ConfigurationStruct) UpdateFromRaw(rawConfig interface{}) bool

UpdateFromRaw converts configuration received from the registry to a service-specific configuration struct which is then used to overwrite the service's existing configuration struct.

func (*ConfigurationStruct) UpdateWritableFromRaw

func (c *ConfigurationStruct) UpdateWritableFromRaw(rawWritable interface{}) bool

UpdateWritableFromRaw converts configuration received from the registry to a service-specific WritableInfo struct which is then used to overwrite the service's existing configuration's WritableInfo struct.

type KeyScheme

type KeyScheme struct {
	DumpKeys   string `json:"dump_keys"`
	RSA        string `json:"rsa"`
	RSAKeySize string `json:"rsa_key_size"`
	EC         string `json:"ec"`
	ECCurve    string `json:"ec_curve"`
}

KeyScheme parameters (RSA vs EC) RSA: 1024, 2048, 4096 EC: 224, 256, 384, 521

type RootCA

type RootCA struct {
	CAName     string `json:"ca_name"`
	CACountry  string `json:"ca_c"`
	CAState    string `json:"ca_st"`
	CALocality string `json:"ca_l"`
	CAOrg      string `json:"ca_o"`
}

RootCA parameters from JSON: x509_root_ca_parameters

type SecretsSetupInfo

type SecretsSetupInfo struct {
	WorkDir       string
	DeployDir     string
	CacheDir      string
	CertConfigDir string
}

type TLSServer

type TLSServer struct {
	TLSHost     string `json:"tls_host"`
	TLSDomain   string `json:"tls_domain"`
	TLSCountry  string `json:"tls_c"`
	TLSSate     string `json:"tls_st"`
	TLSLocality string `json:"tls_l"`
	TLSOrg      string `json:"tls_o"`
}

TLSServer parameters from JSON config: x509_tls_server_parameters

type WritableInfo

type WritableInfo struct {
	LogLevel string
}

type X509

type X509 struct {
	CreateNewRootCA string    `json:"create_new_rootca"`
	WorkingDir      string    `json:"working_dir"`
	PKISetupDir     string    `json:"pki_setup_dir"`
	DumpConfig      string    `json:"dump_config"`
	KeyScheme       KeyScheme `json:"key_scheme"`
	RootCA          RootCA    `json:"x509_root_ca_parameters"`
	TLSServer       TLSServer `json:"x509_tls_server_parameters"`
}

X509 JSON config file main structure

func NewX509

func NewX509(configFilePtr string) (X509, error)

NewX509 will populate a struct representing configuration for X.509 key generation

func (X509) GetCAPemFileName

func (cfg X509) GetCAPemFileName() string

GetCAPemFileName returns the file name of CA certificate

func (X509) GetCAPrivateKeyFileName

func (cfg X509) GetCAPrivateKeyFileName() string

GetCAPrivateKeyFileName returns the file name of CA private key

func (X509) GetTLSPemFileName

func (cfg X509) GetTLSPemFileName() string

GetTLSPemFileName returns the file name of TLS certificate

func (X509) GetTLSPrivateKeyFileName

func (cfg X509) GetTLSPrivateKeyFileName() string

GetTLSPrivateKeyFileName returns the file name of TLS private key

func (X509) PkiCADir

func (cfg X509) PkiCADir() (string, error)

PkiCADir returns the pkisetup root CA dir

Jump to

Keyboard shortcuts

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