yamldump

package module
v0.0.0-...-4368114 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

README

yamldump

Go Reference

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dump

func Dump(t *testing.T, v any, opts ...Option)

func Register

func Register(v any, opts ...Option)

Types

type Dumper

type Dumper struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Dumper

New creates a new Dumper with the given options. The Dumper can be used to dump values to a file.

func (*Dumper) Dump

func (d *Dumper) Dump(t *testing.T, v any, opts ...Option)

func (*Dumper) Register

func (d *Dumper) Register(v any, opts ...Option)

type Masker

type Masker struct {
	// contains filtered or unexported fields
}

Define a struct for a Masker

func NewMask

func NewMask(mask string) *Masker

NewMask is a constructor for the Masker struct

func (*Masker) MaskFields

func (m *Masker) MaskFields(fields ...string) Option

MaskFields is a method on Masker that masks certain fields

func (*Masker) MaskPaths

func (m *Masker) MaskPaths(paths ...string) Option

MaskPaths is a method on Masker that masks certain paths

type Option

type Option func(o *options)

Define a function type Option that takes a pointer to an options struct

func CmpOpts

func CmpOpts(opts ...cmp.Option) Option

CmpOpts is an Option that adds comparison options

func Colors

func Colors(colors bool) Option

Colors is an Option that sets the colors flag

func Env

func Env(name string) Option

Env is an Option that sets the environment variable name

func File

func File(name string) Option

File is an Option that sets the file name

func IgnoreFields

func IgnoreFields(fields ...string) Option

IgnoreFields is an Option that ignores certain fields

func IgnorePaths

func IgnorePaths(paths ...string) Option

IgnorePaths is an Option that ignores certain paths

func MaskFields

func MaskFields(mask string, fields []string) Option

MaskFields is an Option that masks certain fields

func MaskPaths

func MaskPaths(mask string, paths []string) Option

MaskPaths is an Option that masks certain paths

func RawOutput

func RawOutput(raw bool) Option

func Transformers

func Transformers(fns ...func([]byte) ([]byte, error)) Option

Transformers is an Option that adds a transformer function

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry() *Registry

func (*Registry) Get

func (r *Registry) Get(v any) []Option

func (*Registry) Register

func (r *Registry) Register(v any, opts ...Option)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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