internal

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const LogContext = "request_logs"

Variables

This section is empty.

Functions

func Error

func Error(r *http.Request, v ...interface{})

func Errorf

func Errorf(r *http.Request, format string, v ...interface{})

func GetRemoteAddr

func GetRemoteAddr(r *http.Request) string

Returns the peer address, supports X-Forward-For

func Info

func Info(r *http.Request, v ...interface{})

func Infof

func Infof(r *http.Request, format string, v ...interface{})

func StartHttp

func StartHttp(host string, port int, handler http.Handler) error

func StartHttps

func StartHttps(host string, port int, certFile, keyFile string, handler http.Handler) error

func StartServer

func StartServer(srv *http.Server) error

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

func (tp *TokenParser) ParseToken(r *http.Request, secret, prevSecret string) (*jwt.Token, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL