base

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseStore

type BaseStore struct {
	// contains filtered or unexported fields
}

func NewBaseStore

func NewBaseStore(db db.IDB) *BaseStore

func (*BaseStore) AddFileInfo

func (st *BaseStore) AddFileInfo(ctx context.Context, infoId, userId uint64, itemPath string, info *db.FileInfo) error

func (*BaseStore) AddRole

func (st *BaseStore) AddRole(role string) error

func (*BaseStore) AddSharing

func (st *BaseStore) AddSharing(ctx context.Context, infoId, userId uint64, dirPath string) error

func (*BaseStore) AddUploadInfos

func (st *BaseStore) AddUploadInfos(ctx context.Context, uploadId, userId uint64, tmpPath, filePath string, info *db.FileInfo) error

func (*BaseStore) AddUser

func (st *BaseStore) AddUser(ctx context.Context, user *db.User) error

func (*BaseStore) Close

func (st *BaseStore) Close() error

func (*BaseStore) Db

func (st *BaseStore) Db() db.IDB

func (*BaseStore) DelFileInfo

func (st *BaseStore) DelFileInfo(ctx context.Context, userID uint64, itemPath string) error

func (*BaseStore) DelRole

func (st *BaseStore) DelRole(role string) error

func (*BaseStore) DelSharing

func (st *BaseStore) DelSharing(ctx context.Context, userId uint64, dirPath string) error

func (*BaseStore) DelUploadingInfos

func (st *BaseStore) DelUploadingInfos(ctx context.Context, userId uint64, realPath string) error

func (*BaseStore) DelUser

func (st *BaseStore) DelUser(ctx context.Context, id uint64) error

func (*BaseStore) GetCfg

func (st *BaseStore) GetCfg(ctx context.Context) (*db.SiteConfig, error)

func (*BaseStore) GetFileInfo

func (st *BaseStore) GetFileInfo(ctx context.Context, itemPath string) (*db.FileInfo, error)

func (*BaseStore) GetSharingDir

func (st *BaseStore) GetSharingDir(ctx context.Context, hashID string) (string, error)

func (*BaseStore) GetUploadInfo

func (st *BaseStore) GetUploadInfo(ctx context.Context, userId uint64, filePath string) (string, int64, int64, error)

func (*BaseStore) GetUser

func (st *BaseStore) GetUser(ctx context.Context, id uint64) (*db.User, error)

func (*BaseStore) GetUserByName

func (st *BaseStore) GetUserByName(ctx context.Context, name string) (*db.User, error)

func (*BaseStore) Init

func (st *BaseStore) Init(ctx context.Context, rootName, rootPwd string, cfg *db.SiteConfig) error

func (*BaseStore) InitConfigTable

func (st *BaseStore) InitConfigTable(ctx context.Context, tx *sql.Tx, cfg *db.SiteConfig) error

func (*BaseStore) InitFileTables

func (st *BaseStore) InitFileTables(ctx context.Context, tx *sql.Tx) error

func (*BaseStore) InitUserTable

func (st *BaseStore) InitUserTable(ctx context.Context, tx *sql.Tx, rootName, rootPwd string) error

func (*BaseStore) IsInited

func (st *BaseStore) IsInited() bool

func (*BaseStore) IsSharing

func (st *BaseStore) IsSharing(ctx context.Context, dirPath string) (bool, error)

func (*BaseStore) ListFileInfos

func (st *BaseStore) ListFileInfos(ctx context.Context, itemPaths []string) (map[string]*db.FileInfo, error)

func (*BaseStore) ListRoles

func (st *BaseStore) ListRoles() (map[string]bool, error)

func (*BaseStore) ListSharingsByLocation

func (st *BaseStore) ListSharingsByLocation(ctx context.Context, location string) (map[string]string, error)

func (*BaseStore) ListUploadInfos

func (st *BaseStore) ListUploadInfos(ctx context.Context, userId uint64) ([]*db.UploadInfo, error)

func (*BaseStore) ListUserIDs

func (st *BaseStore) ListUserIDs(ctx context.Context) (map[string]string, error)

func (*BaseStore) ListUsers

func (st *BaseStore) ListUsers(ctx context.Context) ([]*db.User, error)

func (*BaseStore) MoveFileInfo

func (st *BaseStore) MoveFileInfo(ctx context.Context, userId uint64, oldPath, newPath string, isDir bool) error

func (*BaseStore) MoveUploadingInfos

func (st *BaseStore) MoveUploadingInfos(ctx context.Context, infoId, userId uint64, uploadPath, itemPath string) error

func (*BaseStore) ResetUsed

func (st *BaseStore) ResetUsed(ctx context.Context, id uint64, used int64) error

func (*BaseStore) SetClientCfg

func (st *BaseStore) SetClientCfg(ctx context.Context, cfg *db.ClientConfig) error

func (*BaseStore) SetInfo

func (st *BaseStore) SetInfo(ctx context.Context, id uint64, user *db.User) error

role + quota

func (*BaseStore) SetPreferences

func (st *BaseStore) SetPreferences(ctx context.Context, id uint64, prefers *db.Preferences) error

func (*BaseStore) SetPwd

func (st *BaseStore) SetPwd(ctx context.Context, id uint64, pwd string) error

func (*BaseStore) SetSha1

func (st *BaseStore) SetSha1(ctx context.Context, itemPath, sign string) error

func (*BaseStore) SetUploadInfo

func (st *BaseStore) SetUploadInfo(ctx context.Context, userId uint64, filePath string, newUploaded int64) error

func (*BaseStore) SetUsed

func (st *BaseStore) SetUsed(ctx context.Context, id uint64, incr bool, capacity int64) error

Jump to

Keyboard shortcuts

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