Skip to content

Latest commit

 

History

History
94 lines (89 loc) · 1.8 KB

全局配置.md

File metadata and controls

94 lines (89 loc) · 1.8 KB

viper

整个应用是使用viper github.com/spf13/viper 作为配置项, 配置项目一般从platform/api/app.viper.go继承过来

如何想要查看默认配置, 可以修改app.viper: true, 该配置会把默认配置写回你的应用配置中, 以方便修改。

app:
  name: dolphin
  mode: release
  version: "1.0"
  host: localhost:8081
  viper: false

默认配置

app:
  auth: token
  host: localhost:8081
  mode: release
  name: dolphin
  version: "1.0"
  viper: false
db:
  connmaxlifetime: 10
  datasource: ./x_test.db
  driver: sqlite3
  maxidleconns: 15
  maxopenconns: 50
dir:
  api: api
  doc: ""
  k8s: k8s/platform
  log: log
  rpc: rpc
  script: script
  sql: sql
  sqlmap: sqlmap
  srv: srv
  svc: svc
  types: types
  util: util
http:
  hash: FF61A573-82FC-478B-9AEF-93D6F506DE9A
  port: "8081"
  prefix: /api
  static: static
jwt:
  expire: 604800
  secret: 6hy789iu87
oauth:
  affirm: /static/web/affirm.html
  client: http://localhost:8081
  id: Y76U9344RABF4
  login: /static/web/login.html
  secret: 8UYO6FVB8UYO6FVB
  server: http://localhost:8081
redis:
  addr:
  - localhost:6379
  db: 0
  dial_timeout: 10
  idle_conns: 10
  max_redirects: 0
  max_retries: 0
  min_idle_conns: 15
  mode: stub
  network: ""
  password: 111111
  pool_size: 15
  read_only: true
  read_timeout: 10
  username: ""
  write_timeout: 10
rpc:
  domain_srv: localhost:9081
  port: "9081"
  user_srv: localhost:9081
swag:
  authorizationurl: /api/sys/cas/authorize
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  scope:
    admin: Grants read and write access to administrative information
    read: Grants read access
    write: Grants write access
  securitydefinitions:
    oauth2:
      accesscode: OAuth2AccessCode
  tokenurl: /api/sys/cas/token