Skip to content

Latest commit

 

History

History
38 lines (32 loc) · 2.06 KB

apiserver.md

File metadata and controls

38 lines (32 loc) · 2.06 KB

ApiServer

ApiServer对外提供GRPC接口,用来管理Manba的元信息(Cluster、Server、Routing以及API)。

对外开放的接口:

// MetaService is a interface for meta manager
service MetaService {
    rpc PutCluster        (PutClusterReq)        returns (PutClusterRsp)         {}
    rpc RemoveCluster     (RemoveClusterReq)     returns (RemoveClusterRsp)      {}
    rpc GetCluster        (GetClusterReq)        returns (GetClusterRsp)         {}
    rpc GetClusterList    (GetClusterListReq)    returns (stream metapb.Cluster) {}

    rpc PutServer         (PutServerReq)         returns (PutServerRsp)          {}
    rpc RemoveServer      (RemoveServerReq)      returns (RemoveServerRsp)       {}
    rpc GetServer         (GetServerReq)         returns (GetServerRsp)          {}
    rpc GetServerList     (GetServerListReq)     returns (stream metapb.Server)  {}

    rpc PutAPI            (PutAPIReq)            returns (PutAPIRsp)             {}
    rpc RemoveAPI         (RemoveAPIReq)         returns (RemoveAPIRsp)          {}
    rpc GetAPI            (GetAPIReq)            returns (GetAPIRsp)             {}
    rpc GetAPIList        (GetAPIListReq)        returns (stream metapb.API)     {}

    rpc PutRouting        (PutRoutingReq)        returns (PutRoutingRsp)         {}
    rpc RemoveRouting     (RemoveRoutingReq)     returns (RemoveRoutingRsp)      {}
    rpc GetRouting        (GetRoutingReq)        returns (GetRoutingRsp)         {}
    rpc GetRoutingList    (GetRoutingListReq)    returns (stream metapb.Routing) {}

    rpc AddBind           (AddBindReq)           returns (AddBindRsp)            {}
    rpc RemoveBind        (RemoveBindReq)        returns (RemoveBindRsp)         {}
    rpc RemoveClusterBind (RemoveClusterBindReq) returns (RemoveClusterBindRsp)  {}
    rpc GetBindServers    (GetBindServersReq)    returns (GetBindServersRsp)     {}
}

具体的PB在项目的pkg/pb/rpcpb目录下

客户端

目前Gateway支持GO的客户端,这里以Gateway的GO客户端管理元信息的例子,参见examples