storage

package
v0.0.0-...-385ba70 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDelete

func ConfigDelete(id int) error

func FileDelete

func FileDelete(id int) error

func FileDirExists

func FileDirExists(url string) bool

func Open

func Open(path string) error

func SessionDelete

func SessionDelete(id int) error

func SessionDeleteAll

func SessionDeleteAll() error

func SubFileDelete

func SubFileDelete(id int) error

func UserDelete

func UserDelete(id int) error

Types

type DbConfig

type DbConfig struct {
	ID          int    `json:"id" storm:"id"`
	Hostname    string `json:"hostname"`
	SecretPath  string `json:"secret_path"`
	RedirectUrl string `json:"redirect_url"`
	CookieName  string `json:"cookie_name"`
	CookieToken string `json:"cookie_token"`
}

func ConfigCreate

func ConfigCreate(o *DbConfig) (*DbConfig, error)

func ConfigGet

func ConfigGet(id int) (*DbConfig, error)

func ConfigUpdate

func ConfigUpdate(id int, o *DbConfig) (*DbConfig, error)

type DbFile

type DbFile struct {
	ID           int    `json:"id" storm:"id,increment"`
	Uid          int    `json:"uid" storm:"index"`
	Name         string `json:"name"`
	Filename     string `json:"fname"`
	FileSize     int64  `json:"fsize"`
	UrlPath      string `json:"url_path" storm:"unique"`
	MimeType     string `json:"mime_type"`
	OrigMimeType string `json:"orig_mime_type"`
	CreateTime   int64  `json:"create_time" storm:"index"`
	IsEnabled    bool   `json:"is_enabled"`
	IsPaused     bool   `json:"is_paused"`
	RedirectPath string `json:"redirect_path" storm:"unique"`
	SubName      string `json:"sub_name"`
	SubMimeType  string `json:"sub_mime_type"`
	RefSubFile   int    `json:"ref_sub_file"`
}

func FileCreate

func FileCreate(o *DbFile) (*DbFile, error)

func FileEnable

func FileEnable(id int, enable bool) (*DbFile, error)

func FileGet

func FileGet(id int) (*DbFile, error)

func FileGetByRedirectUrl

func FileGetByRedirectUrl(url string) (*DbFile, error)

func FileGetByUrl

func FileGetByUrl(url string) (*DbFile, error)

func FileList

func FileList() ([]DbFile, error)

func FilePause

func FilePause(id int, pause bool) (*DbFile, error)

func FileResetSubFile

func FileResetSubFile(id int) (*DbFile, error)

func FileUpdate

func FileUpdate(id int, o *DbFile) (*DbFile, error)

type DbSession

type DbSession struct {
	ID         int    `json:"id" storm:"id,increment"`
	Uid        int    `json:"uid" storm:"index"`
	Token      string `json:"token" storm:"unique"`
	CreateTime int64  `json:"create_time"`
}

func SessionCreate

func SessionCreate(o *DbSession) (*DbSession, error)

func SessionGet

func SessionGet(id int) (*DbSession, error)

func SessionGetByToken

func SessionGetByToken(token string) (*DbSession, error)

type DbSubFile

type DbSubFile struct {
	ID         int    `json:"id" storm:"id,increment"`
	Fid        int    `json:"fid"`
	Uid        int    `json:"uid"`
	Name       string `json:"name"`
	Filename   string `json:"fname"`
	FileSize   int64  `json:"fsize"`
	CreateTime int64  `json:"create_time"`
}

func SubFileCreate

func SubFileCreate(o *DbSubFile) (*DbSubFile, error)

func SubFileGet

func SubFileGet(id int) (*DbSubFile, error)

type DbUser

type DbUser struct {
	ID         int    `json:"id" storm:"id,increment"`
	Name       string `json:"name"`
	SearchName string `json:"search_name" storm:"unique"`
	Password   string `json:"password"`
}

func UserCreate

func UserCreate(o *DbUser) (*DbUser, error)

func UserGet

func UserGet(id int) (*DbUser, error)

func UserGetByName

func UserGetByName(username string) (*DbUser, error)

func UserList

func UserList() ([]DbUser, error)

Jump to

Keyboard shortcuts

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