server

package
v0.0.0-...-0b9a7cd Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SuccessCode             = 10000
	ErrorCodePassword       = 20001
	ErrorCodeOnceToken      = 20002
	ErrorCodeUsernameRepeat = 20003
)

Variables

View Source
var OnceTokenMap = make(map[string]map[string]string)

Functions

func HandleFiles

func HandleFiles(w http.ResponseWriter, _ *http.Request, dirTemplate fs.FS)

func HandleWs

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

func IsImageExt

func IsImageExt(filename string) bool

IsImageExt 判断是否是图片后缀

func PreCheck

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

func Upload

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

Types

type PreCheckParam

type PreCheckParam struct {
	RoomNumber string `json:"room_number"`
	UserName   string `json:"username"`
	Password   string `json:"password"`
}

type ResponseData

type ResponseData struct {
	Code      int    `json:"code"`
	Info      string `json:"info"`
	Data      any    `json:"data"`
	PublicKey string `json:"public_key"`
}

Jump to

Keyboard shortcuts

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