Documentation
¶
Index ¶
- type Category
- type Entry
- type Level
- type Manager
- func (m *Manager) Close() error
- func (m *Manager) Export(start, end time.Time, format string) ([]byte, error)
- func (m *Manager) GetByID(id string) *Entry
- func (m *Manager) GetRecent(limit int) []*Entry
- func (m *Manager) GetStats(start, end time.Time) (*Stats, error)
- func (m *Manager) Log(level Level, category Category, action, actor, resource, result string, ...) *Entry
- func (m *Manager) LogAuth(action, actor, result string, err error) *Entry
- func (m *Manager) LogConfig(action, actor, resource, result string) *Entry
- func (m *Manager) LogData(action, actor, resource, result string, metadata map[string]interface{}) *Entry
- func (m *Manager) LogError(category Category, action, resource, errMsg string) *Entry
- func (m *Manager) LogPlugin(action, name, result string, err error) *Entry
- func (m *Manager) LogSession(action, sessionID, result string) *Entry
- func (m *Manager) LogSkill(action, name, result string) *Entry
- func (m *Manager) LogSystem(action, result string, metadata map[string]interface{}) *Entry
- func (m *Manager) LogTool(name, result string, duration time.Duration, err error) *Entry
- func (m *Manager) Query(q *Query) ([]*Entry, error)
- type Option
- type Query
- type Stats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
ID string `json:"id"`
Timestamp time.Time `json:"timestamp"`
Level Level `json:"level"`
Category Category `json:"category"`
Action string `json:"action"`
Actor string `json:"actor"`
Resource string `json:"resource"`
Result string `json:"result"` // success, failure, partial
StatusCode int `json:"status_code,omitempty"`
Error string `json:"error,omitempty"`
IPAddress string `json:"ip_address,omitempty"`
UserAgent string `json:"user_agent,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
SessionID string `json:"session_id,omitempty"`
Duration time.Duration `json:"duration,omitempty"`
}
Entry 审计条目
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager 审计管理器
func NewManager ¶
NewManager creates audit manager
func (*Manager) Log ¶
func (m *Manager) Log(level Level, category Category, action, actor, resource, result string, opts ...Option) *Entry
Log 记录审计条目
func (*Manager) LogData ¶
func (m *Manager) LogData(action, actor, resource, result string, metadata map[string]interface{}) *Entry
LogData 记录数据操作
func (*Manager) LogSession ¶
LogSession 记录会话事件
Click to show internal directories.
Click to hide internal directories.