Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultWriteTimeout = 30 * time.Second DefaultReadTimeout = 60 * time.Second DefaultReadHeaderTimeout = 5 * time.Second DefaultIdleTimeout = 30 * time.Second )
View Source
const DaemonTypeHTTPd boot.DaemonType = "httpd"
Variables ¶
This section is empty.
Functions ¶
func HandleREST ¶
func HandleREST[I any, O any](pattern string, handler RESTHandler[I, O])
Types ¶
type APIHandler ¶
type APIHandler func(http.ResponseWriter, *http.Request) any
func (APIHandler) ServeHTTP ¶
func (ah APIHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Cfg ¶
type Cfg struct {
Addr string `env:"ADDR" long:"addr" yaml:"addr" validate:"required" description:"http listen address"`
WriteTimeout time.Duration `` /* 161-byte string literal not displayed */
ReadTimeout time.Duration `` /* 229-byte string literal not displayed */
ReadHeaderTimeout time.Duration `` /* 154-byte string literal not displayed */
IdleTimeout time.Duration `` /* 184-byte string literal not displayed */
}
type HTTPD ¶ added in v0.1.20
type RESTHandler ¶
func (RESTHandler[I, O]) ServeHTTP ¶
func (rh RESTHandler[I, O]) ServeHTTP(w http.ResponseWriter, r *http.Request)
type RawHandler ¶
type RawHandler func(http.ResponseWriter, *http.Request) []byte
func (RawHandler) ServeHTTP ¶
func (rh RawHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.