db

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemaV2 = "v2" // add size to file info

	UsersNs   = "users"
	InfoNs    = "sharing"
	ShareIDNs = "sharingKey"
)

Variables

View Source
var (
	ErrBucketNotFound = errors.New("bucket not found")
	ErrKeyNotFound    = errors.New("key not found")
	ErrCreateExisting = errors.New("create upload info which already exists")
	ErrQuota          = errors.New("quota limit reached")
)

Functions

func UploadNS

func UploadNS(user string) string

Types

type FileInfo

type FileInfo struct {
	IsDir   bool   `json:"isDir"`
	Shared  bool   `json:"shared"`
	ShareID string `json:"shareID"` // for short url
	Sha1    string `json:"sha1"`
	Size    int64  `json:"size"`
}

type Preferences

type Preferences struct {
	Bg         *sitestore.BgConfig `json:"bg"`
	CSSURL     string              `json:"cssURL"`
	LanPackURL string              `json:"lanPackURL"`
	Lan        string              `json:"lan"`
}

type Quota

type Quota struct {
	SpaceLimit         int64 `json:"spaceLimit,string"`
	UploadSpeedLimit   int   `json:"uploadSpeedLimit"`
	DownloadSpeedLimit int   `json:"downloadSpeedLimit"`
}

type UploadInfo

type UploadInfo struct {
	RealFilePath string `json:"realFilePath"`
	Size         int64  `json:"size"`
	Uploaded     int64  `json:"uploaded"`
}

type User

type User struct {
	ID          uint64       `json:"id,string"`
	Name        string       `json:"name"`
	Pwd         string       `json:"pwd"`
	Role        string       `json:"role"`
	UsedSpace   int64        `json:"usedSpace,string"`
	Quota       *Quota       `json:"quota"`
	Preferences *Preferences `json:"preferences"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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