上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 22 下一页
摘要: package util import ( "context" "fmt" "go.etcd.io/etcd/clientv3" "time" ) type Service struct { client *clientv3.Client } func NewService() *Service { config := clientv3.Con... 阅读全文
posted @ 2019-12-20 00:50 离地最远的星 阅读(173) 评论(0) 推荐(0) 编辑
摘要: SQL UNION 操作符 SQL UNION 操作符合并两个或多个 SELECT 语句的结果。 SQL UNION 操作符 UNION 操作符用于合并两个或多个 SELECT 语句的结果集。 请注意,UNION 内部的每个 SELECT 语句必须拥有相同数量的列。列也必须拥有相似的数据类型。同时,每个 SELECT 语句中的列的顺序必须相同。 SQL UNION 语法 SEL... 阅读全文
posted @ 2019-12-20 00:50 离地最远的星 阅读(1090) 评论(0) 推荐(0) 编辑
摘要: package util import ( "context" "fmt" "go.etcd.io/etcd/clientv3" "time" ) type Service struct { client *clientv3.Client } func NewService() *Service { config := clientv3.Con... 阅读全文
posted @ 2019-12-20 00:49 离地最远的星 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 文件比较少比较小的时候使用文件md5值来监控配置文件 来自为知笔记(Wiz) 阅读全文
posted @ 2019-12-20 00:49 离地最远的星 阅读(393) 评论(0) 推荐(0) 编辑
摘要: 实现部分 package util import ( "context" "fmt" "go.etcd.io/etcd/clientv3" "time" ) type Service struct { client *clientv3.Client } func NewService() *Service { config := client... 阅读全文
posted @ 2019-12-20 00:48 离地最远的星 阅读(443) 评论(0) 推荐(0) 编辑
摘要: package util import ( "context" "go.etcd.io/etcd/clientv3" "io/ioutil" "net/http" "regexp" "time" ) type Client struct { client *clientv3.Client Services []*Servi... 阅读全文
posted @ 2019-12-20 00:48 离地最远的星 阅读(555) 评论(0) 推荐(0) 编辑
摘要: package util import ( "context" "go.etcd.io/etcd/clientv3" "regexp" "time" ) type Client struct { client *clientv3.Client Services []*ServiceInfo } type ServiceInfo struct... 阅读全文
posted @ 2019-12-20 00:47 离地最远的星 阅读(142) 评论(0) 推荐(0) 编辑
摘要: package util import ( "math/rand" "time" ) type LoadBalance struct { Servers []*ServiceInfo } func NewloadBalance(servers []*ServiceInfo) *LoadBalance { return &LoadBalance{Servers... 阅读全文
posted @ 2019-12-20 00:47 离地最远的星 阅读(85) 评论(0) 推荐(0) 编辑
摘要: 平滑重启的第三方库overseer package main import ( "crypto/md5" "encoding/hex" "flag" "fmt" "github.com/jpillora/overseer" "gopkg.in/ini.v1" "io" "log" "net/http" "os" ... 阅读全文
posted @ 2019-12-20 00:46 离地最远的星 阅读(281) 评论(0) 推荐(0) 编辑
摘要: 改成动态更新配置文件,如下每五秒重新生成配置文件 confd与etcd的使用 Add keys This guide assumes you have a working etcd, or consul server up and running and the ability to add new keys. /tmp/test-etcd/etcdctl ... 阅读全文
posted @ 2019-12-20 00:46 离地最远的星 阅读(1591) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 22 下一页