github.com/wfusion/gofusion@v1.1.14/test/config/configs/app.toml (about) 1 [base] 2 debug = true 3 app = "gofusion" 4 5 [base.crypto.config] 6 mode = "gcm" 7 algorithm = "sm4" 8 key_base64 = "MTIzNDU2NzhhYmNkZWZnaA==" 9 confuse_key = true 10 output_algorithm = "base64" 11 12 [base.crypto.custom] 13 gorm.mode = "gcm" 14 gorm.algorithm = "sm4" 15 gorm.key_base64 = "MTIzNDU2NzhhYmNkZWZnaA==" 16 gorm.confuse_key = true 17 gorm.output_algorithm = "base64" 18 19 [base.http] 20 port = 9001 21 cert = "" 22 key = "" 23 tls = false 24 next_protos = ["http/1.1"] 25 colorful_console = false 26 success_code = 0 27 error_code = -1 28 pprof = false 29 read_timeout = "10s" 30 write_timeout = "10s" 31 xss_white_url_list = [""] 32 enable_logger = false 33 logger = "github.com/wfusion/gofusion/log/customlogger.httpLogger" 34 log_instance = "default" 35 asynq = [ 36 { "path" = "/asynq", "instance" = "default", "instance_type" = "redis", "readonly" = false, "prometheus_address" = "" }, 37 ] 38 39 [base.http.clients.default] 40 mock = true 41 timeout = "30s" 42 dial_timeout = "30s" 43 dial_keepalive_time = "30s" 44 force_attempt_http2 = true 45 tls_handshake_timeout = "10s" 46 disable_compression = false 47 max_idle_conns = 100 48 max_idle_conns_per_host = 100 49 max_conns_per_host = 0 50 idle_conn_timeout = "90s" 51 expect_continue_timeout = "1s" 52 retry_count = 0 53 retry_wait_time = "100ms" 54 retry_max_wait_time = "2s" 55 retry_condition_funcs = [ ] 56 retry_hooks = [ ] 57 58 [base.http.metrics] 59 header_labels = [ ] 60 61 [base.i18n] 62 default_lang = "zh" 63 64 [base.goroutine_pool] 65 max_routine_amount = -1 66 max_release_time_per_pool = "3h" 67 force_sync = false 68 enable_logger = false 69 logger = "github.com/wfusion/gofusion/log/customlogger.routineLogger" 70 log_instance = "default" 71 72 [base.metrics.prometheus] 73 type = "prometheus" 74 mode = "push" 75 interval = "30s" 76 labels = { "constant_key" = "constant_value" } 77 endpoint.addresses = [ 78 "prometheus:9091" 79 ] 80 enable_service_label = true 81 enable_internal_metrics = true 82 log_instance = "default" 83 queue_limit = 16384 84 queue_concurrency = 0 85 86 [base.log.default] 87 log_level = "debug" 88 stacktrace_level = "error" 89 enable_console_output = true 90 enable_file_output = false 91 console_output_option.layout = "console" 92 console_output_option.colorful = false 93 file_output_option.layout = "json" 94 file_output_option.path = "." 95 file_output_option.name = "gofusion.log" 96 file_output_option.rotation_max_age = "720h" 97 file_output_option.rotation_count = 10 98 file_output_option.rotation_size = "100mib" 99 file_output_option.compress = false 100 skip_callers = [] 101 shorter_filepath = true 102 103 [base.db.read] 104 driver = "mysql" 105 dialect = "mysql" 106 db = "dev" 107 host = "mysql" 108 port = 3306 109 user = "root" 110 password = "j8RJId7eTMAUJ3NUytlZGqVzP6wOzrbTX7YcizC8" 111 timeout = "5s" 112 read_timeout = "2s" 113 write_timeout = "2s" 114 max_idle_conns = 20 115 max_open_conns = 20 116 conn_max_life_time = "30m" 117 conn_max_idle_time = "15m" 118 auto_increment_increment = 0 119 enable_logger = true 120 logger_config.log_level = "info" 121 logger_config.slow_threshold = "500ms" 122 logger_config.logger = "github.com/wfusion/gofusion/log/customlogger.gormLogger" 123 logger_config.log_instance = "default" 124 125 [[base.db.read.sharding]] 126 table = "user" 127 suffix = "" 128 columns = [ "city" ] 129 sharding_key_expr = "" 130 sharding_key_by_raw_value = false 131 sharding_keys_for_migrating = [] 132 number_of_shards = 1 133 idgen = "github.com/wfusion/gofusion/common/infra/drivers/orm/idgen.NewSnowflake" 134 135 [base.db.write] 136 driver = "mysql" 137 dialector = "mysql" 138 db = "mysql" 139 host = "mysql" 140 port = 3306 141 user = "root" 142 password = "j8RJId7eTMAUJ3NUytlZGqVzP6wOzrbTX7YcizC8" 143 timeout = "5s" 144 read_timeout = "2s" 145 write_timeout = "2s" 146 max_idle_conns = 20 147 max_open_conns = 20 148 enable_logger = true 149 logger_config.log_level = "info" 150 logger_config.slow_threshold = "500ms" 151 152 [base.mongo.default] 153 db = "admin" 154 auth_db = "admin" 155 user = "root" 156 password = "j8RJId7eTMAUJ3NUytlZGqVzP6wOzrbTX7YcizC8" 157 endpoints = [ 158 "mongo:27017" 159 ] 160 timeout = "5s" 161 conn_timeout = "30s" 162 socket_timeout = "5s" 163 heartbeat_interval = "10s" 164 max_connecting = 2 165 min_pool_size = 0 166 max_pool_size = 100 167 max_conn_idle_time = "10s" 168 retry_writes = true 169 retry_reads = true 170 enable_logger = true 171 logger_config.logger = "github.com/wfusion/gofusion/log/customlogger.mongoLogger" 172 looger_config.log_instance = "default" 173 logger_config.loggable_commands = [ 174 "insert", 175 "find", 176 "update", 177 "delete", 178 "aggregate", 179 "distinct", 180 "count", 181 "findAndModify" 182 ] 183 184 [base.redis.default] 185 db = 0 186 user = "" 187 password = "j8RJId7eTMAUJ3NUytlZGqVzP6wOzrbTX7YcizC8" 188 cluster = false 189 endpoints = [ 190 "redis:6379" 191 ] 192 dial_timeout = "5s" 193 read_timeout = "2s" 194 write_timeout = "2s" 195 min_idle_conns = 0 196 max_idle_conns = 0 197 conn_max_idle_time = "30m" 198 conn_max_life_time = "" 199 max_retries = 3 200 min_retry_backoff = "8ms" 201 max_retry_backoff = "512ms" 202 pool_size = 0 203 pool_timeout = "" 204 enable_logger = true 205 log_instance = "default" 206 unloggable_commands = ["echo", "ping"] 207 hooks = [ 208 "github.com/wfusion/gofusion/log/customlogger.redisLogger" 209 ] 210 211 [base.mq.mysql] 212 topic = "gofusion" 213 type = "mysql" 214 producer = true 215 consumer = true 216 consumer_group = "default_group" 217 consumer_concurrency = 10 218 endpoint.instance_type = "db" 219 endpoint.instance = "write" 220 endpoint.addresses = [ 221 "rebbitmq:5672" 222 ] 223 endpoint.user = "root" 224 endpoint.password = "j8RJId7eTMAUJ3NUytlZGqVzP6wOzrbTX7YcizC8" 225 endpoint.auth_type = "" 226 endpoint.version = "3.6.0" 227 persistent = true 228 serialize_type = "gob" 229 compress_type = "zstd" 230 enable_logger = true 231 logger = "github.com/wfusion/gofusion/log/customlogger.mqLogger" 232 log_instance = "default" 233 message_scheme = "gofusion_message" 234 series_scheme = "gofusion_series" 235 consumer_scheme = "gofusion_subscriber" 236 [[base.mq.mysql.consume_middlewares]] 237 type = "throttle" 238 throttle_count = 10 239 throttle_duration = "1s" 240 retry_max_retries = 1 241 retry_initial_interval = "1s" 242 retry_max_interval = "10s" 243 retry_multiplier = 1.1 244 retry_max_elapsed_time = "20s" 245 retry_randomization_factor = 0.1 246 poison_topic = "failed" 247 timeout = "10s" 248 circuit_breaker_max_requests = 0 249 circuit_breaker_interval = "15s" 250 circuit_breaker_timeout = "60s" 251 circuit_breaker_trip_expr = "consecutive_successes > 5" 252 253 [base.cache.local] 254 size = 10 255 expired = "5s" 256 version = 1 257 type = "local" 258 local_evict_type = "arc" 259 remote_type = "" 260 compress = "" 261 serialize_type = "" 262 log_instance = "default" 263 callback = "" 264 265 [base.lock.default] 266 type = "redis_lua" 267 instance = "default" 268 269 [base.async.default] 270 type = "asynq" 271 instance = "default" 272 instance_type = "redis" 273 producer = true 274 consumer = true 275 server_concurrency = 0 276 message_serialize_type = "gob" 277 message_compress_type = "zstd" 278 queues = [ 279 { "name" = "", "level" = 3 }, 280 ] 281 strict_priority = false 282 log_level = "info" 283 logger = "github.com/wfusion/gofusion/log/customlogger.asyncLogger" 284 log_instance = "default" 285 286 [base.cron.default] 287 type = "asynq" 288 instance = "default" 289 instance_type = "redis" 290 lock_instance = "default" 291 trigger = true 292 server = true 293 server_concurrency = 0 294 timezone = "Asia/Shanghai" 295 queue = "" 296 log_level = "info" 297 logger = "github.com/wfusion/gofusion/log/customlogger.cronLogger" 298 log_instance = "default" 299 task_loader = "" 300 refresh_tasks_interval = "3m" 301 tasks.test.crontab = "@every 1s" 302 tasks.test.callback = "" 303 tasks.test.payload = "" 304 tasks.test.retry = 0 305 tasks.test.timeout = "" 306 tasks.test.deadline = "" 307 308 [InstanceSync] 309 Enable = true 310 Crontab = "0 0 1 * * *" 311 312 [Forecast] 313 Enable = true 314 Crontab = "0 0 4 * * *" 315 History = 3 316 Future = 1