examples

package module
v0.0.0-...-aeba20d Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware(next http.Handler) http.Handler

func ExampleContextExtractorTraceContext

func ExampleContextExtractorTraceContext()

This example shows how to use the context, and print OpenTelemetry trace in log. If you have an api server that supports OpenTelemetry, you can use this example in your handler middleware and print trace in each log.

func ExampleContextExtractorUserContext

func ExampleContextExtractorUserContext()

The following is an example of printing a user request in http server. The log contains user information and can be used as an audit log.

func ExampleDevelopment

func ExampleDevelopment()

func ExampleSlogWithZlogHandler

func ExampleSlogWithZlogHandler()

func ExampleStacktrace

func ExampleStacktrace()

func ExampleTimeFormatter

func ExampleTimeFormatter()

func ExampleZlogLogger

func ExampleZlogLogger()

func LogMiddleware

func LogMiddleware(log *zlog.Logger, next http.Handler) http.Handler

Types

This section is empty.

Jump to

Keyboard shortcuts

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