controllers

package
v0.0.0-...-857260f Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MSG_NONE                   = 0
	MSG_SUCCESS                = 1
	MSG_ERROR                  = 2
	EXTENTION_NULL             = 0
	EXTENTION_EDIT             = 1
	HEADER_CONTENT_DISPOSITION = "Content-Disposition"
	USER_FILE                  = "USER"
)
View Source
const (
	VIEW_GRID = "grid"
	VIEW_TBL  = "table"
)
View Source
const HOME = "home/"

Variables

View Source
var EDITABLE_TYPE = []string{"txt", "md", "markdown", "h", "c", "cpp", "c++", "go", "xml", "json", "java", "conf", "ini", "css", "js", "sh", "py", "log"}
View Source
var ROOT_PATH = api.AppConfig.String("http_file_path")
View Source
var SESSION_FILE api.Config
View Source
var TOKEN_INDEX_MAP = map[string]string{}
View Source
var TOKEN_MAP = map[string]string{}

Functions

func AboutController

func AboutController(w http.ResponseWriter, r *http.Request)

func AuthController

func AuthController(w http.ResponseWriter, r *http.Request)

func BashController

func BashController(w http.ResponseWriter, r *http.Request)

func CheckSession

func CheckSession(w http.ResponseWriter, r *http.Request) bool

func Compress

func Compress(files []*os.File, dest string) ([]byte, error)

压缩文件 files 文件数组,可以是不同dir下的文件或者文件夹 dest 压缩文件存放地址

func DelController

func DelController(w http.ResponseWriter, r *http.Request)

func DoZlibCompress

func DoZlibCompress(src []byte) []byte

进行zlib压缩

func DownloadController

func DownloadController(w http.ResponseWriter, r *http.Request)

func DownloadShareController

func DownloadShareController(w http.ResponseWriter, r *http.Request)

func EditController

func EditController(w http.ResponseWriter, r *http.Request)

func FileController

func FileController(w http.ResponseWriter, r *http.Request)

func FolderController

func FolderController(w http.ResponseWriter, r *http.Request)

func HttpController

func HttpController(w http.ResponseWriter, r *http.Request, username string)

func IndexController

func IndexController(w http.ResponseWriter, r *http.Request)

func LoginController

func LoginController(w http.ResponseWriter, r *http.Request)

func LogoutController

func LogoutController(w http.ResponseWriter, r *http.Request)

func PutController

func PutController(w http.ResponseWriter, r *http.Request)

func RegisterController

func RegisterController(w http.ResponseWriter, r *http.Request)

func SearchController

func SearchController(w http.ResponseWriter, r *http.Request)

func ShareController

func ShareController(w http.ResponseWriter, r *http.Request)

func UploadController

func UploadController(w http.ResponseWriter, r *http.Request)

Types

type CommonResponse

type CommonResponse struct {
	Msg      Msg
	Folder   Folder
	Username string
}

type EditResponse

type EditResponse struct {
	FileName string
	FilePath string
	FileText string
}

type File

type File struct {
	Name              string
	Size              string
	Path              string
	ModTime           string
	Type              string
	Editable          bool
	DownloadFrequency int
}

type Folder

type Folder struct {
	Up      string
	Path    string
	Folders []string
	Files   []File
	Readme  Readme
}

type Msg

type Msg struct {
	Text string
	Type int
}

type Readme

type Readme struct {
	Text     string
	FileName string
}

type SearchResponse

type SearchResponse struct {
	Msg     Msg
	Results []File
}

Jump to

Keyboard shortcuts

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