(path string, data []byte)
| 141 | } |
| 142 | |
| 143 | func (c *Client) Update(path string, data []byte) error { |
| 144 | c.Lock() |
| 145 | defer c.Unlock() |
| 146 | if c.closed { |
| 147 | return errors.Trace(ErrClosedClient) |
| 148 | } |
| 149 | cntx, cancel := c.newContext() |
| 150 | defer cancel() |
| 151 | log.Debugf("etcd update node %s", path) |
| 152 | _, err := c.kapi.Set(cntx, path, string(data), &client.SetOptions{PrevExist: client.PrevIgnore}) |
| 153 | if err != nil { |
| 154 | log.Debugf("etcd update node %s failed: %s", path, err) |
| 155 | return errors.Trace(err) |
| 156 | } |
| 157 | log.Debugf("etcd update OK") |
| 158 | return nil |
| 159 | } |
| 160 | |
| 161 | func (c *Client) Delete(path string) error { |
| 162 | c.Lock() |
nothing calls this directly
no test coverage detected