[#74] apemanager: Generate protobufs for apemanager service
* Generate protobufs. * Make marshallers, unmarshallers, json-encoders etc. * Create message encoding/decoding unit-tests. Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
67c6f305b2
commit
387b850e5e
17 changed files with 3375 additions and 45 deletions
60
rpc/apemanager.go
Normal file
60
rpc/apemanager.go
Normal file
|
@ -0,0 +1,60 @@
|
|||
package rpc
|
||||
|
||||
import (
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/common"
|
||||
)
|
||||
|
||||
const serviceAPEManager = serviceNamePrefix + "apemanager.APEManagerService"
|
||||
|
||||
const (
|
||||
rpcAPEManagerAddChain = "AddChain"
|
||||
rpcAPEManagerRemoveChain = "RemoveChain"
|
||||
rpcAPEManagerListChains = "ListChains"
|
||||
)
|
||||
|
||||
func AddChain(
|
||||
cli *client.Client,
|
||||
req *apemanager.AddChainRequest,
|
||||
opts ...client.CallOption,
|
||||
) (*apemanager.AddChainResponse, error) {
|
||||
resp := new(apemanager.AddChainResponse)
|
||||
|
||||
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceAPEManager, rpcAPEManagerAddChain), req, resp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func RemoveChain(
|
||||
cli *client.Client,
|
||||
req *apemanager.RemoveChainRequest,
|
||||
opts ...client.CallOption,
|
||||
) (*apemanager.RemoveChainResponse, error) {
|
||||
resp := new(apemanager.RemoveChainResponse)
|
||||
|
||||
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceAPEManager, rpcAPEManagerRemoveChain), req, resp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func ListChains(
|
||||
cli *client.Client,
|
||||
req *apemanager.ListChainsRequest,
|
||||
opts ...client.CallOption,
|
||||
) (*apemanager.ListChainsResponse, error) {
|
||||
resp := new(apemanager.ListChainsResponse)
|
||||
|
||||
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceAPEManager, rpcAPEManagerListChains), req, resp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue