Documentation ¶
Index ¶
- Variables
- func CopyRequestHeaders(r *http.Request, dst *http.Request)
- func CopyResponseHeaders(w http.ResponseWriter, src *http.Response)
- func DumpGoroutinesStackTrace(pid int)
- func GetLogger(r *http.Request) *zap.Logger
- func GetVars(r *http.Request) map[string]string
- func LogPanics(logger *zap.Logger, 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(initDaemon DaemonConstructor, flags *flag.FlagSet) error
- func RunServers(initServer ServerConstructor, flags *flag.FlagSet) error
- func SetLogger(r *http.Request, l *zap.Logger) *http.Request
- func SetVars(r *http.Request, v map[string]string) *http.Request
- func Split2(path string, sep string) (string, string)
- func ValidateRequest(w http.ResponseWriter, r *http.Request) bool
- type Daemon
- type DaemonConstructor
- type KeyType
- type Server
- type ServerConstructor
- type WebWriter
- type WebWriterInterface
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoServerFound = errors.New("no server found")
)
Functions ¶
func CopyResponseHeaders ¶
func CopyResponseHeaders(w http.ResponseWriter, src *http.Response)
func DumpGoroutinesStackTrace ¶
func DumpGoroutinesStackTrace(pid int)
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 RunServers(initServer ServerConstructor, flags *flag.FlagSet) error
func Split2 ¶
Split a string in twain on sep. Doing it this way over strings.Split*() saves allocating a slice.
func ValidateRequest ¶
func ValidateRequest(w http.ResponseWriter, r *http.Request) bool
Types ¶
type WebWriter ¶
type WebWriter struct { http.ResponseWriter Status int ResponseStarted bool }
ResponseWriter that saves its status - used for logging.
func (*WebWriter) WriteHeader ¶
type WebWriterInterface ¶
type WebWriterInterface interface { http.ResponseWriter Response() (bool, int) }
Click to show internal directories.
Click to hide internal directories.