Initial commit

This commit is contained in:
微凉
2020-12-24 01:39:45 +08:00
commit 430b4cf723
30 changed files with 1223 additions and 0 deletions

18
conf/config.go Normal file
View File

@@ -0,0 +1,18 @@
package conf
type Config struct {
Server struct{
SiteUrl string `yaml:"site_url"`//网站url
Port string `yaml:"port"`//端口
Search bool `yaml:"search"`//允许搜索
} `yaml:"server"`
AliDrive struct{
ApiUrl string `yaml:"api_url"`//阿里云盘api
RootFolder string `yaml:"root_folder"`//根目录id
//Authorization string `yaml:"authorization"`//授权token
LoginToken string `yaml:"login_token"`
AccessToken string `yaml:"access_token"`
RefreshToken string `yaml:"refresh_token"`
MaxFilesCount int `yaml:"max_files_count"`
} `yaml:"ali_drive"`
}

30
conf/const.go Normal file
View File

@@ -0,0 +1,30 @@
package conf
import (
"net/http"
)
var(
Debug bool
Help bool
Con string
Client *http.Client
Authorization string
)
var Conf = new(Config)
const (
ImageThumbnailProcess="image/resize,w_50"
VideoThumbnailProcess="video/snapshot,t_0,f_jpg,w_50"
ImageUrlProcess="image/resize,w_1920/format,jpeg"
ASC="ASC"
DESC="DESC"
OrderUpdatedAt="updated_at"
OrderCreatedAt="created_at"
OrderSize="size"
OrderName="name"
OrderSearch="type ASC,updated_at DESC"
AccessTokenInvalid="AccessTokenInvalid"
Bearer="Bearer\t"
)