Documentation
¶
Index ¶
- Constants
- func Censor(text string, replace string) string
- func CensorPart(text string, show int) string
- func ConnectDb(uri string) *gorm.DB
- func ConnectDbCluster(config *Config) (*gorm.DB, *gorm.DB)
- func MaxInt(x, y int) int
- func MinInt(x, y int) int
- func NewLogger(prod bool) *zap.SugaredLogger
- type Config
Constants ¶
View Source
const AppEnvDev string = "dev"
View Source
const AppEnvProd string = "prod"
View Source
const WebhookModeAnonymous string = "anonymous"
View Source
const WebhookModeRestricted string = "restricted"
Variables ¶
This section is empty.
Functions ¶
func CensorPart ¶ added in v0.0.2
func NewLogger ¶
func NewLogger(prod bool) *zap.SugaredLogger
Types ¶
type Config ¶
type Config struct {
IsProd bool
AppEnv string `mapstructure:"SCRAP_APP_ENV"`
ApVersion string `mapstructure:"SCRAP_APP_VERSION"`
AppPort string `mapstructure:"SCRAP_APP_PORT"`
DBUriMaster string `mapstructure:"SCRAP_DB_URI_MASTER"`
DBUriReplicas string `mapstructure:"SCRAP_DB_URI_REPLICAS"`
MQUri string `mapstructure:"SCRAP_MQ_URI"`
MQExchangeName string `mapstructure:"SCRAP_MQ_EXCHANGE_NAME"`
MQQueueName string `mapstructure:"SCRAP_MQ_QUEUE_NAME"`
CacheUri string `mapstructure:"SCRAP_CACHE_URI"`
CacheDb int `mapstructure:"SCRAP_CACHE_DB"`
CacheExpirySeconds int `mapstructure:"SCRAP_CACHE_EXPIRY_SECONDS"`
RedLockExpirySeconds int `mapstructure:"SCRAP_REDLOCK_EXPIRY_SECONDS"`
QueryLimit int `mapstructure:"SCRAP_QUERY_LIMIT"`
QueryLimitMax int `mapstructure:"SCRAP_QUERY_LIMIT_MAX"`
WebhookMode string `mapstructure:"SCRAP_WEBHOOK_MODE"`
WebhookAuthToken string `mapstructure:"SCRAP_WEBHOOK_AUTH_TOKEN"`
WebhookVerifyTokenField string `mapstructure:"SCRAP_WEBHOOK_VERIFY_TOKEN_FIELD"`
WebhookVerifyTokenValue string `mapstructure:"SCRAP_WEBHOOK_VERIFY_TOKEN_VALUE"`
WebhookVerifyResponseField string `mapstructure:"SCRAP_WEBHOOK_VERIFY_RESPONSE_FILED"`
WebhookSignatureHeaderField string `mapstructure:"SCRAP_WEBHOOK_SIGNATURE_HEADER_FIELD"`
WebhookForwardingErrorNotificationUrl string `mapstructure:"SCRAP_WEBHOOK_FORWARDING_ERROR_NOTIFICATION_URL"`
WebhookForwardingSuccessStatusCode string `mapstructure:"SCRAP_WEBHOOK_FORWARDING_SUCCESS_STATUS_CODE"`
CronCleanupSchedule string `mapstructure:"SCRAP_CRON_CLEANUP_SCHEDULE"`
CronCleanupLifetimeHour int `mapstructure:"SCRAP_CRON_CLEANUP_LIFETIME_HOUR"`
}
func LoadConfig ¶
Click to show internal directories.
Click to hide internal directories.