internal

package
v0.0.0-...-8ce278b Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(r *fasthttp.RequestCtx, v ...any)

Error logs the given v along with r in error log.

func Errorf

func Errorf(r *fasthttp.RequestCtx, format string, v ...any)

Errorf logs the given v with format along with r in error log.

func Info

func Info(r *fasthttp.RequestCtx, v ...any)

Info logs the given v along with r in access log.

func Infof

func Infof(r *fasthttp.RequestCtx, format string, v ...any)

Infof logs the given v with format along with r in access log.

func SetLogCollector

func SetLogCollector(ctx *fasthttp.RequestCtx, lc *LogCollector) (free func())

SetLogCollector returns a new context with LogCollector.

func StartHttp

func StartHttp(host string, port int, handler fasthttp.RequestHandler, opts ...StartOption) error

StartHttp starts a http server.

func StartHttps

func StartHttps(host string, port int, certFile, keyFile string, handler fasthttp.RequestHandler,
	opts ...StartOption) error

StartHttps starts a https server.

Types

type LogCollector

type LogCollector struct {
	Messages []string
	// contains filtered or unexported fields
}

LogCollector is used to collect logs.

func LogCollectorFromContext

func LogCollectorFromContext(ctx context.Context) *LogCollector

LogCollectorFromContext returns LogCollector from ctx.

func (*LogCollector) Append

func (lc *LogCollector) Append(msg string)

Append appends msg into log context.

func (*LogCollector) Flush

func (lc *LogCollector) Flush() string

Flush flushes collected logs.

type StartOption

type StartOption func(svr *fasthttp.Server)

StartOption defines the method to customize http.Server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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