accesslogs

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: BSD-3-Clause Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SharedStorageManager = NewStorageManager()

Functions

This section is empty.

Types

type BaseStorage

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

func (*BaseStorage) FormatVariables

func (this *BaseStorage) FormatVariables(s string) string

FormatVariables 格式化字符串中的变量

func (*BaseStorage) IsOk

func (this *BaseStorage) IsOk() bool

func (*BaseStorage) Marshal

func (this *BaseStorage) Marshal(accessLog *pb.HTTPAccessLog) ([]byte, error)

Marshal 对日志进行编码

func (*BaseStorage) SetFirewallOnly

func (this *BaseStorage) SetFirewallOnly(firewallOnly bool)

func (*BaseStorage) SetOk

func (this *BaseStorage) SetOk(isOk bool)

func (*BaseStorage) SetVersion

func (this *BaseStorage) SetVersion(version int)

func (*BaseStorage) Version

func (this *BaseStorage) Version() int

type CommandStorage

type CommandStorage struct {
	BaseStorage
	// contains filtered or unexported fields
}

CommandStorage 通过命令行存储

func (*CommandStorage) Close

func (this *CommandStorage) Close() error

Close 关闭

func (*CommandStorage) Config

func (this *CommandStorage) Config() interface{}

func (*CommandStorage) Start

func (this *CommandStorage) Start() error

Start 启动

func (*CommandStorage) Write

func (this *CommandStorage) Write(accessLogs []*pb.HTTPAccessLog) error

写入日志

type ESStorage

type ESStorage struct {
	BaseStorage
	// contains filtered or unexported fields
}

ESStorage ElasticSearch存储策略

func (*ESStorage) Close

func (this *ESStorage) Close() error

Close 关闭

func (*ESStorage) Config

func (this *ESStorage) Config() interface{}

func (*ESStorage) Start

func (this *ESStorage) Start() error

Start 开启

func (*ESStorage) Write

func (this *ESStorage) Write(accessLogs []*pb.HTTPAccessLog) error

写入日志

type FileStorage

type FileStorage struct {
	BaseStorage
	// contains filtered or unexported fields
}

FileStorage 文件存储策略

func (*FileStorage) Close

func (this *FileStorage) Close() error

Close 关闭

func (*FileStorage) Config

func (this *FileStorage) Config() interface{}

func (*FileStorage) Start

func (this *FileStorage) Start() error

Start 开启

func (*FileStorage) Write

func (this *FileStorage) Write(accessLogs []*pb.HTTPAccessLog) error

Write 写入日志

type StorageInterface

type StorageInterface interface {
	// Version 获取版本
	Version() int

	// SetVersion 设置版本
	SetVersion(version int)

	// SetFirewallOnly 设置是否只处理防火墙相关的访问日志
	SetFirewallOnly(firewallOnly bool)

	IsOk() bool

	SetOk(ok bool)

	// Config 获取配置
	Config() interface{}

	// Start 开启
	Start() error

	// Write 写入日志
	Write(accessLogs []*pb.HTTPAccessLog) error

	// Close 关闭
	Close() error
}

StorageInterface 日志存储接口

type StorageManager

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

func NewStorageManager

func NewStorageManager() *StorageManager

func (*StorageManager) Loop

func (this *StorageManager) Loop() error

Loop 更新

func (*StorageManager) Start

func (this *StorageManager) Start()

func (*StorageManager) Write

func (this *StorageManager) Write(policyId int64, accessLogs []*pb.HTTPAccessLog) error

写入日志

type SyslogStorage

type SyslogStorage struct {
	BaseStorage
	// contains filtered or unexported fields
}

SyslogStorage syslog存储策略

func (*SyslogStorage) Close

func (this *SyslogStorage) Close() error

Close 关闭

func (*SyslogStorage) Config

func (this *SyslogStorage) Config() interface{}

func (*SyslogStorage) Start

func (this *SyslogStorage) Start() error

Start 开启

func (*SyslogStorage) Write

func (this *SyslogStorage) Write(accessLogs []*pb.HTTPAccessLog) error

写入日志

type SyslogStoragePriority

type SyslogStoragePriority = int

type SyslogStorageProtocol

type SyslogStorageProtocol = string
const (
	SyslogStorageProtocolTCP    SyslogStorageProtocol = "tcp"
	SyslogStorageProtocolUDP    SyslogStorageProtocol = "udp"
	SyslogStorageProtocolNone   SyslogStorageProtocol = "none"
	SyslogStorageProtocolSocket SyslogStorageProtocol = "socket"
)

type TCPStorage

type TCPStorage struct {
	BaseStorage
	// contains filtered or unexported fields
}

TCPStorage TCP存储策略

func (*TCPStorage) Close

func (this *TCPStorage) Close() error

Close 关闭

func (*TCPStorage) Config

func (this *TCPStorage) Config() interface{}

func (*TCPStorage) Start

func (this *TCPStorage) Start() error

Start 开启

func (*TCPStorage) Write

func (this *TCPStorage) Write(accessLogs []*pb.HTTPAccessLog) error

写入日志

Jump to

Keyboard shortcuts

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