mock

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2024 License: BSD-3-Clause Imports: 2 Imported by: 1

Documentation

Overview

Package mock provides utilities for configuring a mock (in-memory) shiroclient.

Index

Constants

View Source
const (
	// Debug sets the plugin log level to debug
	Debug mockint.LogLevel = iota
	// Info sets the plugin log level to info
	Info
	// Warn sets the plugin log level to warning
	Warn
	// Error sets the plugin log level to error
	Error
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*mockint.Config)

Option is a mock client configuration function

func WithLogLevel

func WithLogLevel(level mockint.LogLevel) Option

WithLogLevel sets the log level of the plugin log writer to the supplied level.

func WithLogWriter

func WithLogWriter(w io.Writer) Option

WithLogWriter sets the plugin's log destination to the supplied io.Writer. By default, the plugin writes to os.Stdout.

func WithPluginPath

func WithPluginPath(path string) Option

WithPluginPath sets the path to the HCP plugin file. By default, the plugin is loaded from the location specified by the SUBSTRATEHCP_FILE environment variable.

func WithSnapshotReader

func WithSnapshotReader(r io.Reader) Option

WithSnapshotReader initializes the state of the mock client by reading a snapshot of previous state from the supplied io.Reader that was previously created with the Snapshot method.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL