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 767 B

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

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