Documentation
¶
Index ¶
- func GetSrvConnection(wait uint, config BaseConfig, srvName string) (*grpc.ClientConn, error)
- func InitRedis(host string, port int, db int, password string) *redis.Client
- func InitTracer(name string, host string, port int) (opentracing.Tracer, io.Closer)
- func KeepAliveRouters(version string, groups ...RouterGroup) *gin.Engine
- func RawContextWithSpan(c *gin.Context) context.Context
- func RunRouter(router *gin.Engine, config BaseConfig) error
- type BaseConfig
- type ConsulConfig
- type NacosConfig
- type RegistryInfo
- type RouterGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSrvConnection ¶
func GetSrvConnection(wait uint, config BaseConfig, srvName string) (*grpc.ClientConn, error)
func InitTracer ¶ added in v1.0.3
func KeepAliveRouters ¶
func KeepAliveRouters(version string, groups ...RouterGroup) *gin.Engine
Types ¶
type BaseConfig ¶
type BaseConfig interface {
GetRegistryInfo() RegistryInfo
}
func InitConfig ¶
func InitConfig(YamlPath string, configStruct BaseConfig) (BaseConfig, error)
type ConsulConfig ¶
type NacosConfig ¶
type RegistryInfo ¶
type RegistryInfo struct { Name string `mapstructure:"name" json:"name"` Address string `mapstructure:"address" json:"address"` Port int `mapstructure:"port" json:"port"` Tags []string `mapstructure:"tags" json:"tags"` Consul ConsulConfig `mapstructure:"consul" json:"consul"` }
type RouterGroup ¶
type RouterGroup func(*gin.RouterGroup)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.