Documentation ¶
Index ¶
- type Builder
- func (b *Builder) ExtractSubPath() (string, string, error)
- func (b *Builder) Validate() error
- func (b *Builder) ValidateAndBuild() (string, error)
- func (b *Builder) WithCheck(check Predicate) *Builder
- func (b *Builder) WithCheckf(check Predicate, msg string, args ...interface{}) *Builder
- func (b *Builder) WithChecks(checks ...Predicate) *Builder
- func (b *Builder) WithPath(path string) *Builder
- func (b *Builder) WithPathJoin(basePath, relPath string) *Builder
- type HostPath
- type Predicate
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 (*Builder) ExtractSubPath ¶
ExtractSubPath is utility function to split directory from path
func (*Builder) Validate ¶
Validate runs through all the checks set on the builder and returns an error when any of the checks fails.
func (*Builder) ValidateAndBuild ¶
ValidateAndBuild is utility function that returns the path if all validation checks have passed
func (*Builder) WithCheck ¶
WithCheck add a single Predicate to the list of checks to be performed by the builder
func (*Builder) WithCheckf ¶
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 ¶
WithChecks adds the list of Predicates to the list of checks to be performed by the builder.
func (*Builder) WithPath ¶
WithPath initializes the Builder with the path on which it has to operate
func (*Builder) WithPathJoin ¶
WithPathJoin initializes the Builder with the path by joining the arguments