config

package
v0.0.0-...-018c514 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConfigTemplate = `` /* 472-byte string literal not displayed */

DefaultConfigTemplate defines the configuration template.

View Source
const (
	// DefaultGRPCAddress is the default address the gRPC server binds to.
	DefaultGRPCAddress = "0.0.0.0:9900"
)

Variables

This section is empty.

Functions

func AppConfig

func AppConfig(denom string) (customAppTemplate string, customAppConfig interface{})

AppConfig helps to override default appConfig template and configs. return "", nil if no custom configuration is required for the application.

Types

type Config

type Config struct {
	config.Config
	TLS TLSConfig `mapstructure:"tls"`
}

Config defines the server's top level configuration. It includes the default app config from the SDK as well as the TLS configuration.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns server's default configuration.

func GetConfig

func GetConfig(v *viper.Viper) Config

GetConfig returns a fully parsed Config object.

func ParseConfig

func ParseConfig(v *viper.Viper) (*Config, error)

ParseConfig retrieves the default environment configuration for the application.

func (Config) ValidateBasic

func (c Config) ValidateBasic() error

ValidateBasic returns an error any of the application configuration fields are invalid.

type TLSConfig

type TLSConfig struct {
	// CertificatePath the file path for the certificate .pem file
	CertificatePath string `mapstructure:"certificate-path"`
	// KeyPath the file path for the key .pem file
	KeyPath string `mapstructure:"key-path"`
}

TLSConfig defines the certificate and matching private key for the server.

func DefaultTLSConfig

func DefaultTLSConfig() *TLSConfig

DefaultTLSConfig returns the default TLS configuration.

func (TLSConfig) Validate

func (c TLSConfig) Validate() error

Validate returns an error if the TLS certificate and key file extensions are invalid.

Jump to

Keyboard shortcuts

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