folderMgr

package
v0.0.0-...-d1719c8 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const CacheFileFolder = "mesonfiles"
View Source
const FreeSpaceLine = 1 * 1024 * 1024 * 1024 //1GB
View Source
const SpaceHolderFolder = "spaceholder"

Variables

This section is empty.

Functions

This section is empty.

Types

type FolderConfig

type FolderConfig struct {
	AbsPath string `json:"abs_path"`
	SizeGB  int    `json:"size_GB"`
}

type FolderMgr

type FolderMgr struct {
	FolderMap map[uint32]*ProvideFolder
	// contains filtered or unexported fields
}

func New

func New(logger ULog.Logger) *FolderMgr

func (*FolderMgr) AddCacheUsedSize

func (fm *FolderMgr) AddCacheUsedSize(folderId uint32, size int64) error

func (*FolderMgr) AddProvideFolder

func (fm *FolderMgr) AddProvideFolder(absPath string, size int) error

func (*FolderMgr) DeleteRemovedProvideFolder

func (fm *FolderMgr) DeleteRemovedProvideFolder(onCachedFileDeleted func(deletedFileNameHash []string) error, onDownloadingFileDeleted func(deletedFileNameHash []string) error, onPanic func(err interface{})) error

func (*FolderMgr) GetFolderAbsPath

func (fm *FolderMgr) GetFolderAbsPath(folderId uint32) (string, error)

func (*FolderMgr) GetRandomFolderToSave

func (fm *FolderMgr) GetRandomFolderToSave() (folderAbsPath string, folderId uint32, err error)

func (*FolderMgr) GetSpaceInfo

func (fm *FolderMgr) GetSpaceInfo() (total int64, used int64, free int64)

func (*FolderMgr) ReduceCacheUsedSize

func (fm *FolderMgr) ReduceCacheUsedSize(folderId uint32, size int64) error

type ProvideFolder

type ProvideFolder struct {
	model.Folder
	ProvideSize        int64
	MesonCacheUsedSize int64
	// contains filtered or unexported fields
}

func (*ProvideFolder) CheckFolder

func (pd *ProvideFolder) CheckFolder(checkLimitGB int) error

Jump to

Keyboard shortcuts

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