Documentation
¶
Index ¶
- Variables
- type Config
- func (c *Config) Get(key string) interface{}
- func (c *Config) GetAppName() string
- func (c *Config) GetBool(key string) bool
- func (c *Config) GetDatabaseDriver() string
- func (c *Config) GetFloat64(key string) float64
- func (c *Config) GetInt(key string) int
- func (c *Config) GetInt64(key string) int64
- func (c *Config) GetLogFormat() string
- func (c *Config) GetLogLevel() string
- func (c *Config) GetPassswordBcryptCost() int
- func (c *Config) GetServerGrpcPort() int64
- func (c *Config) GetServerHttpCorsAllowCredentials() bool
- func (c *Config) GetServerHttpCorsAllowHeaders() []string
- func (c *Config) GetServerHttpCorsAllowMethods() []string
- func (c *Config) GetServerHttpCorsAllowOrigins() []string
- func (c *Config) GetServerHttpCorsDefaultAllow() bool
- func (c *Config) GetServerHttpPort() int64
- func (c *Config) GetString(key string) string
- func (c *Config) GetStringSlice(key string) []string
- func (c *Config) IsDebug() bool
Constants ¶
This section is empty.
Variables ¶
var ConfigModule = fx.Module("liquor-config", fx.Provide(
readConfigFile,
))
ConfigModule enable the config (is required)
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func (*Config) Get ¶
Get retrieves a configuration value by its key as an interface{}.
Parameters: - key: The key identifying the configuration value.
Returns: - The value associated with the key as an interface{}.
func (*Config) GetAppName ¶
GetAppName retrieves the name of the application from the configuration.
Returns: - The application name as a string.
func (*Config) GetBool ¶
GetBool retrieves a configuration value by its key as a bool.
Parameters: - key: The key identifying the configuration value.
Returns: - The value associated with the key as a bool.
func (*Config) GetDatabaseDriver ¶
GetDatabaseDriver retrieves the database driver name from the configuration.
Returns: - The database driver name as a string.
func (*Config) GetFloat64 ¶
GetFloat64 retrieves a configuration value by its key as a float64.
Parameters: - key: The key identifying the configuration value.
Returns: - The value associated with the key as a float64.
func (*Config) GetInt ¶
GetInt retrieves a configuration value by its key as an int.
Parameters: - key: The key identifying the configuration value.
Returns: - The value associated with the key as an int.
func (*Config) GetInt64 ¶
GetInt64 retrieves a configuration value by its key as an int64.
Parameters: - key: The key identifying the configuration value.
Returns: - The value associated with the key as an int64.
func (*Config) GetLogFormat ¶
GetLogFormat retrieves the log format from the configuration.
Returns: - The log format as a string (can be json, console).
func (*Config) GetLogLevel ¶
GetLogLevel retrieves the log level from the configuration.
Returns: - The log level as a string (can be info,warn,error,debug).
func (*Config) GetPassswordBcryptCost ¶
GetPassswordBcryptCost retrieves the bcrypt cost for password hashing.
Returns: - The bcrypt cost as an int.
func (*Config) GetServerGrpcPort ¶
GetServerGrpcPort retrieves the gRPC server port from the configuration.
Returns: - The gRPC server port as an int64.
func (*Config) GetServerHttpCorsAllowCredentials ¶
GetServerHttpCorsAllowCredentials checks if credentials are allowed in CORS requests for the HTTP server.
Returns: - true if credentials are allowed, false otherwise.
func (*Config) GetServerHttpCorsAllowHeaders ¶
GetServerHttpCorsAllowHeaders retrieves the list of allowed headers for CORS on the HTTP server.
Returns: - A slice of strings containing the allowed headers.
func (*Config) GetServerHttpCorsAllowMethods ¶
GetServerHttpCorsAllowMethods retrieves the list of allowed HTTP methods for CORS on the HTTP server.
Returns: - A slice of strings containing the allowed HTTP methods.
func (*Config) GetServerHttpCorsAllowOrigins ¶
GetServerHttpCorsAllowOrigins retrieves the list of allowed origins for CORS on the HTTP server.
Returns: - A slice of strings containing the allowed origins.
func (*Config) GetServerHttpCorsDefaultAllow ¶
GetServerHttpCorsDefaultAllow checks if CORS is enabled by default for the HTTP server.
Returns: - true if CORS is enabled by default, false otherwise.
func (*Config) GetServerHttpPort ¶
GetServerHttpPort retrieves the HTTP server port from the configuration.
Returns: - The HTTP server port as an int64.
func (*Config) GetString ¶
GetString retrieves a configuration value by its key as a string.
Parameters: - key: The key identifying the configuration value.
Returns: - The value associated with the key as a string.
func (*Config) GetStringSlice ¶
GetStringSlice retrieves a configuration value by its key as a list of string.
Parameters: - key: The key identifying the configuration value.
Returns: - The value associated with the key as a list of string.