accesslog

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers()

RegisterHandlers registers an access log handler to the handler chain

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler implements chain.Handler Handler records access log. Make sure to complete the initialization before handling the request.

func NewAccessLogHandler

func NewAccessLogHandler(l *log.Logger) *Handler

NewAccessLogHandler creates a Handler

func (*Handler) AddWhiteListAPIs

func (h *Handler) AddWhiteListAPIs(apis ...string)

AddWhiteListAPIs adds APIs to white list, where the APIs will be ignored in access log. Not safe for concurrent use.

func (*Handler) Handle

func (h *Handler) Handle(i *chain.Invocation)

Handle handles the request

func (*Handler) ShouldIgnoreAPI

func (h *Handler) ShouldIgnoreAPI(api string) bool

ShouldIgnoreAPI judges whether the API should be ignored in access log.

Jump to

Keyboard shortcuts

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