Documentation ¶
Index ¶
- Constants
- Variables
- type HttpConfig
- func (c *HttpConfig) SetAddr(port string) *HttpConfig
- func (c *HttpConfig) SetReadTimetout(t time.Duration) *HttpConfig
- func (c *HttpConfig) SetTLSCertFile(file string) *HttpConfig
- func (c *HttpConfig) SetTLSKeyFile(file string) *HttpConfig
- func (c *HttpConfig) SetWriteTimeout(t time.Duration) *HttpConfig
- type HttpServer
Constants ¶
View Source
const ( DefaultReadTimeout = 5 * time.Second DefaultWriteTimeout = 10 * time.Second )
Variables ¶
View Source
var Config core.Config
Functions ¶
This section is empty.
Types ¶
type HttpConfig ¶
type HttpConfig struct { Addr string ReadTimeout time.Duration WriteTimeout time.Duration TLSCertFile string TLSKeyFile string }
func NewHttpConfig ¶
func NewHttpConfig() *HttpConfig
func (*HttpConfig) SetAddr ¶
func (c *HttpConfig) SetAddr(port string) *HttpConfig
func (*HttpConfig) SetReadTimetout ¶
func (c *HttpConfig) SetReadTimetout(t time.Duration) *HttpConfig
func (*HttpConfig) SetTLSCertFile ¶
func (c *HttpConfig) SetTLSCertFile(file string) *HttpConfig
func (*HttpConfig) SetTLSKeyFile ¶
func (c *HttpConfig) SetTLSKeyFile(file string) *HttpConfig
func (*HttpConfig) SetWriteTimeout ¶
func (c *HttpConfig) SetWriteTimeout(t time.Duration) *HttpConfig
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func NewHttpServer ¶
func NewHttpServer(conf *HttpConfig) *HttpServer
func (*HttpServer) Build ¶
func (s *HttpServer) Build() *HttpServer
func (*HttpServer) ListenAndServe ¶
func (s *HttpServer) ListenAndServe() error
func (*HttpServer) ListenAndServeTLS ¶
func (s *HttpServer) ListenAndServeTLS(cert, key string) error
func (*HttpServer) WithHandler ¶
func (s *HttpServer) WithHandler(handler http.Handler) *HttpServer
Click to show internal directories.
Click to hide internal directories.