accesslog

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
}

func (*Filter) Decode

func (f *Filter) Decode(c *http.HttpContext) filter.FilterStatus

Decode process http context

func (*Filter) Encode

func (f *Filter) Encode(c *http.HttpContext) filter.FilterStatus

type FilterFactory

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

FilterFactory is http filter instance

func (*FilterFactory) Apply

func (factory *FilterFactory) Apply() error

Apply init after config set

func (*FilterFactory) Config

func (factory *FilterFactory) Config() any

Config return config of filter

func (*FilterFactory) PrepareFilterChain

func (factory *FilterFactory) PrepareFilterChain(ctx *http.HttpContext, chain filter.FilterChain) error

PrepareFilterChain prepare chain when http context init

type Plugin

type Plugin struct {
}

Plugin is http filter plugin.

func (*Plugin) CreateFilterFactory

func (p *Plugin) CreateFilterFactory() (filter.HttpFilterFactory, 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