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.

server.go 811 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package corrpc
  2. import (
  3. "gitlink.org.cn/cloudream/jcs-pub/common/pkgs/rpc"
  4. )
  5. type CoordinatorAPI interface {
  6. HubService
  7. StorageService
  8. UserService
  9. PubShardsService
  10. }
  11. type Server struct {
  12. UnimplementedCoordinatorServer
  13. *rpc.ServerBase
  14. svrImpl CoordinatorAPI
  15. }
  16. func NewServer(cfg rpc.Config, impl CoordinatorAPI, tokenVerifier rpc.AccessTokenVerifier) *Server {
  17. svr := &Server{
  18. svrImpl: impl,
  19. }
  20. svr.ServerBase = rpc.NewServerBase(cfg, svr, &Coordinator_ServiceDesc, tokenAuthAPIs, tokenVerifier, noAuthAPIs)
  21. return svr
  22. }
  23. var _ CoordinatorServer = (*Server)(nil)
  24. var tokenAuthAPIs []string
  25. func TokenAuth(api string) bool {
  26. tokenAuthAPIs = append(tokenAuthAPIs, api)
  27. return true
  28. }
  29. var noAuthAPIs []string
  30. func NoAuth(api string) bool {
  31. noAuthAPIs = append(noAuthAPIs, api)
  32. return true
  33. }

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