Documentation
¶
Index ¶
- func CopyRequestHeaders(r *http.Request, dst *http.Request)
- func CopyResponseHeaders(w http.ResponseWriter, src *http.Response)
- func CustomErrorResponse(w http.ResponseWriter, statusCode int, vars map[string]string)
- func DumpGoroutinesStackTrace(pid int)
- func GetVars(r *http.Request) map[string]string
- func LogPanics(logger LowLevelLogger, msg string)
- func NewCustomWriter(w http.ResponseWriter, f func(w http.ResponseWriter, status int) int) http.ResponseWriter
- func NewRouter() *router
- func RetryListen(ip string, port int) (net.Listener, error)
- func RunDaemon(GetDaemon func(conf.Config, *flag.FlagSet) (Daemon, LowLevelLogger, error), ...)
- func RunServers(...)
- func SetLogger(r *http.Request, l LowLevelLogger) *http.Request
- func SetVars(r *http.Request, v map[string]string) *http.Request
- func SimpleErrorResponse(w http.ResponseWriter, statusCode int, body string)
- func Split2(path string, sep string) (string, string)
- func StandardResponse(w http.ResponseWriter, statusCode int)
- func ValidateRequest(w http.ResponseWriter, r *http.Request) bool
- type Daemon
- type HummingbirdServer
- type KeyType
- type LowLevelLogger
- type Server
- type WebWriter
- type WebWriterInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyResponseHeaders ¶
func CopyResponseHeaders(w http.ResponseWriter, src *http.Response)
func CustomErrorResponse ¶
func CustomErrorResponse(w http.ResponseWriter, statusCode int, vars map[string]string)
func DumpGoroutinesStackTrace ¶
func DumpGoroutinesStackTrace(pid int)
func LogPanics ¶
func LogPanics(logger LowLevelLogger, msg string)
func NewCustomWriter ¶
func NewCustomWriter(w http.ResponseWriter, f func(w http.ResponseWriter, status int) int) http.ResponseWriter
NewCustomWriter creates an http.ResponseWriter wrapper that calls your function on WriteHeader.
func RunServers ¶
func SimpleErrorResponse ¶
func SimpleErrorResponse(w http.ResponseWriter, statusCode int, body string)
func Split2 ¶
Split a string in twain on sep. Doing it this way over strings.Split*() saves allocating a slice.
func StandardResponse ¶
func StandardResponse(w http.ResponseWriter, statusCode int)
func ValidateRequest ¶
func ValidateRequest(w http.ResponseWriter, r *http.Request) bool
Types ¶
type HummingbirdServer ¶
type LowLevelLogger ¶
type LowLevelLogger interface {
Error(msg string, fields ...zapcore.Field)
Info(msg string, fields ...zapcore.Field)
Debug(msg string, fields ...zapcore.Field)
With(fields ...zapcore.Field) *zap.Logger
}
func GetLogger ¶
func GetLogger(r *http.Request) LowLevelLogger
func SetupLogger ¶
func SetupLogger(prefix string, atomicLevel *zap.AtomicLevel, flags *flag.FlagSet) (LowLevelLogger, error)
SetupLogger configures structured logging using uber's zap library.
type WebWriter ¶
type WebWriter struct {
http.ResponseWriter
Status int
ResponseStarted bool
}
func (*WebWriter) WriteHeader ¶
type WebWriterInterface ¶
type WebWriterInterface interface {
http.ResponseWriter
Response() (bool, int)
}
Click to show internal directories.
Click to hide internal directories.