JCS-pub/common/pkgs/rpc/hub/user_space.go

56 lines
1.7 KiB
Go

package hubrpc
/*
import (
"context"
jcstypes "gitlink.org.cn/cloudream/jcs-pub/common/types"
"gitlink.org.cn/cloudream/jcs-pub/common/pkgs/rpc"
stgtypes "gitlink.org.cn/cloudream/jcs-pub/common/pkgs/storage/types"
)
type UserSpaceSvc interface {
BaseStoreListAll(ctx context.Context, req *BaseStoreListAll) (*BaseStoreListAllResp, *rpc.CodeError)
BaseStoreMkdirs(ctx context.Context, req *BaseStoreMkdirs) (*BaseStoreMkdirsResp, *rpc.CodeError)
}
// 列出指定BaseStore的指定位置内的所有文件
type BaseStoreListAll struct {
UserSpace jcstypes.UserSpaceDetail
Path string
}
type BaseStoreListAllResp struct {
Entries []stgtypes.ListEntry
}
func (c *Client) BaseStoreListAll(ctx context.Context, req *BaseStoreListAll) (*BaseStoreListAllResp, *rpc.CodeError) {
if c.fusedErr != nil {
return nil, c.fusedErr
}
return rpc.UnaryClient[*BaseStoreListAllResp](c.cli.BaseStoreListAll, ctx, req)
}
func (s *Server) BaseStoreListAll(ctx context.Context, req *rpc.Request) (*rpc.Response, error) {
return rpc.UnaryServer(s.svrImpl.BaseStoreListAll, ctx, req)
}
// 批量在指定BaseStore中创建文件夹
type BaseStoreMkdirs struct {
UserSpace jcstypes.UserSpaceDetail
Pathes []string
}
type BaseStoreMkdirsResp struct {
Successes []bool
}
func (c *Client) BaseStoreMkdirs(ctx context.Context, req *BaseStoreMkdirs) (*BaseStoreMkdirsResp, *rpc.CodeError) {
if c.fusedErr != nil {
return nil, c.fusedErr
}
return rpc.UnaryClient[*BaseStoreMkdirsResp](c.cli.BaseStoreMkdirs, ctx, req)
}
func (s *Server) BaseStoreMkdirs(ctx context.Context, req *rpc.Request) (*rpc.Response, error) {
return rpc.UnaryServer(s.svrImpl.BaseStoreMkdirs, ctx, req)
}
*/