sqlitecgo

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLite

type SQLite struct {
	db.IDB
	// contains filtered or unexported fields
}

func NewSQLite

func NewSQLite(dbPath string) (*SQLite, error)

type SQLiteStore

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

func NewSQLiteStore

func NewSQLiteStore(db db.IDB) (*SQLiteStore, error)

func (*SQLiteStore) AddFileInfo

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

func (*SQLiteStore) AddRole

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

func (*SQLiteStore) AddSharing

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

func (*SQLiteStore) AddUploadInfos

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

func (*SQLiteStore) AddUser

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

func (*SQLiteStore) Close

func (st *SQLiteStore) Close() error

func (*SQLiteStore) DelFileInfo

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

func (*SQLiteStore) DelRole

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

func (*SQLiteStore) DelSharing

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

func (*SQLiteStore) DelUploadingInfos

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

func (*SQLiteStore) DelUser

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

func (*SQLiteStore) GetCfg

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

func (*SQLiteStore) GetFileInfo

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

func (*SQLiteStore) GetSharingDir

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

func (*SQLiteStore) GetUploadInfo

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

func (*SQLiteStore) GetUser

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

func (*SQLiteStore) GetUserByName

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

func (*SQLiteStore) Init

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

func (*SQLiteStore) InitConfigTable

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

func (*SQLiteStore) InitFileTables

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

func (*SQLiteStore) InitUserTable

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

func (*SQLiteStore) IsInited

func (st *SQLiteStore) IsInited() bool

func (*SQLiteStore) IsSharing

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

func (*SQLiteStore) ListFileInfos

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

func (*SQLiteStore) ListRoles

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

func (*SQLiteStore) ListSharingsByLocation

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

func (*SQLiteStore) ListUploadInfos

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

func (*SQLiteStore) ListUserIDs

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

func (*SQLiteStore) ListUsers

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

func (*SQLiteStore) Lock

func (st *SQLiteStore) Lock()

func (*SQLiteStore) MoveFileInfo

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

func (*SQLiteStore) MoveUploadingInfos

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

func (*SQLiteStore) RLock

func (st *SQLiteStore) RLock()

func (*SQLiteStore) RUnlock

func (st *SQLiteStore) RUnlock()

func (*SQLiteStore) ResetUsed

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

func (*SQLiteStore) SetClientCfg

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

func (*SQLiteStore) SetInfo

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

role + quota

func (*SQLiteStore) SetPreferences

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

func (*SQLiteStore) SetPwd

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

func (*SQLiteStore) SetSha1

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

func (*SQLiteStore) SetUploadInfo

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

func (*SQLiteStore) SetUsed

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

func (*SQLiteStore) Unlock

func (st *SQLiteStore) Unlock()

Jump to

Keyboard shortcuts

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