2015-04-13 21:12:03 +00:00
|
|
|
package audit
|
|
|
|
|
|
|
|
import (
|
2018-03-08 19:21:11 +00:00
|
|
|
"context"
|
2015-04-13 21:12:03 +00:00
|
|
|
"io"
|
2019-05-22 22:52:53 +00:00
|
|
|
|
|
|
|
"github.com/hashicorp/vault/sdk/logical"
|
2015-04-13 21:12:03 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Formatter is an interface that is responsible for formating a
|
|
|
|
// request/response into some format. Formatters write their output
|
|
|
|
// to an io.Writer.
|
2015-04-22 05:42:37 +00:00
|
|
|
//
|
|
|
|
// It is recommended that you pass data through Hash prior to formatting it.
|
2015-04-13 21:12:03 +00:00
|
|
|
type Formatter interface {
|
2019-05-22 22:52:53 +00:00
|
|
|
FormatRequest(context.Context, io.Writer, FormatterConfig, *logical.LogInput) error
|
|
|
|
FormatResponse(context.Context, io.Writer, FormatterConfig, *logical.LogInput) error
|
2016-09-21 14:29:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type FormatterConfig struct {
|
|
|
|
Raw bool
|
|
|
|
HMACAccessor bool
|
|
|
|
|
|
|
|
// This should only ever be used in a testing context
|
|
|
|
OmitTime bool
|
2015-04-13 21:12:03 +00:00
|
|
|
}
|