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

12345678910111213141516171819202122232425262728293031323334353637383940
  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. }
  9. type Server struct {
  10. UnimplementedClientServer
  11. *rpc.ServerBase
  12. svrImpl ClientAPI
  13. }
  14. func NewServer(cfg rpc.Config, impl ClientAPI, tokenVerifier rpc.AccessTokenVerifier) *Server {
  15. svr := &Server{
  16. svrImpl: impl,
  17. }
  18. svr.ServerBase = rpc.NewServerBase(cfg, svr, &Client_ServiceDesc, tokenAuthAPIs, tokenVerifier, noAuthAPIs)
  19. return svr
  20. }
  21. var _ ClientServer = (*Server)(nil)
  22. var tokenAuthAPIs []string
  23. func TokenAuth(api string) bool {
  24. tokenAuthAPIs = append(tokenAuthAPIs, api)
  25. return true
  26. }
  27. var noAuthAPIs []string
  28. func NoAuth(api string) bool {
  29. noAuthAPIs = append(noAuthAPIs, api)
  30. return true
  31. }

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