Documentation
¶
Index ¶
- func CorsOptions(clientOriginUrl string) cors.Options
- func GetConfigOpt(log *zap.Logger, v *viper.Viper) (*RedisOptions, *MailerOptions, *ServerOptions, *GrpcServerOptions, ...)
- func GetViper() (*viper.Viper, error)
- func InitTracerProvider() (*sdktrace.TracerProvider, error)
- func SecureOptions() secure.Options
- func SetUpLogging(logPath string) *zap.Logger
- type DBOptions
- type GrpcServerOptions
- type JWTOptions
- type LogOptions
- type MailerOptions
- type OauthOptions
- type RateOptions
- type RedisOptions
- type ServerOptions
- type UptraceOptions
- type UserOptions
- type UserTestOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CorsOptions ¶
func GetConfigOpt ¶
func GetConfigOpt(log *zap.Logger, v *viper.Viper) (*RedisOptions, *MailerOptions, *ServerOptions, *GrpcServerOptions, *OauthOptions, *UserOptions, *UptraceOptions)
GetConfigOpt -- Get db, redis, mailer, grpc, jwt, oauth, user, tracer
func InitTracerProvider ¶
func InitTracerProvider() (*sdktrace.TracerProvider, error)
InitTracerProvider - configures an OpenTelemetry exporter and trace provider.
func SecureOptions ¶
Types ¶
type DBOptions ¶
type DBOptions struct {
DB string `mapstructure:"db"`
Host string `mapstructure:"hostname"`
Port string `mapstructure:"port"`
User string `mapstructure:"user"`
Password string `mapstructure:"password"`
Schema string `mapstructure:"db_schema"`
LimitSQLRows string `mapstructure:"limit_sql_rows"`
MySQLTestFilePath string `mapstructure:"mysql_test_file_path"`
MySQLSchemaFilePath string `mapstructure:"mysql_schema_file_path"`
MySQLTruncateFilePath string `mapstructure:"mysql_truncate_file_path"`
PgSQLTestFilePath string `mapstructure:"pgsql_test_file_path"`
PgSQLSchemaFilePath string `mapstructure:"pgsql_schema_file_path"`
PgSQLTruncateFilePath string `mapstructure:"pgsql_truncate_file_path"`
}
DBOptions - for db config
func GetDbConfig ¶
func GetDbConfig(log *zap.Logger, v *viper.Viper, isTest bool, db string, dbHost string, dbPort string, dbUser string, dbPassword string, dbSchema string, dbMysqlTestFilePath string, dbMysqlSchemaFilePath string, dbMysqlTruncateFilePath string, dbPgsqlTestFilePath string, dbPgsqlSchemaFilePath string, dbPgsqlTruncateFilePath string) (*DBOptions, error)
GetDbConfig -- read DB config options
type GrpcServerOptions ¶
type GrpcServerOptions struct {
GrpcUserServerPort string `mapstructure:"grpc_user_server_port"`
GrpcPartyServerPort string `mapstructure:"grpc_party_server_port"`
GrpcBkgServerPort string `mapstructure:"grpc_bkg_server_port"`
GrpcEblServerPort string `mapstructure:"grpc_ebl_server_port"`
GrpcEventCoreServerPort string `mapstructure:"grpc_event_core_server_port"`
GrpcJitServerPort string `mapstructure:"grpc_jit_server_port"`
GrpcOvsServerPort string `mapstructure:"grpc_ovs_server_port"`
GrpcTntServerPort string `mapstructure:"grpc_tnt_server_port"`
GrpcSearchServerPort string `mapstructure:"grpc_search_server_port"`
GrpcCaCertPath string `mapstructure:"grpc_ca_cert_path"`
GrpcCertPath string `mapstructure:"grpc_cert_path"`
GrpcKeyPath string `mapstructure:"grpc_key_path"`
}
GrpcServerOptions - for grpc server config
func GetGrpcServerConfig ¶
GetGrpcServerConfig -- read grpc server config options
type JWTOptions ¶
JWTOptions - for JWT config
type LogOptions ¶
type LogOptions struct {
Path string `mapstructure:"log_file_path"`
UserPath string `mapstructure:"log_user_file_path"`
PartyPath string `mapstructure:"log_party_file_path"`
BkgPath string `mapstructure:"log_bkg_file_path"`
EblPath string `mapstructure:"log_ebl_file_path"`
EventCorePath string `mapstructure:"log_event_core_file_path"`
JitPath string `mapstructure:"log_jit_file_path"`
OvsPath string `mapstructure:"log_ovs_file_path"`
TntPath string `mapstructure:"log_tnt_file_path"`
SearchPath string `mapstructure:"log_search_file_path"`
Level string `mapstructure:"log_level"`
}
LogOptions - for logging
func GetLogConfig ¶
func GetLogConfig(v *viper.Viper) (*LogOptions, error)
GetLogConfig -- read log config options
type MailerOptions ¶
type MailerOptions struct {
User string `mapstructure:"username"`
Password string `mapstructure:"password"`
Port int `mapstructure:"port"`
Server string `mapstructure:"server"`
}
MailerOptions - for mailer config
func GetMailerConfig ¶
GetMailerConfig -- read mailer config options
type OauthOptions ¶
type OauthOptions struct {
ClientID string `mapstructure:"client_id"`
ClientSecret string `mapstructure:"client_secret"`
}
OauthOptions - for oauth config
func GetOauthConfig ¶
GetOauthConfig -- read oauth config options
type RateOptions ¶
type RateOptions struct {
UMaxRate int `mapstructure:"u_max_rate"`
UMaxBurst int `mapstructure:"u_max_burst"`
UserMaxRate int `mapstructure:"user_max_rate"`
UserMaxBurst int `mapstructure:"user_max_burst"`
PartyMaxRate int `mapstructure:"party_max_rate"`
PartyMaxBurst int `mapstructure:"party_max_burst"`
BkgMaxRate int `mapstructure:"bkg_max_rate"`
BkgMaxBurst int `mapstructure:"bkg_max_burst"`
SearchMaxRate int `mapstructure:"search_max_rate"`
SearchMaxBurst int `mapstructure:"search_max_burst"`
EblMaxRate int `mapstructure:"ebl_max_rate"`
EblMaxBurst int `mapstructure:"ebl_max_burst"`
EventCoreMaxRate int `mapstructure:"event_core_max_rate"`
EventCoreMaxBurst int `mapstructure:"event_core_max_burst"`
JitMaxRate int `mapstructure:"jit_max_rate"`
JitMaxBurst int `mapstructure:"jit_max_burst"`
OvsMaxRate int `mapstructure:"ovs_max_rate"`
OvsMaxBurst int `mapstructure:"ovs_max_burst"`
TntMaxRate int `mapstructure:"tnt_max_rate"`
TntMaxBurst int `mapstructure:"tnt_max_burst"`
}
RateOptions - for rate limiting requests
func GetRateConfig ¶
GetRateConfig -- read rate config options
type RedisOptions ¶
type RedisOptions struct {
Addr string `mapstructure:"addr"`
}
RedisOptions - for redis config
func GetRedisConfig ¶
GetRedisConfig -- read redis config options
type ServerOptions ¶
type ServerOptions struct {
ServerAddr string `mapstructure:"server_addr"`
ServerTLS string `mapstructure:"server_tls"`
CaCertPath string `mapstructure:"ca_cert_path"`
CertPath string `mapstructure:"cert_path"`
KeyPath string `mapstructure:"key_path"`
ClientOriginUrl string `mapstructure:"client_original_url"`
Auth0Audience string `mapstructure:"auth0_audience"`
Auth0Domain string `mapstructure:"auth0_domain"`
Auth0ClientId string `mapstructure:"auth0_client_id"`
Auth0Connection string `mapstructure:"auth0_connection"`
Auth0MgmtToken string `mapstructure:"auth0_mgmt_token"`
Auth0ApiId string `mapstructure:"auth0_api_id"`
}
ServerOptions - for server config
func GetServerConfig ¶
GetServerConfig -- read server config options
type UptraceOptions ¶
type UptraceOptions struct {
Dsn string `mapstructure:"dsn"`
}
UptraceOptions - for uptrace config
func GetUptraceConfig ¶
GetUptraceConfig -- read Uptrace config options
type UserOptions ¶
type UserOptions struct {
ConfirmTokenDuration string `mapstructure:"confirm_token_duration"`
ResetTokenDuration string `mapstructure:"reset_token_duration"`
}
UserOptions - for user login
func GetUserConfig ¶
GetUserConfig -- read user config options
type UserTestOptions ¶
type UserTestOptions struct {
// Email string `mapstructure:"email"`
// Password string `mapstructure:"password"`
RequestId string `mapstructure:"request_id"`
Tokenstring string `mapstructure:"tokenstring"`
}
UserTestOptions - for test user login
func GetUserTestConfig ¶
GetUserTestConfig -- read user test config options