api

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: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	API_ERROR_SUCCESS = iota
	API_ERROR_BAD_REQUEST
	API_ERROR_FILE_SAVE_FAILED
	API_ERROR_FILE_NOT_FOUND
	API_ERROR_FILE_DATABASE_FAILED
	API_ERROR_BAD_AUTHENTICATION
	API_ERROR_PASSWORDS_DONT_MATCH
	API_ERROR_USER_ALREADY_EXISTS
	API_ERROR_SERVER_INFO_FAILED
)
View Source
const AUTH_COOKIE_NAME = "t"
View Source
const AUTH_SESSION_TIMEOUT_SECS = 24 * 60 * 60

Variables

Functions

func AuthCheckHandler

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

func AuthOptionsHandler

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

func AuthSession

func AuthSession(r *http.Request) (int, error)

func ClearSecretSessionHandler

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

func ConfigGetHandler

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

func ConfigOptionsHandler

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

func ConfigUpdateHandler

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

func CreateUserHandler

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

func DeleteSubFile

func DeleteSubFile(sub_id int) error

func DumpResponse

func DumpResponse(w http.ResponseWriter, message string, http_status int, error_code int, o interface{})

func FileCreateHandler

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

func FileDeleteHandler

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

func FileDisableHandler

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

func FileEnableHandler

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

func FileListHandler

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

func FileOptionsHandler

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

func FilePauseHandler

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

func FileUnpauseHandler

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

func FileUpdateHandler

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

func LoginUserHandler

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

func LogoutUserHandler

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

func SaveUploadedFile

func SaveUploadedFile(file multipart.File, fhead *multipart.FileHeader, save_path string) error

func ServerInfoGetHandler

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

func ServerInfoOptionsHandler

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

func SetConfig

func SetConfig(cfg *config.Config)

func SubFileCreateHandler

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

func SubFileDeleteHandler

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

func VersionGetHandler

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

func VersionOptionsHandler

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

Types

type ApiResponse

type ApiResponse struct {
	ErrorCode int         `json:"error_code"`
	Message   string      `json:"message"`
	Data      interface{} `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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