package clirpc import ( "gitlink.org.cn/cloudream/jcs-pub/common/pkgs/rpc" ) type ClientAPI interface { ClusterService PubLockService } type Server struct { UnimplementedClientServer *rpc.ServerBase svrImpl ClientAPI } func NewServer(cfg rpc.Config, impl ClientAPI, tokenVerifier rpc.AccessTokenVerifier) *Server { svr := &Server{ svrImpl: impl, } svr.ServerBase = rpc.NewServerBase(cfg, svr, &Client_ServiceDesc, tokenAuthAPIs, tokenVerifier, noAuthAPIs) return svr } var _ ClientServer = (*Server)(nil) var tokenAuthAPIs []string func TokenAuth(api string) bool { tokenAuthAPIs = append(tokenAuthAPIs, api) return true } var noAuthAPIs []string func NoAuth(api string) bool { noAuthAPIs = append(noAuthAPIs, api) return true }