MCPcopy
hub / github.com/fagongzi/manba / Store

Interface Store

pkg/store/store.go:100–138  ·  view source on GitHub ↗

Store store interface

Source from the content-addressed store, hash-verified

98
99// Store store interface
100type Store interface {
101 Raw() interface{}
102
103 AddBind(bind *metapb.Bind) error
104 RemoveBind(bind *metapb.Bind) error
105 RemoveClusterBind(id uint64) error
106 GetBindServers(id uint64) ([]uint64, error)
107
108 PutCluster(cluster *metapb.Cluster) (uint64, error)
109 RemoveCluster(id uint64) error
110 GetClusters(limit int64, fn func(interface{}) error) error
111 GetCluster(id uint64) (*metapb.Cluster, error)
112
113 PutServer(svr *metapb.Server) (uint64, error)
114 RemoveServer(id uint64) error
115 GetServers(limit int64, fn func(interface{}) error) error
116 GetServer(id uint64) (*metapb.Server, error)
117
118 PutAPI(api *metapb.API) (uint64, error)
119 RemoveAPI(id uint64) error
120 GetAPIs(limit int64, fn func(interface{}) error) error
121 GetAPI(id uint64) (*metapb.API, error)
122
123 PutRouting(routing *metapb.Routing) (uint64, error)
124 RemoveRouting(id uint64) error
125 GetRoutings(limit int64, fn func(interface{}) error) error
126 GetRouting(id uint64) (*metapb.Routing, error)
127
128 RegistryProxy(proxy *metapb.Proxy, ttl int64) error
129 GetProxies(limit int64, fn func(*metapb.Proxy) error) error
130
131 Watch(evtCh chan *Evt, stopCh chan bool) error
132
133 Clean() error
134 SetID(id uint64) error
135 BackupTo(to string) error
136 Batch(batch *rpcpb.BatchReq) (*rpcpb.BatchRsp, error)
137 System() (*metapb.System, error)
138}
139
140func getKey(prefix string, id uint64) string {
141 return fmt.Sprintf("%s/%020d", prefix, id)

Callers 67

mainFunction · 0.65
postBindHandlerFunction · 0.65
AddBindMethod · 0.65
createServerFunction · 0.65
deleteBindHandlerFunction · 0.65
RemoveBindMethod · 0.65
createServerFunction · 0.65
RemoveClusterBindMethod · 0.65
GetBindServersMethod · 0.65
bindsClusterHandlerFunction · 0.65
putClusterMethod · 0.65

Implementers 1

EtcdStorepkg/store/store_etcd.go

Calls

no outgoing calls

Tested by

no test coverage detected