web

package
v4.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 25 Imported by: 8

Documentation

Index

Constants

View Source
const MODULE = "web"

Variables

View Source
var Engine *gin.Engine
View Source
var JwtExpire = time.Hour * 24 * 30
View Source
var JwtKey = "iot-master"
View Source
var Server *http.Server

Functions

func CreateReverseProxy

func CreateReverseProxy(typ, address string) (*httputil.ReverseProxy, error)

func JwtGenerate

func JwtGenerate(id string) (string, error)

func RegisterSwaggerDocs

func RegisterSwaggerDocs(app *gin.RouterGroup, instance string)

func Serve

func Serve() error

func ServeHTTP

func ServeHTTP() error

func ServeLetsEncrypt

func ServeLetsEncrypt() error

func ServeTLS

func ServeTLS() error

func Shutdown added in v4.0.13

func Shutdown() error

func Startup added in v4.1.0

func Startup() error

Types

type Claims

type Claims struct {
	Id string `json:"id"`
	jwt.RegisteredClaims
}

func JwtVerify

func JwtVerify(str string) (*Claims, error)

type FileSystem

type FileSystem struct {
	// contains filtered or unexported fields
}
var Static FileSystem

func (*FileSystem) Open

func (f *FileSystem) Open(name string) (file http.File, err error)

func (*FileSystem) Put

func (f *FileSystem) Put(path string, fs http.FileSystem, base string, index string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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