github.com/wfusion/gofusion@v1.1.14/test/config/configs/app.json (about)

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