namespace

package
v0.5.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrInvalidFormat invalid output format.
	ErrInvalidFormat = fmt.Errorf("invalid format (valid options: base, yaml, json, export, markdown)")
)

Functions

This section is empty.

Types

type Option

type Option func(*Printer)

Option list of available options for modifying the output.

func ToFormat

func ToFormat(format OutputFormat) Option

ToFormat sets the output format of the printer.

func WithRegex

func WithRegex(r string) Option

WithRegex namespace regex.

func WithWriter

func WithWriter(w io.Writer) Option

WithWriter option for passing a custom io.Writer.

type OutputFormat

type OutputFormat int

OutputFormat enum of valid output formats.

const (
	// Base prints the secrets in the default format.
	Base OutputFormat = iota

	// YAML prints the secrets in yaml format.
	YAML

	// JSON prints the secrets in json format.
	JSON
)

type Printer

type Printer struct {
	Regex string
	// contains filtered or unexported fields
}

Printer struct that holds all options used for displaying the secrets.

func NewPrinter

func NewPrinter(opts ...Option) *Printer

NewPrinter return a new printer struct.

func (*Printer) Out

func (p *Printer) Out(ns map[string][]string) error

Out prits out namespaces in various formats. nolint: cyclop

Jump to

Keyboard shortcuts

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