Documentation
¶
Overview ¶
*
- @Time : 2020/12/17 2:25 下午
- @Author : MassAdobe
- @Description: nacos
*
*
- @Time : 2020/12/17 2:25 下午
- @Author : MassAdobe
- @Description: nacos
*
*
- @Time : 2020/12/17 4:24 下午
- @Author : MassAdobe
- @Description: nacos
*
*
- @Time : 2020/12/17 4:25 下午
- @Author : MassAdobe
- @Description: nacos
*
Index ¶
- Variables
- func InitNacos()
- func InitNacosProfile()
- func InitRateProfile()
- func InsertSelfProfile(st interface{})
- func ListenConfiguration()
- func NacosConfiguration()
- func NacosDeregister()
- func NacosDiscovery()
- func NacosGetServer(serviceName, groupName string) (instance *model.Instance, err error)
- func ReadNacosSelfProfile(content string, pojo interface{})
- func ReadRateProfile(profile *InitNacosConfiguration)
- func RequestPath(path string) string
- type InitNacosConfiguration
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func InitNacos ¶
func InitNacos()
*
- @Author: MassAdobe
- @TIME: 2020/12/17 2:51 下午
- @Description: 初始化nacos配置
*
func InitNacosProfile ¶
func InitNacosProfile()
*
- @Author: MassAdobe
- @TIME: 2020/12/17 4:24 下午
- @Description: 处理首次nacos获取到的配置信息
*
func InitRateProfile ¶ added in v1.3.4
func InitRateProfile()
*
- @Author: MassAdobe
- @TIME: 2021/1/8 11:47 上午
- @Description: 初始化限流配置
*
func InsertSelfProfile ¶ added in v1.2.0
func InsertSelfProfile(st interface{})
*
- @Author: MassAdobe
- @TIME: 2020/12/28 4:07 下午
- @Description: 插入自定义结构
*
func ListenConfiguration ¶ added in v1.1.0
func ListenConfiguration()
*
- @Author: MassAdobe
- @TIME: 2020/12/21 2:58 下午
- @Description: 监听配置文件变化
*
func NacosConfiguration ¶
func NacosConfiguration()
*
- @Author: MassAdobe
- @TIME: 2020/12/17 2:50 下午
- @Description: nacos配置中心
*
func NacosDeregister ¶
func NacosDeregister()
*
- @Author: MassAdobe
- @TIME: 2020/12/17 4:57 下午
- @Description: nacos注销服务
*
func NacosDiscovery ¶
func NacosDiscovery()
*
- @Author: MassAdobe
- @TIME: 2020/12/17 3:16 下午
- @Description: nacos服务注册发现
*
func ReadNacosSelfProfile ¶ added in v1.1.0
func ReadNacosSelfProfile(content string, pojo interface{})
*
- @Author: MassAdobe
- @TIME: 2020/12/21 3:39 下午
- @Description: 返回配置文件自定义内容
*
func ReadRateProfile ¶ added in v1.3.4
func ReadRateProfile(profile *InitNacosConfiguration)
*
- @Author: MassAdobe
- @TIME: 2021/1/8 11:51 上午
- @Description: 读取限流配置
*
Types ¶
type InitNacosConfiguration ¶
type InitNacosConfiguration struct { Serve struct { Port uint64 `yaml:"port"` // 服务端口号 ServerName string `yaml:"server-name"` // 服务名 Weight float64 `yaml:"weight"` // nacos中权重 } `yaml:"serve"` Log struct { Path string `yaml:"path"` // 日志地址 Level string `yaml:"level"` // 日志级别 } `yaml:"log"` Gorm struct { Read struct { Username string `yaml:"username"` // 数据库用户名 PassWord string `yaml:"password"` // 数据库密码 Ip string `yaml:"ip"` // 数据库IP Port int `yaml:"port"` // 数据库端口 Dbname string `yaml:"dbname"` // 数据库名称 } `yaml:"read"` Write struct { Username string `yaml:"username"` // 数据库用户名 PassWord string `yaml:"password"` // 数据库密码 Ip string `yaml:"ip"` // 数据库IP Port int `yaml:"port"` // 数据库端口 Dbname string `yaml:"dbname"` // 数据库名称 } `yaml:"write"` } `yaml:"gorm"` Feign struct { RetryNum int `yaml:"retry-num"` // 内部调用重试次数 } `yaml:"feign"` Redis struct { MaxIdle int `yaml:"max-idle"` // 最大挂起数 MaxActive int `yaml:"max-active"` // 最大活跃数 IdleTimeout int `yaml:"idle-timeout"` // 最大挂起时间(秒) IpPort string `yaml:"ip-port"` // redis的IP和端口 PassWord string `yaml:"password"` // 密码口令 Database int `yaml:"database"` // 数据库号:0-15 ConnectTimeout int `yaml:"connect-timeout"` // 连接超时时间(秒) ReadTimeout int `yaml:"read-timeout"` // 读超时时间(秒) WriteTimeout int `yaml:"write-timeout"` // 写超时时间(秒) } `yaml:"redis"` Rate struct { All bool `yaml:"all"` // 是否是全局 Rate int `yaml:"rate"` // 限流数量 InterfaceAndRate map[string]int `yaml:"interface-and-rate"` // 限流接口以及限流数 } `yaml:"rate"` AccessToken struct { Verify string `yaml:"verify"` // 校验字段 } `yaml:"access-token"` // 用户携带token }
*
- @Author: MassAdobe
- @TIME: 2020/12/17 4:26 下午
- @Description: nacos配置文件配置
*
var (
InitConfiguration InitNacosConfiguration // 初始化配置
)
func ReadNacosProfile ¶ added in v1.1.0
func ReadNacosProfile(content string) *InitNacosConfiguration
*
- @Author: MassAdobe
- @TIME: 2020/12/21 3:05 下午
- @Description: 返回配置文件内容
*
Click to show internal directories.
Click to hide internal directories.