config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CacheDirSubDirName string = ".hakjctl"
	TokenCacheFileName string = "._hakjctl_token_cache___"

	// ConfigKeyHost is the configuration key for host.
	ConfigKeyHost string = "host"
	// ConfigKeyPort is the configuration key for port.
	ConfigKeyPort string = "port"
	// ConfigKeyDatabase is the configuration key for default database.
	ConfigKeyDatabase string = "default_db"
	// ConfigKeyTlsCertPath is the configuration key for TLS client certificate path.
	ConfigKeyTLSClientCertPath string = "tls_client_cert_path"
	// ConfigKeyTLSClientKeyPath is the configuration key for TLS client key path.
	ConfigKeyTLSClientKeyPath string = "tls_client_key_path"
	// ConfigKeyTLSCACertPath is the configuration key for TLS CA certificate path.
	ConfigKeyTLSCACertPath string = "tls_ca_cert_path"
	// ConfigKeyCommandTimeout is the configuration key for setting command timeout.
	ConfigKeyCommandTimeout string = "command_timeout"

	// EnvPrefix is the prefix for environment variables.
	EnvPrefix string = "HAKJCTL"
	// EnvVarPassword is the environment variable for password.
	EnvVarPassword string = EnvPrefix + "_PASSWORD"

	// DefaultDatabase is the name of the default database to use.
	DefaultDatabase string = "default"
	// DefaultCommandTimeout is the default command timeout in seconds.
	DefaultCommandTimeout uint32 = 10
)

Variables

This section is empty.

Functions

func GetCmdTimeout

func GetCmdTimeout() time.Duration

GetCmdTimeout gets the configured command timeout. Command timeout is the maximum number of seconds to wait before a request is cancelled.

func GetDefaultDB added in v1.2.0

func GetDefaultDB() string

func GetHost added in v1.2.0

func GetHost() string

func GetPort added in v1.2.0

func GetPort() uint16

func InitCfgRegistry added in v1.2.0

func InitCfgRegistry()

func InitConfig

func InitConfig()

InitConfig initializes and loads configurations.

func LookupTLSCACert added in v1.1.0

func LookupTLSCACert() (string, bool)

The returned string is the file path. The returned bool is true if the path is set.

func LookupTLSClientCert added in v1.1.0

func LookupTLSClientCert() (string, bool)

The returned string is the file path. The returned bool is true if the path is set.

func LookupTLSClientKey added in v1.1.0

func LookupTLSClientKey() (string, bool)

The returned string is the file path. The returned bool is true if the path is set.

func SetDefaultDB added in v1.2.0

func SetDefaultDB(name string)

func SetHost added in v1.2.0

func SetHost(host string)

func SetPort added in v1.2.0

func SetPort(port uint16)

func WriteFile added in v1.2.0

func WriteFile() error

Types

This section is empty.

Jump to

Keyboard shortcuts

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