accesslog

package
v0.10.3-0...-27c22d1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const ContextLogKey = "accesslog"

Variables

View Source
var BaseFormatterKey = "base"
View Source
var (
	CheckBucketRetryAttempts uint = 20
)

Functions

func AccessLogMiddleware

func AccessLogMiddleware(ctx *gin.Context)

func InitAccessLogger

func InitAccessLogger(params *paramtable.ComponentParam)

func NewMinioHandler

func NewMinioHandler(ctx context.Context, cfg *paramtable.MinioConfig, rootPath string, queueLen int) (*minioHandler, error)

func SetHTTPParams

func SetHTTPParams(p *gin.LogFormatterParams)

func UnaryAccessLogInterceptor

func UnaryAccessLogInterceptor(ctx context.Context, req any, rpcInfo *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

func UnaryUpdateAccessInfoInterceptor

func UnaryUpdateAccessInfoInterceptor(ctx context.Context, req any, rpcInfonfo *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

Types

type AccessKey

type AccessKey struct{}

type AccessLogger

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

func NewAccessLogger

func NewAccessLogger() *AccessLogger

func (*AccessLogger) Init

func (l *AccessLogger) Init(params *paramtable.ComponentParam) error

func (*AccessLogger) SetEnable

func (l *AccessLogger) SetEnable(enable bool) error

func (*AccessLogger) Write

func (l *AccessLogger) Write(info info.AccessInfo) bool

type CacheWriter

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

func NewCacheWriter

func NewCacheWriter(writer io.Writer, cacheSize int, flushInterval time.Duration) *CacheWriter

func NewCacheWriterWithCloser

func NewCacheWriterWithCloser(writer io.Writer, closer io.Closer, cacheSize int, flushInterval time.Duration) *CacheWriter

func (*CacheWriter) Close

func (l *CacheWriter) Close()

func (*CacheWriter) Flush

func (l *CacheWriter) Flush() error

func (*CacheWriter) Start

func (l *CacheWriter) Start()

func (*CacheWriter) Write

func (l *CacheWriter) Write(p []byte) (n int, err error)

type Formatter

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

func NewFormatter

func NewFormatter(base string) *Formatter

func (*Formatter) Format

func (f *Formatter) Format(i info.AccessInfo) string

type FormatterManger

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

Formaater manager not concurrent safe make sure init with Add and SetMethod before use Get

func NewFormatterManger

func NewFormatterManger() *FormatterManger

func (*FormatterManger) Add

func (m *FormatterManger) Add(name, fmt string)

func (*FormatterManger) GetByMethod

func (m *FormatterManger) GetByMethod(method string) (*Formatter, bool)

func (*FormatterManger) SetMethod

func (m *FormatterManger) SetMethod(name string, methods ...string)

type RetentionFunc

type RetentionFunc func(object minio.ObjectInfo) bool

minIO client for upload access log TODO file retention on minio

type RotateWriter

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

a rotated file writer

func NewRotateWriter

func NewRotateWriter(logCfg *paramtable.AccessLogConfig, minioCfg *paramtable.MinioConfig) (*RotateWriter, error)

func (*RotateWriter) Close

func (l *RotateWriter) Close() error

func (*RotateWriter) Rotate

func (l *RotateWriter) Rotate() error

func (*RotateWriter) Write

func (l *RotateWriter) Write(p []byte) (n int, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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