webs

package
v0.7.28 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestName added in v0.1.14

func RequestName(r *http.Request) string

func RequestNameX added in v0.2.63

func RequestNameX(r *http.Request, xRemoteAddress string) string

func RouteName added in v0.1.9

func RouteName(method, uri string) string

func WebSocketName added in v0.1.14

func WebSocketName(name string) string

Types

type DomainMux added in v0.5.28

type DomainMux struct {
	// contains filtered or unexported fields
}

func NewDomainMux added in v0.5.28

func NewDomainMux() *DomainMux

func (*DomainMux) DefaultHandler added in v0.5.28

func (o *DomainMux) DefaultHandler(h http.Handler)

func (*DomainMux) Handler added in v0.5.28

func (o *DomainMux) Handler(domain string, h http.Handler)

func (*DomainMux) PureReverseProxy added in v0.5.28

func (o *DomainMux) PureReverseProxy(domain string, target string) error

func (*DomainMux) ReverseProxy added in v0.5.28

func (o *DomainMux) ReverseProxy(domain string, target string) error

func (*DomainMux) ServeHTTP added in v0.5.28

func (o *DomainMux) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DualServer

type DualServer struct {
	// contains filtered or unexported fields
}

func NewDual

func NewDual() *DualServer

func (*DualServer) Run

func (o *DualServer) Run(addr string, addrTls string, handler http.Handler) error

func (*DualServer) Shutdown

func (o *DualServer) Shutdown()

func (*DualServer) WithAutoRedirectToTls added in v0.5.27

func (o *DualServer) WithAutoRedirectToTls() *DualServer

func (*DualServer) WithAutoSecret added in v0.1.27

func (o *DualServer) WithAutoSecret(dir string, domains ...string) *DualServer

func (*DualServer) WithLogErrors added in v0.1.78

func (o *DualServer) WithLogErrors(use bool) *DualServer

func (*DualServer) WithLogErrorsLevel added in v0.1.78

func (o *DualServer) WithLogErrorsLevel(level ulog.Level) *DualServer

func (*DualServer) WithLogRequests added in v0.1.78

func (o *DualServer) WithLogRequests(use bool) *DualServer

func (*DualServer) WithOnTlsConfig added in v0.7.21

func (o *DualServer) WithOnTlsConfig(f func(*tls.Config) *tls.Config) *DualServer

func (*DualServer) WithRedirectToTls added in v0.1.53

func (o *DualServer) WithRedirectToTls(use string) *DualServer

func (*DualServer) WithSecret

func (o *DualServer) WithSecret(certFile, keyFile string) *DualServer

func (*DualServer) WithSecretDir

func (o *DualServer) WithSecretDir(dir string) *DualServer

func (*DualServer) WithTimeout added in v0.6.4

func (o *DualServer) WithTimeout(t Timeout) *DualServer

func (*DualServer) WithXRemoteAddress added in v0.2.65

func (o *DualServer) WithXRemoteAddress(s string) *DualServer

type OnRequest added in v0.1.8

type OnRequest func(http.ResponseWriter, *http.Request)

type OnWebsocket added in v0.1.8

type OnWebsocket func(*websocket.Conn, *http.Request)

type Router added in v0.1.8

type Router struct {
	// contains filtered or unexported fields
}

func NewRouter added in v0.1.8

func NewRouter() *Router

func (Router) Branch added in v0.1.8

func (o Router) Branch(path string) *Router

func (*Router) Delete added in v0.1.8

func (o *Router) Delete(path string, onRequest OnRequest)

func (*Router) Files added in v0.1.8

func (o *Router) Files(files fs.FS)

func (*Router) Get added in v0.1.8

func (o *Router) Get(path string, onRequest OnRequest)

func (*Router) Handle added in v0.1.8

func (o *Router) Handle(method string, path string, onRequest OnRequest)

func (*Router) IsRoot added in v0.1.18

func (o *Router) IsRoot() bool

func (*Router) Log added in v0.1.9

func (o *Router) Log() *ulog.Log

func (*Router) Options added in v0.1.17

func (o *Router) Options(path string, onRequest OnRequest)

func (*Router) Post added in v0.1.8

func (o *Router) Post(path string, onRequest OnRequest)

func (*Router) Put added in v0.1.8

func (o *Router) Put(path string, onRequest OnRequest)

func (*Router) Router added in v0.1.10

func (o *Router) Router() *mux.Router

func (*Router) Uri added in v0.7.20

func (o *Router) Uri(path string) string

func (*Router) WebSocket added in v0.1.8

func (o *Router) WebSocket(path string, onWebsocket OnWebsocket)

func (*Router) WithID added in v0.1.8

func (o *Router) WithID(id any) *Router

func (*Router) WithLogRequest added in v0.1.14

func (o *Router) WithLogRequest(logRequest bool) *Router

func (*Router) WithUpgradeErrorLevel added in v0.1.89

func (o *Router) WithUpgradeErrorLevel(level ulog.Level) *Router

func (*Router) WithXRemoteAddress added in v0.2.64

func (o *Router) WithXRemoteAddress(s string) *Router

type Server

type Server struct {
	// contains filtered or unexported fields
}

func New

func New() *Server

func (*Server) IsTls

func (o *Server) IsTls() bool

func (*Server) LogRequest added in v0.1.78

func (o *Server) LogRequest(mux http.Handler) http.Handler

func (*Server) Run

func (o *Server) Run(addr string, handler http.Handler)

func (*Server) Shutdown

func (o *Server) Shutdown()

func (*Server) WithAutoSecret added in v0.1.27

func (o *Server) WithAutoSecret(dir string, domains ...string) *Server

func (*Server) WithLogErrors added in v0.1.78

func (o *Server) WithLogErrors(use bool) *Server

func (*Server) WithLogErrorsLevel added in v0.1.78

func (o *Server) WithLogErrorsLevel(level ulog.Level) *Server

func (*Server) WithLogRequests added in v0.1.78

func (o *Server) WithLogRequests(use bool) *Server

func (*Server) WithOnTlsConfig added in v0.7.21

func (o *Server) WithOnTlsConfig(f func(*tls.Config) *tls.Config) *Server

func (*Server) WithSecret added in v0.1.27

func (o *Server) WithSecret(certFile, keyFile string) *Server

func (*Server) WithSecretDir added in v0.1.27

func (o *Server) WithSecretDir(dir string) *Server

func (*Server) WithTimeout added in v0.6.3

func (o *Server) WithTimeout(timeout Timeout) *Server

func (*Server) WithXRemoteAddress added in v0.2.65

func (o *Server) WithXRemoteAddress(s string) *Server

type Timeout added in v0.6.3

type Timeout struct {
	Write time.Duration
	Read  time.Duration
	Idle  time.Duration
	Close time.Duration
}

Jump to

Keyboard shortcuts

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