Documentation ¶
Index ¶
- Constants
- func ListenAndServe(addr string, handler http.Handler) error
- func ListenAndServeTLS(addr string, certFile string, keyFile string, handler http.Handler) error
- func SetEnv(mode string)
- type Server
- func (srv *Server) GetCertificateWithOcsp(*tls.ClientHelloInfo) (*tls.Certificate, error)
- func (srv *Server) ListenAndServe() error
- func (srv *Server) ListenAndServeTLS(certFile, keyFile string) error
- func (srv *Server) ListenAndServeTLSOcsp(expire time.Duration, certFile, keyFile string) error
- func (srv *Server) Serve() error
Constants ¶
View Source
const ( DefaultReadTimeout = 60 * time.Second DefaultWriteTimeout = DefaultReadTimeout EnvDebug = "debug" EnvTest = "test" EnvStage = "stage" EnvProd = "prod" )
View Source
const ( GracefulEnvironKey = "IS_GRACEFUL" GracefulEnvironString = GracefulEnvironKey GracefulListenerFd = 3 OcspDefaultExpire = time.Minute * 10 )
Variables ¶
This section is empty.
Functions ¶
func ListenAndServe ¶
ListenAndServe http
func ListenAndServeTLS ¶
ListenAndServeTLS https
Types ¶
type Server ¶
Server HTTP server that supported graceful shutdown or restart
func (*Server) GetCertificateWithOcsp ¶
func (srv *Server) GetCertificateWithOcsp(*tls.ClientHelloInfo) (*tls.Certificate, error)
func (*Server) ListenAndServe ¶
func (*Server) ListenAndServeTLS ¶
func (*Server) ListenAndServeTLSOcsp ¶
Click to show internal directories.
Click to hide internal directories.