web

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: GPL-3.0 Imports: 27 Imported by: 7

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 Serve

func Serve() error

func ServeHTTP

func ServeHTTP() error

func ServeLetsEncrypt

func ServeLetsEncrypt() error

func ServeTLS

func ServeTLS() error

func Shutdown

func Shutdown() error

func Startup

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)

func (*FileSystem) PutDir

func (f *FileSystem) PutDir(path string, dir string, base string, index string)

func (*FileSystem) PutEmbedFS

func (f *FileSystem) PutEmbedFS(path string, fs embed.FS, base string, index string)

func (*FileSystem) PutFS

func (f *FileSystem) PutFS(path string, fs fs.FS, base string, index string)

func (*FileSystem) PutZip

func (f *FileSystem) PutZip(path string, zip string, base string, index string)

Jump to

Keyboard shortcuts

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