MCPcopy Create free account
hub / github.com/cloudwan/gohan / Update

Method Update

sync/etcd/etcd.go:58–70  ·  view source on GitHub ↗

Update sync update sync

(key, jsonString string)

Source from the content-addressed store, hash-verified

56
57//Update sync update sync
58func (s *Sync) Update(key, jsonString string) error {
59 var err error
60 if jsonString == "" {
61 _, err = s.etcdClient.SetDir(key, 0)
62 } else {
63 _, err = s.etcdClient.Set(key, jsonString, 0)
64 }
65 if err != nil {
66 log.Error(fmt.Sprintf("failed to sync with backend %s", err))
67 return err
68 }
69 return nil
70}
71
72//Delete sync update sync
73func (s *Sync) Delete(key string, prefix bool) error {

Callers

nothing calls this directly

Implementers 5

Syncsync/etcd/etcd.go
MockSyncsync/mocks/sync_mock.go
MockSyncMockRecordersync/mocks/sync_mock.go
Syncsync/noop/noop.go
Syncsync/etcdv3/etcd.go

Calls 2

SetMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected