Documentation
¶
Index ¶
- Constants
- func CalculateDirSize(path string) (uint64, error)
- func GetVolumePaths(workspaceName string, volumeExternalId string, volumePath string) (string, string, error)
- func JoinVolumePath(workspaceName, volumeExternalId string, subPaths ...string) string
- type CopyPathContent
- type FileInfo
- type GlobalVolumeService
- func (s *GlobalVolumeService) AbortMultipartUpload(ctx context.Context, in *pb.AbortMultipartUploadRequest) (*pb.AbortMultipartUploadResponse, error)
- func (s *GlobalVolumeService) CompleteMultipartUpload(ctx context.Context, in *pb.CompleteMultipartUploadRequest) (*pb.CompleteMultipartUploadResponse, error)
- func (vs *GlobalVolumeService) CopyPathStream(stream pb.VolumeService_CopyPathStreamServer) error
- func (s *GlobalVolumeService) CreateMultipartUpload(ctx context.Context, in *pb.CreateMultipartUploadRequest) (*pb.CreateMultipartUploadResponse, error)
- func (s *GlobalVolumeService) CreatePresignedURL(ctx context.Context, in *pb.CreatePresignedURLRequest) (*pb.CreatePresignedURLResponse, error)
- func (vs *GlobalVolumeService) DeletePath(ctx context.Context, in *pb.DeletePathRequest) (*pb.DeletePathResponse, error)
- func (vs *GlobalVolumeService) DeleteVolume(ctx context.Context, in *pb.DeleteVolumeRequest) (*pb.DeleteVolumeResponse, error)
- func (gvs *GlobalVolumeService) GenerateWorkspaceVolumePathDownloadToken(workspaceId string, volumePath string) (string, error)
- func (s *GlobalVolumeService) GetFileServiceInfo(ctx context.Context, in *pb.GetFileServiceInfoRequest) (*pb.GetFileServiceInfoResponse, error)
- func (vs *GlobalVolumeService) GetOrCreateVolume(ctx context.Context, in *pb.GetOrCreateVolumeRequest) (*pb.GetOrCreateVolumeResponse, error)
- func (vs *GlobalVolumeService) ListPath(ctx context.Context, in *pb.ListPathRequest) (*pb.ListPathResponse, error)
- func (vs *GlobalVolumeService) ListVolumes(ctx context.Context, in *pb.ListVolumesRequest) (*pb.ListVolumesResponse, error)
- func (vs *GlobalVolumeService) MovePath(ctx context.Context, in *pb.MovePathRequest) (*pb.MovePathResponse, error)
- func (vs *GlobalVolumeService) StatPath(ctx context.Context, in *pb.StatPathRequest) (*pb.StatPathResponse, error)
- func (gvs *GlobalVolumeService) ValidateWorkspaceVolumePathDownloadToken(workspaceId string, volumePath string, token string) error
- type VolumePathTokenData
- type VolumeService
Constants ¶
View Source
const PresignedGetURLExpiration = 3600 // 1 hour
Variables ¶
This section is empty.
Functions ¶
func CalculateDirSize ¶
func GetVolumePaths ¶
func GetVolumePaths(workspaceName string, volumeExternalId string, volumePath string) (string, string, error)
GetVolumePaths returns the absolute parent directory and absolute volumePath. Because volumePath can contain 1 or more of "..", we will return an error if volumePath tries to go above the rootVolumePath. The error should be used to indicate someone accessing a directory above a Volume's directory, which may be a security issue depending on the context.
func JoinVolumePath ¶
Types ¶
type CopyPathContent ¶
type GlobalVolumeService ¶
type GlobalVolumeService struct {
pb.UnimplementedVolumeServiceServer
// contains filtered or unexported fields
}
func (*GlobalVolumeService) AbortMultipartUpload ¶
func (s *GlobalVolumeService) AbortMultipartUpload(ctx context.Context, in *pb.AbortMultipartUploadRequest) (*pb.AbortMultipartUploadResponse, error)
func (*GlobalVolumeService) CompleteMultipartUpload ¶
func (s *GlobalVolumeService) CompleteMultipartUpload(ctx context.Context, in *pb.CompleteMultipartUploadRequest) (*pb.CompleteMultipartUploadResponse, error)
func (*GlobalVolumeService) CopyPathStream ¶
func (vs *GlobalVolumeService) CopyPathStream(stream pb.VolumeService_CopyPathStreamServer) error
func (*GlobalVolumeService) CreateMultipartUpload ¶
func (s *GlobalVolumeService) CreateMultipartUpload(ctx context.Context, in *pb.CreateMultipartUploadRequest) (*pb.CreateMultipartUploadResponse, error)
func (*GlobalVolumeService) CreatePresignedURL ¶
func (s *GlobalVolumeService) CreatePresignedURL(ctx context.Context, in *pb.CreatePresignedURLRequest) (*pb.CreatePresignedURLResponse, error)
func (*GlobalVolumeService) DeletePath ¶
func (vs *GlobalVolumeService) DeletePath(ctx context.Context, in *pb.DeletePathRequest) (*pb.DeletePathResponse, error)
func (*GlobalVolumeService) DeleteVolume ¶
func (vs *GlobalVolumeService) DeleteVolume(ctx context.Context, in *pb.DeleteVolumeRequest) (*pb.DeleteVolumeResponse, error)
func (*GlobalVolumeService) GenerateWorkspaceVolumePathDownloadToken ¶
func (gvs *GlobalVolumeService) GenerateWorkspaceVolumePathDownloadToken(workspaceId string, volumePath string) (string, error)
func (*GlobalVolumeService) GetFileServiceInfo ¶
func (s *GlobalVolumeService) GetFileServiceInfo(ctx context.Context, in *pb.GetFileServiceInfoRequest) (*pb.GetFileServiceInfoResponse, error)
func (*GlobalVolumeService) GetOrCreateVolume ¶
func (vs *GlobalVolumeService) GetOrCreateVolume(ctx context.Context, in *pb.GetOrCreateVolumeRequest) (*pb.GetOrCreateVolumeResponse, error)
func (*GlobalVolumeService) ListPath ¶
func (vs *GlobalVolumeService) ListPath(ctx context.Context, in *pb.ListPathRequest) (*pb.ListPathResponse, error)
func (*GlobalVolumeService) ListVolumes ¶
func (vs *GlobalVolumeService) ListVolumes(ctx context.Context, in *pb.ListVolumesRequest) (*pb.ListVolumesResponse, error)
func (*GlobalVolumeService) MovePath ¶
func (vs *GlobalVolumeService) MovePath(ctx context.Context, in *pb.MovePathRequest) (*pb.MovePathResponse, error)
func (*GlobalVolumeService) StatPath ¶
func (vs *GlobalVolumeService) StatPath(ctx context.Context, in *pb.StatPathRequest) (*pb.StatPathResponse, error)
func (*GlobalVolumeService) ValidateWorkspaceVolumePathDownloadToken ¶
func (gvs *GlobalVolumeService) ValidateWorkspaceVolumePathDownloadToken(workspaceId string, volumePath string, token string) error
type VolumePathTokenData ¶
type VolumeService ¶
type VolumeService interface {
pb.VolumeServiceServer
GetOrCreateVolume(ctx context.Context, in *pb.GetOrCreateVolumeRequest) (*pb.GetOrCreateVolumeResponse, error)
DeleteVolume(ctx context.Context, in *pb.DeleteVolumeRequest) (*pb.DeleteVolumeResponse, error)
ListPath(ctx context.Context, in *pb.ListPathRequest) (*pb.ListPathResponse, error)
DeletePath(ctx context.Context, in *pb.DeletePathRequest) (*pb.DeletePathResponse, error)
MovePath(ctx context.Context, in *pb.MovePathRequest) (*pb.MovePathResponse, error)
CopyPathStream(stream pb.VolumeService_CopyPathStreamServer) error
}
func NewGlobalVolumeService ¶
func NewGlobalVolumeService(config types.FileServiceConfig, backendRepo repository.BackendRepository, workspaceRepo repository.WorkspaceRepository, rdb *common.RedisClient, routeGroup *echo.Group) (VolumeService, error)
Click to show internal directories.
Click to hide internal directories.