Documentation
¶
Index ¶
- Variables
- type BaseStorage
- func (this *BaseStorage) FormatVariables(s string) string
- func (this *BaseStorage) IsOk() bool
- func (this *BaseStorage) Marshal(accessLog *pb.HTTPAccessLog) ([]byte, error)
- func (this *BaseStorage) SetFirewallOnly(firewallOnly bool)
- func (this *BaseStorage) SetOk(isOk bool)
- func (this *BaseStorage) SetVersion(version int)
- func (this *BaseStorage) Version() int
- type CommandStorage
- type ESStorage
- type FileStorage
- type StorageInterface
- type StorageManager
- type SyslogStorage
- type SyslogStoragePriority
- type SyslogStorageProtocol
- type TCPStorage
Constants ¶
This section is empty.
Variables ¶
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 NewCommandStorage ¶
func NewCommandStorage(config *serverconfigs.AccessLogCommandStorageConfig) *CommandStorage
func (*CommandStorage) Config ¶
func (this *CommandStorage) Config() interface{}
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 NewESStorage ¶
func NewESStorage(config *serverconfigs.AccessLogESStorageConfig) *ESStorage
type FileStorage ¶
type FileStorage struct {
BaseStorage
// contains filtered or unexported fields
}
FileStorage 文件存储策略
func NewFileStorage ¶
func NewFileStorage(config *serverconfigs.AccessLogFileStorageConfig) *FileStorage
func (*FileStorage) Config ¶
func (this *FileStorage) Config() interface{}
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) 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 NewSyslogStorage ¶
func NewSyslogStorage(config *serverconfigs.AccessLogSyslogStorageConfig) *SyslogStorage
func (*SyslogStorage) Config ¶
func (this *SyslogStorage) Config() interface{}
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 NewTCPStorage ¶
func NewTCPStorage(config *serverconfigs.AccessLogTCPStorageConfig) *TCPStorage
func (*TCPStorage) Config ¶
func (this *TCPStorage) Config() interface{}
Click to show internal directories.
Click to hide internal directories.