volume

package
v0.0.0-...-f65cf3b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2024 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateDirSize

func CalculateDirSize(path string) (uint64, error)

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

func JoinVolumePath(workspaceName, volumeExternalId string, subPaths ...string) string

Types

type CopyPathContent

type CopyPathContent struct {
	Path    string
	Content []byte
}

type FileInfo

type FileInfo struct {
	Path    string `json:"path"`
	Size    uint64 `json:"size"`
	ModTime int64  `json:"mod_time"`
	IsDir   bool   `json:"is_dir"`
}

type GlobalVolumeService

type GlobalVolumeService struct {
	pb.UnimplementedVolumeServiceServer
	// contains filtered or unexported fields
}

func (*GlobalVolumeService) CopyPathStream

func (*GlobalVolumeService) DeletePath

func (*GlobalVolumeService) DeleteVolume

func (*GlobalVolumeService) GenerateWorkspaceVolumePathDownloadToken

func (gvs *GlobalVolumeService) GenerateWorkspaceVolumePathDownloadToken(workspaceId string, volumePath string) (string, error)

func (*GlobalVolumeService) GetOrCreateVolume

func (*GlobalVolumeService) ListPath

func (*GlobalVolumeService) ListVolumes

func (*GlobalVolumeService) MovePath

func (*GlobalVolumeService) ValidateWorkspaceVolumePathDownloadToken

func (gvs *GlobalVolumeService) ValidateWorkspaceVolumePathDownloadToken(workspaceId string, volumePath string, token string) error

type VolumePathTokenData

type VolumePathTokenData struct {
	WorkspaceId string `redis:"workspace_id"`
	VolumePath  string `redis:"volume_path"`
}

type VolumeService

func NewGlobalVolumeService

func NewGlobalVolumeService(backendRepo repository.BackendRepository, workspaceRepo repository.WorkspaceRepository, rdb *common.RedisClient, routeGroup *echo.Group) (VolumeService, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL