Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultIdleTimeout is the default idle timeout used for http server. DefaultIdleTimeout = 30 * time.Second // DefaultReadTimeout is the default read timeout used for http server. DefaultReadTimeout = 30 * time.Second // DefaultWriteTimeout is the default write timeout used for http server. DefaultWriteTimeout = 30 * time.Second // DefaultMaxHeaderBytes is the default max header used for http server. DefaultMaxHeaderBytes = 8190 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct { Port int IdleTimeout time.Duration ReadTimeout time.Duration WriteTimeout time.Duration MaxHeaderBytes int }
Configuration contains the necessary configuration to setup http server.
type Option ¶
type Option func(*Server)
Option is a functional option for Server.
func WithDecompress ¶
func WithDecompress() Option
WithDecompress decompresses request body based if content encoding type is set to "gzip" with default config.
type Route ¶
type Route struct { Method string Path string Handler echo.HandlerFunc Middlewares []echo.MiddlewareFunc }
Route contains the information for matching against requests.
func ReadinessRoute ¶
func ReadinessRoute() Route
ReadinessRoute checks if the service and its dependencies are healthy.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server serves http server.
func NewWithConfig ¶
func NewWithConfig(c Configuration, opts ...Option) Server
NewWithConfig creates a new server with given configuration.
func (Server) AddRoute ¶
AddRoute registers a new route for an http method and path with matching handler in the router with optional route-level middleware.
Click to show internal directories.
Click to hide internal directories.