config

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: MIT Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func (c *Config) Get(key string) interface{}

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

func (c *Config) GetAppName() string

GetAppName retrieves the name of the application from the configuration.

Returns: - The application name as a string.

func (*Config) GetBool

func (c *Config) GetBool(key string) bool

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

func (c *Config) GetDatabaseDriver() string

GetDatabaseDriver retrieves the database driver name from the configuration.

Returns: - The database driver name as a string.

func (*Config) GetFloat64

func (c *Config) GetFloat64(key string) float64

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

func (c *Config) GetInt(key string) int

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

func (c *Config) GetInt64(key string) int64

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

func (c *Config) GetLogFormat() string

GetLogFormat retrieves the log format from the configuration.

Returns: - The log format as a string (can be json, console).

func (*Config) GetLogLevel

func (c *Config) GetLogLevel() string

GetLogLevel retrieves the log level from the configuration.

Returns: - The log level as a string (can be info,warn,error,debug).

func (*Config) GetPassswordBcryptCost

func (c *Config) GetPassswordBcryptCost() int

GetPassswordBcryptCost retrieves the bcrypt cost for password hashing.

Returns: - The bcrypt cost as an int.

func (*Config) GetServerGrpcPort

func (c *Config) GetServerGrpcPort() int64

GetServerGrpcPort retrieves the gRPC server port from the configuration.

Returns: - The gRPC server port as an int64.

func (*Config) GetServerHttpCorsAllowCredentials

func (c *Config) GetServerHttpCorsAllowCredentials() bool

GetServerHttpCorsAllowCredentials checks if credentials are allowed in CORS requests for the HTTP server.

Returns: - true if credentials are allowed, false otherwise.

func (*Config) GetServerHttpCorsAllowHeaders

func (c *Config) GetServerHttpCorsAllowHeaders() []string

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

func (c *Config) GetServerHttpCorsAllowMethods() []string

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

func (c *Config) GetServerHttpCorsAllowOrigins() []string

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

func (c *Config) GetServerHttpCorsDefaultAllow() bool

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

func (c *Config) GetServerHttpPort() int64

GetServerHttpPort retrieves the HTTP server port from the configuration.

Returns: - The HTTP server port as an int64.

func (*Config) GetString

func (c *Config) GetString(key string) string

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

func (c *Config) GetStringSlice(key string) []string

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.

func (*Config) IsDebug

func (c *Config) IsDebug() bool

IsDebug checks whether the application is in debug mode.

Returns: - true if the application is in debug mode, false otherwise.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳