Documentation
¶
Index ¶
- Variables
- func CheckAddrAvailable(addr string, timeout time.Duration) bool
- func NewEtcd(endpoints []string) (*clientv3.Client, error)
- func NewFluentWriteSyncer(addr string) (*fluentWriteSyncer, error)
- func NewGrpcConn(discovery registry.Discovery, logger log.Logger, srvName string) (*ggrpc.ClientConn, error)
- func NewNacosConfigClient() (config_client.IConfigClient, error)
- func NewNacosNamingClient(endpoint string) (naming_client.INamingClient, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MetricsSeconds = prometheus.NewHistogramVec(prometheus.HistogramOpts{ Namespace: "server", Subsystem: "requests", Name: "duration_sec", Help: "server requests duration(sec).", Buckets: []float64{0.005, 0.01, 0.025, 0.05, 0.1, 0.250, 0.5, 1}, }, []string{"kind", "operation"}) MetricsRequests = prometheus.NewCounterVec(prometheus.CounterOpts{ Namespace: "client", Subsystem: "requests", Name: "code_total", Help: "The total number of processed requests", }, []string{"kind", "operation", "code", "reason"}) MetricsLoads = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Namespace: "server", Subsystem: "system", Name: "load_total", Help: "The load of cpu & memory", }, []string{"kind", "operation", "code", "reason"}) )
Functions ¶
func NewFluentWriteSyncer ¶
func NewGrpcConn ¶
func NewGrpcConn(discovery registry.Discovery, logger log.Logger, srvName string) (*ggrpc.ClientConn, error)
微服务内部之间的通信,无需安全选项
func NewNacosConfigClient ¶
func NewNacosConfigClient() (config_client.IConfigClient, error)
NewNacosConfigClient 返回作为配置中心的nacos的客户端实例,naco的地址需要通过环境变量配置
func NewNacosNamingClient ¶
func NewNacosNamingClient(endpoint string) (naming_client.INamingClient, error)
NewNacosNamingClient 返回一般nacos客户端
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.