Documentation ¶
Index ¶
- Constants
- Variables
- type EtcdStore
- func (e *EtcdStore) AddBind(bind *metapb.Bind) error
- func (e *EtcdStore) BackupTo(to string) error
- func (e *EtcdStore) Batch(batch *rpcpb.BatchReq) (*rpcpb.BatchRsp, error)
- func (e *EtcdStore) Clean() error
- func (e *EtcdStore) GetAPI(id uint64) (*metapb.API, error)
- func (e *EtcdStore) GetAPIs(limit int64, fn func(interface{}) error) error
- func (e *EtcdStore) GetBindServers(id uint64) ([]uint64, error)
- func (e *EtcdStore) GetCluster(id uint64) (*metapb.Cluster, error)
- func (e *EtcdStore) GetClusters(limit int64, fn func(interface{}) error) error
- func (e *EtcdStore) GetProxies(limit int64, fn func(*metapb.Proxy) error) error
- func (e *EtcdStore) GetRouting(id uint64) (*metapb.Routing, error)
- func (e *EtcdStore) GetRoutings(limit int64, fn func(interface{}) error) error
- func (e *EtcdStore) GetServer(id uint64) (*metapb.Server, error)
- func (e *EtcdStore) GetServers(limit int64, fn func(interface{}) error) error
- func (e *EtcdStore) PutAPI(value *metapb.API) (uint64, error)
- func (e *EtcdStore) PutCluster(value *metapb.Cluster) (uint64, error)
- func (e *EtcdStore) PutRouting(value *metapb.Routing) (uint64, error)
- func (e *EtcdStore) PutServer(value *metapb.Server) (uint64, error)
- func (e *EtcdStore) Raw() interface{}
- func (e *EtcdStore) RegistryProxy(proxy *metapb.Proxy, ttl int64) error
- func (e *EtcdStore) RemoveAPI(id uint64) error
- func (e *EtcdStore) RemoveBind(bind *metapb.Bind) error
- func (e *EtcdStore) RemoveCluster(id uint64) error
- func (e *EtcdStore) RemoveClusterBind(id uint64) error
- func (e *EtcdStore) RemoveRouting(id uint64) error
- func (e *EtcdStore) RemoveServer(id uint64) error
- func (e *EtcdStore) SetID(id uint64) error
- func (e *EtcdStore) System() (*metapb.System, error)
- func (e *EtcdStore) Watch(evtCh chan *Evt, stopCh chan bool) error
- type Evt
- type EvtSrc
- type EvtType
- type Store
Constants ¶
View Source
const ( // EventTypeNew event type new EventTypeNew = EvtType(0) // EventTypeUpdate event type update EventTypeUpdate = EvtType(1) // EventTypeDelete event type delete EventTypeDelete = EvtType(2) )
View Source
const ( // EventSrcCluster cluster event EventSrcCluster = EvtSrc(0) // EventSrcServer server event EventSrcServer = EvtSrc(1) // EventSrcBind bind event EventSrcBind = EvtSrc(2) // EventSrcAPI api event EventSrcAPI = EvtSrc(3) // EventSrcRouting routing event EventSrcRouting = EvtSrc(4) // EventSrcProxy routing event EventSrcProxy = EvtSrc(5) )
Variables ¶
View Source
var ( // TICKER ticket TICKER = time.Second * 3 // TTL timeout TTL = int64(5) )
View Source
var ( // ErrHasBind error has bind into, can not delete ErrHasBind = errors.New("Has bind info, can not delete") // ErrStaleOP is a stale error ErrStaleOP = errors.New("stale option") )
Functions ¶
This section is empty.
Types ¶
type EtcdStore ¶
EtcdStore etcd store impl
func (*EtcdStore) GetBindServers ¶
GetBindServers return cluster binds servers
func (*EtcdStore) GetCluster ¶
GetCluster returns the cluster
func (*EtcdStore) GetClusters ¶
GetClusters returns all clusters
func (*EtcdStore) GetProxies ¶
GetProxies returns proxies in store
func (*EtcdStore) GetRouting ¶
GetRouting returns a routing
func (*EtcdStore) GetRoutings ¶
GetRoutings returns routes in store
func (*EtcdStore) GetServers ¶
GetServers returns all server
func (*EtcdStore) PutCluster ¶
PutCluster add or update the cluster
func (*EtcdStore) PutRouting ¶
PutRouting add or update routing
func (*EtcdStore) RegistryProxy ¶
RegistryProxy registry
func (*EtcdStore) RemoveBind ¶
RemoveBind remove bind
func (*EtcdStore) RemoveCluster ¶
RemoveCluster remove the cluster and it's binds
func (*EtcdStore) RemoveClusterBind ¶
RemoveClusterBind remove cluster all bind servers
func (*EtcdStore) RemoveRouting ¶
RemoveRouting remove routing
func (*EtcdStore) RemoveServer ¶
RemoveServer remove the server
type Store ¶
type Store interface { Raw() interface{} AddBind(bind *metapb.Bind) error RemoveBind(bind *metapb.Bind) error RemoveClusterBind(id uint64) error GetBindServers(id uint64) ([]uint64, error) PutCluster(cluster *metapb.Cluster) (uint64, error) RemoveCluster(id uint64) error GetClusters(limit int64, fn func(interface{}) error) error GetCluster(id uint64) (*metapb.Cluster, error) PutServer(svr *metapb.Server) (uint64, error) RemoveServer(id uint64) error GetServers(limit int64, fn func(interface{}) error) error GetServer(id uint64) (*metapb.Server, error) PutAPI(api *metapb.API) (uint64, error) RemoveAPI(id uint64) error GetAPIs(limit int64, fn func(interface{}) error) error GetAPI(id uint64) (*metapb.API, error) PutRouting(routing *metapb.Routing) (uint64, error) RemoveRouting(id uint64) error GetRoutings(limit int64, fn func(interface{}) error) error GetRouting(id uint64) (*metapb.Routing, error) RegistryProxy(proxy *metapb.Proxy, ttl int64) error GetProxies(limit int64, fn func(*metapb.Proxy) error) error Watch(evtCh chan *Evt, stopCh chan bool) error Clean() error SetID(id uint64) error BackupTo(to string) error Batch(batch *rpcpb.BatchReq) (*rpcpb.BatchRsp, error) System() (*metapb.System, error) }
Store store interface
func GetStoreFrom ¶
GetStoreFrom returns a store implemention, if not support returns error
Click to show internal directories.
Click to hide internal directories.