config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(confFile string)

Types

type Auth

type Auth struct {
	Ignores    []string `mapstructure:"ignores"`
	NeedLogins []string `mapstructure:"needLogins"`
}

type Cache

type Cache struct {
	NeedCache []string `mapstructure:"needCache"`
}

type Config

type Config struct {
	Pay    Pay    `mapstructure:"pay"`
	Jwt    Jwt    `mapstructure:"jwt"`
	Wx     Wx     `mapstructure:"wx"`
	Auth   Auth   `mapstructure:"auth"`
	Qiniu  Qiniu  `mapstructure:"qiniu"`
	Upload Upload `mapstructure:"upload"`
	Cache  Cache  `mapstructure:"cache"`
	DB     DB     `mapstructure:"db"`
	Server Server `mapstructure:"server"`
}
var Conf *Config

type DB

type DB struct {
	Redis Redis `mapstructure:"redis"`
	Mysql Mysql `mapstructure:"mysql"`
}

type Gzh

type Gzh struct {
	Appid     string `mapstructure:"appid"`
	AppSecret string `mapstructure:"appSecret"`
}

type Jwt

type Jwt struct {
	Secret  string `mapstructure:"secret"`
	Expire  int64  `mapstructure:"expire"`
	Refresh int64  `mapstructure:"refresh"`
}

type Mysql

type Mysql struct {
	Host         string `mapstructure:"host"`
	Port         int    `mapstructure:"port"`
	User         string `mapstructure:"user"`
	Password     string `mapstructure:"password"`
	Database     string `mapstructure:"database"`
	MaxIdleConns int    `mapstructure:"maxIdleConns"`
	MaxOpenConns int    `mapstructure:"maxOpenConns"`
}

type Pay

type Pay struct {
	WxPay WxPay `mapstructure:"wxPay"`
}

type Qiniu

type Qiniu struct {
	Bucket    string `mapstructure:"bucket"`
	AccessKey string `mapstructure:"accessKey"`
	SecretKey string `mapstructure:"secretKey"`
	Region    string `mapstructure:"region"`
}

type Redis

type Redis struct {
	Addr         string `mapstructure:"addr"`
	Password     string `mapstructure:"password"`
	DB           int    `mapstructure:"db"`
	PoolSize     int    `mapstructure:"poolSize"`
	IdleTimeout  int    `mapstructure:"idleTimeout"`
	MaxOpenConns int    `mapstructure:"maxOpenConns"`
	MaxIdleConns int    `mapstructure:"maxIdleConns"`
}

type Server

type Server struct {
	Name string `mapstructure:"name"`
	Port int    `mapstructure:"port"`
	Host string `mapstructure:"host"`
	Cros string `mapstructure:"cros"`
}

type Upload

type Upload struct {
	Prefix string `mapstructure:"prefix"`
}

type Wx

type Wx struct {
	Gzh       Gzh    `mapstructure:"gzh"`
	Appid     string `mapstructure:"appid"`
	AppSecret string `mapstructure:"appSecret"`
	NotifyUrl string `mapstructure:"notifyUrl"`
}

type WxPay

type WxPay struct {
	AppId       string `mapstructure:"appId"`
	MchId       string `mapstructure:"mchId"`       //商户证书的证书序列号
	MchSerialNo string `mapstructure:"mchSerialNo"` //商户证书的证书序列号
	ApiV3Key    string `mapstructure:"apiV3Key"`    //apiV3Key,商户平台获取
	PrivateKey  string `mapstructure:"privateKey"`  //私钥 apiclient_key.pem 读取后的内容
	AppSecret   string `mapstructure:"appSecret"`
	NotifyUrl   string `mapstructure:"notifyUrl"`
	MchCertPath string `mapstructure:"mchCertPath"`
	MchKeyPath  string `mapstructure:"mchKeyPath"`
}

Jump to

Keyboard shortcuts

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