Documentation
¶
Index ¶
- Constants
- Variables
- func AddLog(content string)
- func BuildFailureResp(w http.ResponseWriter, code int, msg string)
- func BuildSuccessResp(w http.ResponseWriter, data interface{})
- func DisableAuditLog(w http.ResponseWriter, r *http.Request)
- func GetAuditLogInfo() (dir, logModule string, logMaxSize int64, err error)
- func LogClientOp(op, src, dst string, err error, latency int64, srcInode, dstInode uint64)
- func LogDataNodeOp(op, msg string, err error)
- func LogDentryOp(clientAddr, volume, op, name, fullPath string, err error, latency int64, ...)
- func LogInodeOp(clientAddr, volume, op, fullPath string, err error, latency int64, ino uint64, ...)
- func LogMasterOp(op, msg string, err error)
- func LogTxOp(clientAddr, volume, op, txId string, err error, latency int64)
- func ResetWriterBuffSize(w http.ResponseWriter, r *http.Request)
- func ResetWriterBufferSize(size int)
- func StopAudit()
- type Audit
- func InitAudit(dir, logModule string, logMaxSize int64) (*Audit, error)
- func InitAuditWithPrefix(dir, logModule string, logMaxSize int64, prefix *AuditPrefix) (a *Audit, err error)
- func NewAudit(dir, logModule string, logMaxSize int64) (*Audit, error)
- func NewAuditWithPrefix(dir, logModule string, logMaxSize int64, prefix *AuditPrefix) (a *Audit, err error)
- func (a *Audit) AddLog(content string)
- func (a *Audit) GetInfo() (dir, logModule string, logMaxSize int64)
- func (a *Audit) LogChangeDpDecommission(oldStatus string, status string, src string, disk string, dpId uint64, ...)
- func (a *Audit) LogClientOp(op, src, dst string, err error, latency int64, srcInode, dstInode uint64)
- func (a *Audit) LogDentryOp(clientAddr, volume, op, name, fullPath string, err error, latency int64, ...)
- func (a *Audit) LogInodeOp(clientAddr, volume, op, fullPath string, err error, latency int64, ino uint64, ...)
- func (a *Audit) LogResetDpDecommission(status string, src string, disk string, dpId uint64, dst string)
- func (a *Audit) LogTxOp(clientAddr, volume, op, txId string, err error, latency int64)
- func (a *Audit) ResetWriterBufferSize(size int)
- func (a *Audit) Stop()
- type AuditPrefix
- type ShiftedFile
Constants ¶
View Source
const ( Audit_Module = "audit" FileNameDateFormat = "20060102150405" ShiftedExtension = ".old" DefaultAuditLogBufSize = 0 F_OK = 0 DefaultCleanInterval = 1 * time.Hour DefaultAuditLogSize = 200 * 1024 * 1024 // 200M DefaultHeadRoom = 50 * 1024 // 50G MaxReservedDays = 7 * 24 * time.Hour )
View Source
const ( EnableAuditLogReqPath = "/auditlog/enable" DisableAuditLogReqPath = "/auditlog/disable" SetAuditLogBufSizeReqPath = "/auditlog/setbufsize" )
Variables ¶
View Source
var DefaultTimeOutUs = [3]uint32{100000, 500000, 1000000}
Functions ¶
func BuildFailureResp ¶
func BuildFailureResp(w http.ResponseWriter, code int, msg string)
func BuildSuccessResp ¶
func BuildSuccessResp(w http.ResponseWriter, data interface{})
func DisableAuditLog ¶
func DisableAuditLog(w http.ResponseWriter, r *http.Request)
func GetAuditLogInfo ¶
func LogClientOp ¶
func LogDataNodeOp ¶
func LogDentryOp ¶
func LogInodeOp ¶
func LogMasterOp ¶
func ResetWriterBuffSize ¶
func ResetWriterBuffSize(w http.ResponseWriter, r *http.Request)
NOTE: for client http apis
func ResetWriterBufferSize ¶
func ResetWriterBufferSize(size int)
Types ¶
type Audit ¶
type Audit struct {
// contains filtered or unexported fields
}
func InitAuditWithPrefix ¶
func InitAuditWithPrefix(dir, logModule string, logMaxSize int64, prefix *AuditPrefix) (a *Audit, err error)
func NewAuditWithPrefix ¶
func NewAuditWithPrefix(dir, logModule string, logMaxSize int64, prefix *AuditPrefix) (a *Audit, err error)
func (*Audit) LogChangeDpDecommission ¶
func (*Audit) LogClientOp ¶
func (*Audit) LogDentryOp ¶
func (*Audit) LogInodeOp ¶
func (*Audit) LogResetDpDecommission ¶
func (*Audit) ResetWriterBufferSize ¶
type AuditPrefix ¶
type AuditPrefix struct {
// contains filtered or unexported fields
}
func NewAuditPrefix ¶
func NewAuditPrefix(p ...string) *AuditPrefix
func (*AuditPrefix) String ¶
func (a *AuditPrefix) String() string
type ShiftedFile ¶
func (ShiftedFile) Len ¶
func (f ShiftedFile) Len() int
func (ShiftedFile) Less ¶
func (f ShiftedFile) Less(i, j int) bool
func (ShiftedFile) Swap ¶
func (f ShiftedFile) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.