Documentation
¶
Index ¶
- Constants
- Variables
- func InitConfig(configFile string) error
- func MockConfig(mockConfig *Configuration)
- type AccountGenerationHttpService
- type AccountNumberGenerationConfig
- type Configuration
- type DataSourceConfig
- type Notification
- type QueueConfig
- type RateLimitConfig
- type ReconciliationConfig
- type RedisConfig
- type ServerConfig
- type SlackWebhook
- type TransactionConfig
- type TypeSenseConfig
- type WebhookConfig
Constants ¶
View Source
const ( DEFAULT_PORT = "5001" DEFAULT_CLEANUP_SEC = 10800 // 3 hours in seconds DEFAULT_TYPESENSE_KEY = "blnk-api-key" DEFAULT_MONITORING_PORT = "5004" )
Default constants
Variables ¶
View Source
var ConfigStore atomic.Value
Functions ¶
func InitConfig ¶
func MockConfig ¶
func MockConfig(mockConfig *Configuration)
MockConfig sets a mock configuration for testing purposes.
Types ¶
type AccountNumberGenerationConfig ¶
type AccountNumberGenerationConfig struct {
EnableAutoGeneration bool `json:"enable_auto_generation"`
HttpService AccountGenerationHttpService `json:"http_service"`
}
type Configuration ¶
type Configuration struct {
ProjectName string `json:"project_name" envconfig:"BLNK_PROJECT_NAME"`
BackupDir string `json:"backup_dir" envconfig:"BLNK_BACKUP_DIR"`
AwsAccessKeyId string `json:"aws_access_key_id" envconfig:"BLNK_AWS_ACCESS_KEY_ID"`
S3Endpoint string `json:"s3_endpoint" envconfig:"BLNK_S3_ENDPOINT"`
AwsSecretAccessKey string `json:"aws_secret_access_key" envconfig:"BLNK_AWS_SECRET_ACCESS_KEY"`
S3BucketName string `json:"s3_bucket_name" envconfig:"BLNK_S3_BUCKET_NAME"`
S3Region string `json:"s3_region" envconfig:"BLNK_S3_REGION"`
Server ServerConfig `json:"server"`
DataSource DataSourceConfig `json:"data_source"`
Redis RedisConfig `json:"redis"`
TypeSense TypeSenseConfig `json:"typesense"`
TypeSenseKey string `json:"type_sense_key" envconfig:"BLNK_TYPESENSE_KEY"`
TokenizationSecret string `json:"tokenization_secret" envconfig:"BLNK_TOKENIZATION_SECRET"`
AccountNumberGeneration AccountNumberGenerationConfig `json:"account_number_generation"`
Notification Notification `json:"notification"`
RateLimit RateLimitConfig `json:"rate_limit"`
EnableTelemetry bool `json:"enable_telemetry" envconfig:"BLNK_ENABLE_TELEMETRY"`
EnableObservability bool `json:"enable_observability" envconfig:"BLNK_ENABLE_OBSERVABILITY"`
Transaction TransactionConfig `json:"transaction"`
Reconciliation ReconciliationConfig `json:"reconciliation"`
Queue QueueConfig `json:"queue"`
}
func Fetch ¶
func Fetch() (*Configuration, error)
type DataSourceConfig ¶
type DataSourceConfig struct {
Dns string `json:"dns" envconfig:"BLNK_DATA_SOURCE_DNS"`
MaxOpenConns int `json:"max_open_conns" envconfig:"BLNK_DATABASE_MAX_OPEN_CONNS"`
MaxIdleConns int `json:"max_idle_conns" envconfig:"BLNK_DATABASE_MAX_IDLE_CONNS"`
ConnMaxLifetime time.Duration `json:"conn_max_lifetime" envconfig:"BLNK_DATABASE_CONN_MAX_LIFETIME"`
ConnMaxIdleTime time.Duration `json:"conn_max_idle_time" envconfig:"BLNK_DATABASE_CONN_MAX_IDLE_TIME"`
}
type Notification ¶
type Notification struct {
Slack SlackWebhook `json:"slack"`
Webhook WebhookConfig `json:"webhook"`
}
type QueueConfig ¶
type QueueConfig struct {
TransactionQueue string `json:"transaction_queue" envconfig:"BLNK_QUEUE_TRANSACTION"`
WebhookQueue string `json:"webhook_queue" envconfig:"BLNK_QUEUE_WEBHOOK"`
IndexQueue string `json:"index_queue" envconfig:"BLNK_QUEUE_INDEX"`
InflightExpiryQueue string `json:"inflight_expiry_queue" envconfig:"BLNK_QUEUE_INFLIGHT_EXPIRY"`
NumberOfQueues int `json:"number_of_queues" envconfig:"BLNK_QUEUE_NUMBER_OF_QUEUES"`
InsufficientFundRetries bool `json:"insufficient_fund_retries" envconfig:"BLNK_QUEUE_INSUFFICIENT_FUND_RETRIES"`
MaxRetryAttempts int `json:"max_retry_attempts" envconfig:"BLNK_QUEUE_MAX_RETRY_ATTEMPTS"`
MonitoringPort string `json:"monitoring_port" envconfig:"BLNK_QUEUE_MONITORING_PORT"`
WebhookConcurrency int `json:"webhook_concurrency" envconfig:"BLNK_QUEUE_WEBHOOK_CONCURRENCY"`
}
type RateLimitConfig ¶
type ReconciliationConfig ¶
type ReconciliationConfig struct {
DefaultStrategy string `json:"default_strategy" envconfig:"BLNK_RECONCILIATION_DEFAULT_STRATEGY"`
ProgressInterval int `json:"progress_interval" envconfig:"BLNK_RECONCILIATION_PROGRESS_INTERVAL"`
MaxRetries int `json:"max_retries" envconfig:"BLNK_RECONCILIATION_MAX_RETRIES"`
RetryDelay time.Duration `json:"retry_delay" envconfig:"BLNK_RECONCILIATION_RETRY_DELAY"`
}
type RedisConfig ¶
type RedisConfig struct {
Dns string `json:"dns" envconfig:"BLNK_REDIS_DNS"`
SkipTLSVerify bool `json:"skip_tls_verify" envconfig:"BLNK_REDIS_SKIP_TLS_VERIFY"`
PoolSize int `json:"pool_size" envconfig:"BLNK_REDIS_POOL_SIZE"`
MinIdleConns int `json:"min_idle_conns" envconfig:"BLNK_REDIS_MIN_IDLE_CONNS"`
}
type ServerConfig ¶
type ServerConfig struct {
SSL bool `json:"ssl" envconfig:"BLNK_SERVER_SSL"`
CertStoragePath string `json:"cert_storage_path" envconfig:"BLNK_CERT_STORAGE_PATH"`
Secure bool `json:"secure" envconfig:"BLNK_SERVER_SECURE"`
SecretKey string `json:"secret_key" envconfig:"BLNK_SERVER_SECRET_KEY"`
Domain string `json:"domain" envconfig:"BLNK_SERVER_SSL_DOMAIN"`
Email string `json:"ssl_email" envconfig:"BLNK_SERVER_SSL_EMAIL"`
Port string `json:"port" envconfig:"BLNK_SERVER_PORT"`
}
type SlackWebhook ¶
type SlackWebhook struct {
WebhookUrl string `json:"webhook_url" envconfig:"BLNK_SLACK_WEBHOOK_URL"`
}
type TransactionConfig ¶
type TransactionConfig struct {
BatchSize int `json:"batch_size" envconfig:"BLNK_TRANSACTION_BATCH_SIZE"`
MaxQueueSize int `json:"max_queue_size" envconfig:"BLNK_TRANSACTION_MAX_QUEUE_SIZE"`
MaxWorkers int `json:"max_workers" envconfig:"BLNK_TRANSACTION_MAX_WORKERS"`
LockDuration time.Duration `json:"lock_duration" envconfig:"BLNK_TRANSACTION_LOCK_DURATION"`
IndexQueuePrefix string `json:"index_queue_prefix" envconfig:"BLNK_TRANSACTION_INDEX_QUEUE_PREFIX"`
EnableQueuedChecks bool `json:"enable_queued_checks" envconfig:"BLNK_TRANSACTION_ENABLE_QUEUED_CHECKS"`
}
type TypeSenseConfig ¶
type TypeSenseConfig struct {
Dns string `json:"dns" envconfig:"BLNK_TYPESENSE_DNS"`
}
type WebhookConfig ¶
Click to show internal directories.
Click to hide internal directories.