Documentation
¶
Index ¶
- type ActivityLogger
- func (l *ActivityLogger) GetLogEntries(filter Filter, onValue func(line []byte) error) error
- func (l *ActivityLogger) GetPath() string
- func (l *ActivityLogger) LogCommand(cmd *cobra.Command, args []string, cmdStr string, messages ...string)
- func (l *ActivityLogger) LogCustom(message string)
- func (l *ActivityLogger) LogRequest(resp *http.Response, body gjson.Result, responseTime int64)
- type CommandEntry
- type Filter
- type Options
- type RequestEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivityLogger ¶
type ActivityLogger struct {
// contains filtered or unexported fields
}
ActivityLogger write command and request information to file for auditing purposes. Safe to call concurrently
func NewActivityLogger ¶
func NewActivityLogger(options Options) (*ActivityLogger, error)
NewActivityLogger creates a new activity logger using given options
func (*ActivityLogger) GetLogEntries ¶
func (l *ActivityLogger) GetLogEntries(filter Filter, onValue func(line []byte) error) error
GetLogEntries get log entries
func (*ActivityLogger) GetPath ¶
func (l *ActivityLogger) GetPath() string
GetPath returns the path to the activity log
func (*ActivityLogger) LogCommand ¶
func (l *ActivityLogger) LogCommand(cmd *cobra.Command, args []string, cmdStr string, messages ...string)
LogCommand writes the c8y cli command used to the activity log
func (*ActivityLogger) LogCustom ¶
func (l *ActivityLogger) LogCustom(message string)
LogCustom writes a custom entry to the activity log
func (*ActivityLogger) LogRequest ¶
LogRequest writes a http response to the activity log
type CommandEntry ¶
type RequestEntry ¶
type RequestEntry struct {
Time string `json:"time,omitempty"`
Context string `json:"ctx,omitempty"`
Type string `json:"type,omitempty"`
Method string `json:"method,omitempty"`
Host string `json:"host,omitempty"`
Path string `json:"path,omitempty"`
Query string `json:"query,omitempty"`
Accept string `json:"accept,omitempty"`
ProcessingMode string `json:"processingMode,omitempty"`
StatusCode int `json:"statusCode,omitempty"`
ResponseTimeMS int `json:"responseTimeMS,omitempty"`
ResponseSelf string `json:"responseSelf,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.