<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ~~~ package zookeeper import ( "errors" "github.com/samuel/go-zookeeper/zk" "project/library/dao/common" "project/library/dao/config" "time" ) type ZookeeperMgr struct { Conn *zk.Conn /* flags有4種取值: 0:永久,除非手動刪除 1:短暫,session斷開則改節點也被刪除 2:會自動在節點后面添加序號 3:即,短暫且自動添加序號 */ //初始化時默認0 flags int32 //初始化時默認允許所有操作 acl []zk.ACL } func InitZookeeper(cfg *config.ZkCfg) *ZookeeperMgr { conn, _, err := zk.Connect(cfg.Servers, time.Second*5) if err != nil { common.SimplePanic("InitZookeeper失敗", err.Error()) } return &ZookeeperMgr{Conn: conn, acl: zk.WorldACL(zk.PermAll)} } func InitZookeeper2(cfg *config.ZkCfg) (error, *ZookeeperMgr) { conn, _, err := zk.Connect(cfg.Servers, time.Second*5) if err != nil { return errors.New("InitZookeeper失敗"), nil } return nil, &ZookeeperMgr{Conn: conn, acl: zk.WorldACL(zk.PermAll)} } func (mgr *ZookeeperMgr) Create(path string, data []byte) (string, error) { return mgr.Conn.Create(path, data, mgr.flags, mgr.acl) } func (mgr *ZookeeperMgr) Delete(path string) error { _, stat, err := mgr.Conn.Get(path) if err != nil { return err } return mgr.Conn.Delete(path, stat.Version) } func (mgr *ZookeeperMgr) Update(path string, data []byte) error { _, stat, err := mgr.Conn.Get(path) if err != nil { return err } _, err = mgr.Conn.Set(path, data, stat.Version) return err } func (mgr *ZookeeperMgr) Get(path string) ([]byte, *zk.Stat, error) { return mgr.Conn.Get(path) } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看