v1alpha1

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

Builder provides utility functions on the HostPath to extract different information

func NewBuilder

func NewBuilder() *Builder

NewBuilder builds a new Builder

func (*Builder) ExtractSubPath

func (b *Builder) ExtractSubPath() (string, string, error)

ExtractSubPath is utility function to split directory from path

func (*Builder) Validate

func (b *Builder) Validate() error

Validate runs through all the checks set on the builder and returns an error when any of the checks fails.

func (*Builder) ValidateAndBuild

func (b *Builder) ValidateAndBuild() (string, error)

ValidateAndBuild is utility function that returns the path if all validation checks have passed

func (*Builder) WithCheck

func (b *Builder) WithCheck(check Predicate) *Builder

WithCheck add a single Predicate to the list of checks to be performed by the builder

func (*Builder) WithCheckf

func (b *Builder) WithCheckf(check Predicate, msg string, args ...interface{}) *Builder

WithCheckf adds a single Predicate to the list of checks to be performed by the builder, along with the message to be returned when the check fails

func (*Builder) WithChecks

func (b *Builder) WithChecks(checks ...Predicate) *Builder

WithChecks adds the list of Predicates to the list of checks to be performed by the builder.

func (*Builder) WithPath

func (b *Builder) WithPath(path string) *Builder

WithPath initializes the Builder with the path on which it has to operate

func (*Builder) WithPathJoin

func (b *Builder) WithPathJoin(basePath, relPath string) *Builder

WithPathJoin initializes the Builder with the path by joining the arguments

type HostPath

type HostPath string

HostPath is a wrapper over a given path string It provides build, validations and other common logic to be used by various feature specific callers.

type Predicate

type Predicate func(HostPath) bool

Predicate defines an abstraction to determine conditional checks against the provided HostPath instance

func IsNonRoot

func IsNonRoot() Predicate

IsNonRoot is a predicate that determines the hostpath is not directly under /

Jump to

Keyboard shortcuts

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