struct Client
pub struct Client {
pub host string
pub port int
}Purpose
Public struct `Client`.
Parameters
hoststring- host
portint- port
API
#github.com/xulang-org/packages/zookeeperApache ZooKeeper Distributed Coordination Driver for Xu Communicates via 4LW (Four-Letter Words) and native TCP commands.
github.com/xulang-org/packages · 0.1.1 · Install and use
struct Clientpub struct Client {
pub host string
pub port int
}Public struct `Client`.
host stringport intnew_clientpub fn new_client(endpoint string) ClientConstruct client.
endpoint stringClient — a value of this type
(Client) exec_4lwpub fn (c Client) exec_4lw(cmd string) stringMethod on `Client`: exec 4lw. Throws on failure.
c Clientcmd stringstring — result string
(Client) ruokpub fn (c Client) ruok() boolCall `ruok` on `Client`.
c Clientbool — true or false
(Client) statpub fn (c Client) stat() stringMethod on `Client`: read metadata. Throws on failure.
c Clientstring — result string
(Client) mntrpub fn (c Client) mntr() stringCall `mntr` on `Client`. Throws on failure.
c Clientstring — result string
struct Poolpub struct Pool {
pub client Client
pub idle chan int
pub max_idle int
}Public struct `Pool`.
client Clientidle chan intmax_idle intnew_poolpub fn new_pool(endpoint string, max_idle int) PoolConstruct pool.
endpoint stringmax_idle intPool — a value of this type
open_poolpub fn open_pool(endpoint string, max_idle int) PoolOpen pool.
endpoint stringmax_idle intPool — a value of this type
(&Pool) get_connpub fn (p &Pool) get_conn() intMethod on `&Pool`: read conn.
p &Poolint — a value of this type
(&Pool) put_connpub fn (p &Pool) put_conn(fd int)Method on `&Pool`: put connection.
p &Poolfd int(&Pool) ruokpub fn (p &Pool) ruok() boolCall `ruok` on `&Pool`.
p &Poolbool — true or false
(&Pool) statpub fn (p &Pool) stat() stringMethod on `&Pool`: read metadata. Throws on failure.
p &Poolstring — result string
(&Pool) mntrpub fn (p &Pool) mntr() stringCall `mntr` on `&Pool`. Throws on failure.
p &Poolstring — result string
(&Pool) closepub fn (p &Pool) close()Method on `&Pool`: close the resource.
p &Pool