Documentation
¶
Index ¶
- Constants
- func Error(r *http.Request, v ...interface{})
- func Errorf(r *http.Request, format string, v ...interface{})
- func GetRemoteAddr(r *http.Request) string
- func Info(r *http.Request, v ...interface{})
- func Infof(r *http.Request, format string, v ...interface{})
- func StartHttp(host string, port int, handler http.Handler) error
- func StartHttps(host string, port int, certFile, keyFile string, handler http.Handler) error
- func StartServer(srv *http.Server) error
- type LogCollector
- type ParseOption
- type TokenParser
Constants ¶
View Source
const LogContext = "request_logs"
Variables ¶
This section is empty.
Functions ¶
func GetRemoteAddr ¶
Returns the peer address, supports X-Forward-For
func StartHttps ¶
func StartServer ¶
Types ¶
type LogCollector ¶
type LogCollector struct {
Messages []string
// contains filtered or unexported fields
}
func (*LogCollector) Append ¶
func (lc *LogCollector) Append(msg string)
func (*LogCollector) Flush ¶
func (lc *LogCollector) Flush() string
type ParseOption ¶
type ParseOption func(parser *TokenParser)
func WithResetDuration ¶
func WithResetDuration(duration time.Duration) ParseOption
type TokenParser ¶
type TokenParser struct {
// contains filtered or unexported fields
}
func NewTokenParser ¶
func NewTokenParser(opts ...ParseOption) *TokenParser
func (*TokenParser) ParseToken ¶
Click to show internal directories.
Click to hide internal directories.