accesslog

package
v0.4.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Kind is the kind of Fallback.
	Kind = constant.HTTPAccessLogFilter
)

Variables

This section is empty.

Functions

func WriteToFile

func WriteToFile(accessLogMsg string, filePath string) error

WriteToFile write message to access log file

Types

type AccessLogConfig

type AccessLogConfig struct {
	OutPutPath string `yaml:"outPutPath" json:"outPutPath" mapstructure:"outPutPath" default:"console"`
}

access log config, enable default value true, outputpath default value console AccessLogConfig access log will out put into console

type AccessLogData

type AccessLogData struct {
	AccessLogMsg    string
	AccessLogConfig AccessLogConfig
}

AccessLogData access log data

type AccessLogWriter

type AccessLogWriter struct {
	AccessLogDataChan chan AccessLogData
}

AccessLogWriter access log chan

func (*AccessLogWriter) Write

func (alw *AccessLogWriter) Write()

Write write log into out put path

func (*AccessLogWriter) Writer

func (alw *AccessLogWriter) Writer(accessLogData AccessLogData)

Writer writer msg into chan

type Filter

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

Filter is http filter instance

func (*Filter) Apply

func (f *Filter) Apply() error

Apply init after config set

func (*Filter) Config

func (f *Filter) Config() interface{}

Config return config of filter

func (*Filter) Handle

func (f *Filter) Handle(c *http.HttpContext)

Handle process http context

func (*Filter) PrepareFilterChain

func (f *Filter) PrepareFilterChain(ctx *http.HttpContext) error

PrepareFilterChain prepare chain when http context init

type Plugin

type Plugin struct {
}

Plugin is http filter plugin.

func (*Plugin) CreateFilter

func (p *Plugin) CreateFilter() (filter.HttpFilter, error)

CreateFilter create filter

func (*Plugin) Kind

func (p *Plugin) Kind() string

Kind return plugin kind

Jump to

Keyboard shortcuts

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