Store store interface
| 98 | |
| 99 | // Store store interface |
| 100 | type 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 | |
| 140 | func getKey(prefix string, id uint64) string { |
| 141 | return fmt.Sprintf("%s/%020d", prefix, id) |
no outgoing calls
no test coverage detected