Documentation ¶
Index ¶
- Constants
- func ConnectDB() (*dbr.Session, error)
- func ConnectDBRecheck(session *dbr.Session) (*dbr.Session, error)
- func CreateBookHash(filePath string) string
- func CreateFolderHash(filePath string) string
- func CreatePasswordHash(password string) string
- func DeleteBook(id int64) error
- func DeleteFolder(id int64) error
- func DeleteHistory(userName string) error
- func DeleteUser(id int64) error
- func InsertBook(folderHash string, filePath string, fileSize int, page int, modTime time.Time) error
- func InsertFolder(filePath string, parentHash string, modTime time.Time) error
- func InsertHistory(userName string, bookHash string, readPos int, reaction int, ...) error
- func InsertUser(name string, password string, permission int) error
- func UpdateBook(folderHash string, filePath string, fileSize int, page int, modTime time.Time) error
- func UpdateFolder(filePath string, parentHash string, modTime time.Time) error
- func UpdateHistory(userName string, bookHash string, readPos int, reaction int) error
- func UpdateUser(name string, password string, permission int) error
- type BookTable
- type FolderTable
- type HistoryTable
- type UserTable
Constants ¶
View Source
const ( UserPermissionUser = 1 UserPermissionAdmin = 100 )
定数
Variables ¶
This section is empty.
Functions ¶
func CreateBookHash ¶
func CreateFolderHash ¶
func CreatePasswordHash ¶
CreatePasswordHash パスワードからパスワードハッシュを生成する
func DeleteBook ¶
func DeleteFolder ¶
func DeleteHistory ¶
func DeleteUser ¶
func InsertBook ¶
func InsertHistory ¶
func UpdateBook ¶
func UpdateHistory ¶
Types ¶
type BookTable ¶
type BookTable struct { ID int64 `db:"id"` Hash string `db:"hash"` FolderHash string `db:"folder_hash"` FilePath string `db:"file_path"` FileSize int `db:"file_size"` Page int `db:"page"` ModTime time.Time `db:"mod_time"` }
BookTable アーカイブ情報テーブル
func SelectBook ¶
func SelectBookAll ¶
func SelectBookFromHash ¶
type FolderTable ¶
type FolderTable struct { ID int64 `db:"id"` Hash string `db:"hash"` ParentHash string `db:"parent_hash"` FilePath string `db:"file_path"` ModTime time.Time `db:"mod_time"` }
FolderTable アーカイブ情報テーブル
func SelectFolder ¶
func SelectFolder(filePath string) (FolderTable, error)
func SelectFolderAll ¶
func SelectFolderAll() ([]FolderTable, error)
func SelectFolderFromHash ¶
func SelectFolderFromHash(hash string) (FolderTable, error)
func SelectFolderListFromParent ¶
func SelectFolderListFromParent(parentHash string) ([]FolderTable, error)
func SelectFolderRoot ¶
func SelectFolderRoot() (FolderTable, error)
type HistoryTable ¶
type HistoryTable struct { ID int64 `db:"id"` UserName string `db:"user_name"` BookHash string `db:"book_hash"` ReadPos int `db:"read_pos"` Reaction int `db:"reaction"` ModTime time.Time `db:"mod_time"` }
情報テーブル
func SelectHistory ¶
func SelectHistory(userName string, bookHash string) (HistoryTable, error)
Click to show internal directories.
Click to hide internal directories.