asanazap

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package asanazap provides handlers to enable ZAP log. package main

import (

"time"

"go.uber.org/zap"

asana "github.com/goasana/asana"
"github.com/goasana/asana/plugins/asanazap"

)

type MainController struct {
	asana.Controller
}
func (this *MainController) Get() {
	this.ctx.Text("hello world")
}
func main() {
	logger, _ := zap.NewProduction()
	asanazap.InitAsanaZapMiddleware(logger, time.RFC3339, true)
	asana.Router("/", &MainController{})
	asana.Run(":8090")
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeforeMiddlewareZap

func BeforeMiddlewareZap() func(ctx *context.Context)

BeforeMiddlewareZap For insert in asana.BeforeRouter Filter

func FinishMiddlewareZap

func FinishMiddlewareZap(logger *zap.Logger, timeFormat string, utc bool, appendBody bool) func(ctx *context.Context)

FinishMiddlewareZap For insert in asana.FinishRouter Filter

func InitAsanaZapMiddleware

func InitAsanaZapMiddleware(logger *zap.Logger, timeFormat string, utc bool, appendBody ...bool)

InitAsanaZapMiddleware add del filters

Types

This section is empty.

Jump to

Keyboard shortcuts

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