open-vault/audit/formatter.go

28 lines
741 B
Go
Raw Normal View History

2015-04-13 21:12:03 +00:00
package audit
import (
"io"
2016-09-21 14:29:42 +00:00
"github.com/hashicorp/vault/helper/salt"
2015-04-13 21:12:03 +00:00
"github.com/hashicorp/vault/logical"
)
// 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 {
2016-09-21 14:29:42 +00:00
FormatRequest(io.Writer, FormatterConfig, *logical.Auth, *logical.Request, error) error
FormatResponse(io.Writer, FormatterConfig, *logical.Auth, *logical.Request, *logical.Response, error) error
}
type FormatterConfig struct {
Raw bool
Salt *salt.Salt
HMACAccessor bool
// This should only ever be used in a testing context
OmitTime bool
2015-04-13 21:12:03 +00:00
}