Documentation ¶
Index ¶
- Constants
- Variables
- func NewContextWithCallID(ctx context.Context, id ID) context.Context
- func NewUnaryInterceptor(log Log, exclude ExcludeMethod) grpc.UnaryServerInterceptor
- func PeerFromContext(ctx context.Context) *auditv1.Peer
- func RegisterBackend(name string, cons Constructor)
- type AccessLogEntryMaker
- type AccessLogIterator
- type Conf
- type Constructor
- type DecisionLogEntryMaker
- type DecisionLogIterator
- type ExcludeMethod
- type ID
- type IDBytes
- type IDGen
- type Log
Constants ¶
View Source
const (
ConfKey = "audit"
)
Variables ¶
View Source
var (
ErrIteratorClosed = errors.New("iterator closed")
)
Functions ¶
func NewUnaryInterceptor ¶
func NewUnaryInterceptor(log Log, exclude ExcludeMethod) grpc.UnaryServerInterceptor
func RegisterBackend ¶
func RegisterBackend(name string, cons Constructor)
RegisterBackend registers an audit log backend.
Types ¶
type AccessLogEntryMaker ¶
type AccessLogEntryMaker func() (*auditv1.AccessLogEntry, error)
AccessLogEntryMaker is a lazy constructor for access log entries.
type AccessLogIterator ¶
type AccessLogIterator interface {
Next() (*auditv1.AccessLogEntry, error)
}
type Conf ¶
type Conf struct {
// contains filtered or unexported fields
}
func (*Conf) SetDefaults ¶
func (c *Conf) SetDefaults()
func (*Conf) UnmarshalYAML ¶ added in v0.7.0
type DecisionLogEntryMaker ¶
type DecisionLogEntryMaker func() (*auditv1.DecisionLogEntry, error)
DecisionLogEntryMaker is a lazy constructor for decision log entries.
type DecisionLogIterator ¶
type DecisionLogIterator interface {
Next() (*auditv1.DecisionLogEntry, error)
}
type ExcludeMethod ¶
type ID ¶
type ID string
func NewIDForTS ¶
NewIDForTS generates a new ULID for the given timestamp.
func NewIDForTime ¶
NewIDForTime generates a new ULID using the given time.
type IDGen ¶
type IDGen struct {
// contains filtered or unexported fields
}
IDGen is a generator for ULIDs without the monotonicity guarantee. Monotonicity adds overhead that we don't really need because approximate order is good enough for decision logs.
type Log ¶
type Log interface { WriteAccessLogEntry(context.Context, AccessLogEntryMaker) error WriteDecisionLogEntry(context.Context, DecisionLogEntryMaker) error LastNAccessLogEntries(context.Context, uint) AccessLogIterator LastNDecisionLogEntries(context.Context, uint) DecisionLogIterator AccessLogEntriesBetween(context.Context, time.Time, time.Time) AccessLogIterator DecisionLogEntriesBetween(context.Context, time.Time, time.Time) DecisionLogIterator AccessLogEntryByID(context.Context, ID) AccessLogIterator DecisionLogEntryByID(context.Context, ID) DecisionLogIterator Close() }
Click to show internal directories.
Click to hide internal directories.