MCPcopy Index your code
hub / github.com/CodisLabs/codis / Create

Method Create

pkg/models/zk/zkclient.go:188–205  ·  view source on GitHub ↗
(path string, data []byte)

Source from the content-addressed store, hash-verified

186}
187
188func (c *Client) Create(path string, data []byte) error {
189 c.Lock()
190 defer c.Unlock()
191 if c.closed {
192 return errors.Trace(ErrClosedClient)
193 }
194 log.Debugf("zkclient create node %s", path)
195 err := c.shell(func(conn *zk.Conn) error {
196 _, err := c.create(conn, path, data, 0)
197 return err
198 })
199 if err != nil {
200 log.Debugf("zkclient create node %s failed: %s", path, err)
201 return err
202 }
203 log.Debugf("zkclient create OK")
204 return nil
205}
206
207func (c *Client) CreateEphemeral(path string, data []byte) (<-chan struct{}, error) {
208 c.Lock()

Callers

nothing calls this directly

Calls 3

shellMethod · 0.95
createMethod · 0.95
DebugfMethod · 0.80

Tested by

no test coverage detected