conf

package
v0.0.0-...-7372eca Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	DB      *DB      `json:"DB" yaml:"DB"  jsonnet:"DB"`
	Server  *Server  `json:"Server" yaml:"Server" jsonnet:"Server"`
	Gateway *Gateway `json:"GatewayServer" yaml:"GatewayServer" jsonnet:"GatewayServer"`
	Logger  *Logger  `json:"Logger" yaml:"Logger" jsonnet:"Logger"`
	User    *User    `json:"User" yaml:"User" jsonnet:"User"`
	Secret  *Secret  `json:"Secret" yaml:"Secret" jsonnet:"Secret"`
}

Configuration 配置模块

func Instance

func Instance() *Configuration

Instance 获取配置对象

type DB

type DB struct {
	// 数据库驱动
	Driver string `json:"Driver" yaml:"Driver" jsonnet:"Driver"`
	// 连接字符串
	Source string `json:"Source" yaml:"Source" jsonnet:"Source"`

	// 是否显示 SQL 语句
	ShowSQL bool `json:"ShowSQL" yaml:"ShowSQL" jsonnet:"ShowSQL"`
	// 数据库连接池数量
	MaxOpenConns int `json:"MaxOpenConns" yaml:"MaxOpenConns" jsonnet:"MaxOpenConns"`
	// 数据库连接最大空闲数
	MaxIdleConns int `json:"MaxIdleConns" yaml:"MaxIdleConns" jsonnet:"MaxIdleConns"`
	// 缓存大小
	Cached int `json:"Cached" yaml:"Cached" jsonnet:"Cached"`
}

DB 数据库配置

type Gateway

type Gateway struct {
	Address  string `json:"Address" yaml:"Address" jsonnet:"Address"`
	H2       bool   `json:"H2" yaml:"H2" jsonnet:"H2"`
	CertFile string `json:"CertFile" yaml:"CertFile" jsonnet:"CertFile"`
	KeyFile  string `json:"KeyFile" yaml:"KeyFile" jsonnet:"KeyFile"`
}

Gateway grpc gateway

type Logger

type Logger struct {
	// 日志等级: debug,info,warn,error,dpanic,panic,fatal
	Level string `json:"Level" yaml:"Level" jsonnet:"Level"`
	// 日志时间输出格式
	TimeFormat string `json:"TimeFormat" yaml:"TimeFormat" jsonnet:"TimeFormat"`
	// 是否开启开发模式
	Development bool `json:"Development" yaml:"Development" jsonnet:"Development"`
	// 日志输出格式
	Encoding string `json:"Encoding" yaml:"Encoding" jsonnet:"Encoding"`
	// 日志文件输出位置
	LogsPath string `json:"LogsPath" yaml:"LogsPath" jsonnet:"LogsPath"`
}

Logger 日志配置

type Register

type Register struct {
}

Register configuration register.

func (Register) CheckIn

func (Register) CheckIn() (err error)

CheckIn 注册配置模块

func (Register) Name

func (Register) Name() string

Name .

type Secret

type Secret struct {
	Access  string `json:"Access"  yaml:"Access" jsonnet:"Access"`
	Refresh string `json:"Refresh"  yaml:"Refresh" jsonnet:"Refresh"`
}

Secret JWT 密钥

type Server

type Server struct {
	Address string `json:"Address" yaml:"Address" jsonnet:"Address"`
	// 证书验证文件
	CertFile string `json:"CertFile" yaml:"CertFile" jsonnet:"CertFile"`
	// 证书
	KeyFile string `json:"KeyFile" yaml:"KeyFile" jsonnet:"KeyFile"`
	// 是否为发布版本
	Release bool `json:"Release" yaml:"Release" jsonnet:"Release"`
}

Server grpc server

type User

type User struct {
	Name   string `json:"Name"  yaml:"Name" jsonnet:"Name"`
	Passwd string `json:"Passwd"  yaml:"Passwd" jsonnet:"Passwd"`
}

User system username and password

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL