package fakemonitoring

import "github.com/google/tink/go/testing/fakemonitoring"

Package fakemonitoring provides a fake implementation of monitoring clients and loggers.

Index

Types

type Client

type Client struct {
	Name string
	// contains filtered or unexported fields
}

Client implements a fake monitoring.Client

func NewClient

func NewClient(name string) *Client

NewClient creates a new fake monitoring client.

func (*Client) Events

func (c *Client) Events() []*LogEvent

Events returns logged events.

func (*Client) Failures

func (c *Client) Failures() []*LogFailure

Failures returns logged failures.

func (*Client) NewLogger

func (c *Client) NewLogger(context *monitoring.Context) (monitoring.Logger, error)

NewLogger creates a new fake Logger.

type LogEvent

type LogEvent struct {
	Context  *monitoring.Context
	KeyID    uint32
	NumBytes int
}

LogEvent stored on each 'Log' operation.

type LogFailure

type LogFailure struct {
	Context *monitoring.Context
}

LogFailure stored on each 'LogFailure' operation.

type Logger

type Logger struct {
	Context *monitoring.Context
	// contains filtered or unexported fields
}

Logger implements a fake monitoring.Logger

func (*Logger) Log

func (l *Logger) Log(keyID uint32, numBytes int)

Log logs the use of a primitive with a key with `keyID` operating over `numBytes`.

func (*Logger) LogFailure

func (l *Logger) LogFailure()

LogFailure captures a failure.

Source Files

fakemonitoring.go

Version
v1.7.0 (latest)
Published
Aug 10, 2022
Platform
linux/amd64
Imports
2 packages
Last checked
3 months ago

Tools for package owners.