package corrpc import ( context "context" "gitlink.org.cn/cloudream/jcs-pub/common/pkgs/rpc" cortypes "gitlink.org.cn/cloudream/jcs-pub/coordinator/types" ) type StorageService interface { SelectStorageHub(ctx context.Context, msg *SelectStorageHub) (*SelectStorageHubResp, *rpc.CodeError) } // 为指定的Storage选择一个适合通信的Hub type SelectStorageHub struct { Storages []cortypes.StorageType } type SelectStorageHubResp struct { Hubs []*cortypes.Hub } func (c *Client) SelectStorageHub(ctx context.Context, msg *SelectStorageHub) (*SelectStorageHubResp, *rpc.CodeError) { if c.fusedErr != nil { return nil, c.fusedErr } return rpc.UnaryClient[*SelectStorageHubResp](c.cli.SelectStorageHub, ctx, msg) } func (s *Server) SelectStorageHub(ctx context.Context, msg *rpc.Request) (*rpc.Response, error) { return rpc.UnaryServer(s.svrImpl.SelectStorageHub, ctx, msg) }