You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mics.go 1.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package hubrpc
  2. import (
  3. context "context"
  4. rpc "gitlink.org.cn/cloudream/jcs-pub/common/pkgs/rpc"
  5. )
  6. type MicsSvc interface {
  7. Ping(ctx context.Context, req *Ping) (*PingResp, *rpc.CodeError)
  8. GetState(ctx context.Context, req *GetState) (*GetStateResp, *rpc.CodeError)
  9. }
  10. // 测试延迟
  11. type Ping struct{}
  12. type PingResp struct{}
  13. var _ = TokenAuth(Hub_Ping_FullMethodName)
  14. func (c *Client) Ping(ctx context.Context, req *Ping) (*PingResp, *rpc.CodeError) {
  15. if c.fusedErr != nil {
  16. return nil, c.fusedErr
  17. }
  18. return rpc.UnaryClient[*PingResp](c.cli.Ping, ctx, req)
  19. }
  20. func (s *Server) Ping(ctx context.Context, req *rpc.Request) (*rpc.Response, error) {
  21. return rpc.UnaryServer(s.svrImpl.Ping, ctx, req)
  22. }
  23. // 获取状态
  24. type GetState struct{}
  25. type GetStateResp struct{}
  26. func (c *Client) GetState(ctx context.Context, req *GetState) (*GetStateResp, *rpc.CodeError) {
  27. if c.fusedErr != nil {
  28. return nil, c.fusedErr
  29. }
  30. return rpc.UnaryClient[*GetStateResp](c.cli.GetState, ctx, req)
  31. }
  32. func (s *Server) GetState(ctx context.Context, req *rpc.Request) (*rpc.Response, error) {
  33. return rpc.UnaryServer(s.svrImpl.GetState, ctx, req)
  34. }

本项目旨在将云际存储公共基础设施化,使个人及企业可低门槛使用高效的云际存储服务(安装开箱即用云际存储客户端即可,无需关注其他组件的部署),同时支持用户灵活便捷定制云际存储的功能细节。