Documentation ¶
Index ¶
- func IsPrivateIP(address string) (bool, error)
- func RealIP(r *http.Request) string
- type Option
- func WithAccessLog(enabled bool) Option
- func WithAddr(addr string) Option
- func WithAddress(address string) Option
- func WithCORS(enabled bool) Option
- func WithDebug(debug bool) Option
- func WithLogger(logger *zap.Logger) Option
- func WithMiddleware(middleware func(http.Handler) http.Handler) Option
- func WithPathPrefix(prefix string) Option
- func WithPort(port int) Option
- func WithShutdownTimeout(timeout time.Duration) Option
- func WithStartupTimeout(timeout time.Duration) Option
- func WithStripQueryString(enabled bool) Option
- type Server
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsPrivateIP ¶ added in v0.2.11
IsPrivateIP works by checking if the address is under private CIDR blocks. List of private CIDR blocks can be seen on :
Types ¶
type Option ¶
type Option func(s *Server)
func WithAccessLog ¶ added in v0.2.11
func WithAddress ¶
func WithLogger ¶
func WithPathPrefix ¶
func WithShutdownTimeout ¶ added in v0.1.5
func WithStartupTimeout ¶ added in v0.1.5
func WithStripQueryString ¶ added in v0.2.1
type Server ¶
type Server struct { http.Server App Service Address string Port int CertFile string KeyFile string PathPrefix string StartupTimeout time.Duration ShutdownTimeout time.Duration Logger *zap.Logger Debug bool }
Server wraps the Service with additional http and app lifecycle handling
func (*Server) RunContext ¶ added in v0.5.9
Click to show internal directories.
Click to hide internal directories.