Documentation ¶
Index ¶
- Constants
- Variables
- func AccessLogMiddleware(ctx *gin.Context)
- func InitAccessLogger(params *paramtable.ComponentParam)
- func NewMinioHandler(ctx context.Context, cfg *paramtable.MinioConfig, rootPath string, ...) (*minioHandler, error)
- func SetHTTPParams(p *gin.LogFormatterParams)
- func UnaryAccessLogInterceptor(ctx context.Context, req any, rpcInfo *grpc.UnaryServerInfo, ...) (interface{}, error)
- func UnaryUpdateAccessInfoInterceptor(ctx context.Context, req any, rpcInfonfo *grpc.UnaryServerInfo, ...) (interface{}, error)
- type AccessKey
- type AccessLogger
- type CacheWriter
- type Formatter
- type FormatterManger
- type RetentionFunc
- type RotateWriter
Constants ¶
View Source
const ContextLogKey = "accesslog"
Variables ¶
View Source
var BaseFormatterKey = "base"
View Source
var (
CheckBucketRetryAttempts uint = 20
)
Functions ¶
func AccessLogMiddleware ¶
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 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 (*CacheWriter) Close ¶
func (l *CacheWriter) Close()
func (*CacheWriter) Flush ¶
func (l *CacheWriter) Flush() error
func (*CacheWriter) Start ¶
func (l *CacheWriter) Start()
type Formatter ¶
type Formatter struct {
// contains filtered or unexported fields
}
func NewFormatter ¶
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
Source Files ¶
Click to show internal directories.
Click to hide internal directories.