Documentation ¶
Overview ¶
Package conf 配置文件
- @Author: windealli windealli@tencent.com
- @Date: 2023-03-12 12:34:36
- @LastEditors: windealli windealli@tencent.com
- @LastEditTime: 2023-03-12 13:00:53
- @FilePath: /kratos-layout/internal/conf/base.go
- @Description: Bootstrap 对象用于存放服务相关的所有配置
Package conf ...
- @Author: windealli windealli@tencent.com
- @Date: 2023-03-13 15:46:21
- @LastEditors: windealli windealli@tencent.com
- @LastEditTime: 2023-03-14 20:47:41
- @FilePath: /kratos-layout/internal/conf/ops_conf.go
- @Description: 本文件一般只放运维配置相关的代码,请不要把业务配置的代码放在此处
Index ¶
- type Bootstrap
- type BusinessConfig
- type Cos
- type GrpcServer
- type HttpServer
- type Log
- func (log *Log) EnableCompress() bool
- func (log *Log) EnableConsuleStdout() bool
- func (log *Log) EnableFileStdout() bool
- func (log *Log) GetLogLevel() string
- func (log *Log) GetLogPath() string
- func (log *Log) GetMaxAge() int
- func (log *Log) GetMaxBackups() int
- func (log *Log) GetMaxSize() int
- func (log *Log) UseLocalTime() bool
- type LoginConf
- type MySQL
- type Ops
- type Redis
- type Server
- type Tracing
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bootstrap ¶
type Bootstrap struct { Ops *Ops // 运维组件相关的配置,比如云上的DB、Redis、Kafka、COS相关信息 Server *Server `json:"server"` // 服务启动的基本信息,如http、grpc相关的配置 BC *BusinessConfig // 业务配置,用于存放本服务相关的业务配置,如某些开关,域名等 }
Bootstrap 全量配置
type BusinessConfig ¶
type BusinessConfig struct {
LoginConf LoginConf `yaml:"login_conf"` // 业务登录态相关的配置
}
BusinessConfig 业务配置
type GrpcServer ¶
type GrpcServer struct { Network string // 网络类型,如tcp Addr string // grpc服务地址,如0.0.0.0:8000 Timeout int // grpc服务超时时间, }
GrpcServer server 配置
type HttpServer ¶
type HttpServer struct { Network string // 网络类型,如tcp Addr string // http服务地址,如0.0.0.0:9000 Timeout int // http服务超时时间, }
HttpServer http server配置
type Log ¶
type Log struct { Path string // 日志存储路径 Compress bool // 是否压缩 ConsoleStdout bool // 是否输出到控制台 FileStdout bool // 是否输出到文件 Level string // 日志级别 LocalTime bool // 是否使用本地时间 MaxAge int // 日志保留天数 MaxSize int // 日志文件最大尺寸,单位MB MaxBackups int // 日志文件最大备份数 }
Log 日志配置
func (*Log) EnableConsuleStdout ¶
EnableConsuleStdout 是否输出控制台日志
type LoginConf ¶ added in v0.1.1
type LoginConf struct { // JWT-Token特定的配置, 使用JWT-TOKEN的登录方式,需要配置 JWTSecret string `yaml:"jwt_secret"` // JWT签名密钥, 如果使用JWT-Token,必须设置 // 业务登录态相关配置,使用Cookie和JWT-Token,都必须设置 Timeout int64 `yaml:"timeout"` // 登录态超时时间, 默认2小时 CookieName string `yaml:"cookie_name"` }
LoginConf 业务登录态相关的配置
type MySQL ¶
MySQL 数据库配置
type Ops ¶
Ops 运维配置
type Server ¶
type Server struct { Name string Version string Grpc *GrpcServer `json:"grpc"` Http *HttpServer `json:"http"` }
Server 服务配置
Click to show internal directories.
Click to hide internal directories.