utils

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotClusterServiceVersion is the error returned with a source isn't a CSV.
	ErrNotClusterServiceVersion = errors.New("Not a ClusterServiceVersion")

	// ErrNotFound is the error returned when a file is not found
	ErrNotFound = errors.New("path not found")

	// ErrPathExpectedDifferentType is the error returned when the path expected a different type.
	ErrPathExpectedDifferentType = errors.New("path expected different type")

	ErrNoOperatorManifests = errors.New("Missing ClusterServiceVersion in operator manifests")

	ErrTooManyCSVs = errors.New("Operator bundle may contain only 1 CSV file, but contains more")

	ErrImageIsARequiredProperty = errors.New("'image' is a required property")
)

Functions

func CheckIfDirectoryExists

func CheckIfDirectoryExists(path string) error

func Lens

func Lens() *lensBuilder

newLens creates a new lens builder

func NewErrImageDoesNotExist

func NewErrImageDoesNotExist(imageName string, err error) error

func NewErrIsNotDirectoryOrDoesNotExist

func NewErrIsNotDirectoryOrDoesNotExist(path string) error

func NewError

func NewError(cause error, format string, args ...interface{}) error

Types

type InputParam

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

InputParam is a parameter used for input. If the name is a "-" it will use the commands stdin.

func NewInputParam

func NewInputParam(isDir bool) InputParam

NewInputParam creates a new InputParam.

func (InputParam) AddFlag

func (o InputParam) AddFlag(cmd *cobra.Command, name, defaultVal, description string)

AddFlag will add the param to a command

func (InputParam) Close

func (o InputParam) Close() error

Close will close the param's input source if applicable.

func (InputParam) FromFile

func (o InputParam) FromFile() error

FromFile initializes the param from a filepath using o.Name

func (InputParam) Init

func (o InputParam) Init(cmd *cobra.Command, args []string) error

Init is a function that sets up the parameter with the intended source.

func (*InputParam) Read

func (o *InputParam) Read(p []byte) (int, error)

Read reads from the parameters's source

type OutputParam

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

OutputParam is a parameter used for output. If the name is a "-" it will use the commands stdout.

func NewOutputParam

func NewOutputParam() OutputParam

NewOutputParam creates a new InputParam.

func (OutputParam) AddFlag

func (o OutputParam) AddFlag(cmd *cobra.Command, name, defaultVal, description string)

AddFlag will add the param to a command

func (OutputParam) Close

func (o OutputParam) Close() error

Close will close the param's input source if applicable.

func (OutputParam) FromFile

func (o OutputParam) FromFile() error

FromFile initializes the param from a filepath using o.Name

func (OutputParam) Init

func (o OutputParam) Init(cmd *cobra.Command, args []string) error

Init is a function that sets up the parameter with the intended source.

func (*OutputParam) Write

func (o *OutputParam) Write(p []byte) (int, error)

Write writes to the parameters's source.

Jump to

Keyboard shortcuts

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