clean

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package clean provides a spell incantation to remove directories in a filesystem. It implements spell.GoCode and can be used without a cast.Caster.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

Option is a clean.Spell option.

func WithLimitToAppOutputDir

func WithLimitToAppOutputDir(limitToAppOutputDir bool) Option

WithLimitToAppOutputDir indicates whether only paths within the configured application output directory should be allowed.

func WithPaths

func WithPaths(paths ...string) Option

WithPaths sets the paths to remove. Note that only paths within the configured application output directory are allowed when WithLimitToAppOutputDir is enabled.

type Options

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

Options are clean.Spell options.

func NewOptions

func NewOptions(opts ...Option) (*Options, error)

NewOptions creates new clean.Spell options.

type Spell

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

Spell is a spell incantation to remove directories in a filesystem. It is of kind spell.KindGoCode and can be used without a cast.Caster.

func New

func New(proj project.Metadata, ac app.Config, opts ...Option) (*Spell, error)

New creates a new spell incantation to remove the configured filesystem paths, e.g. output data like artifacts and reports from previous development, test, production and distribution builds.

func (*Spell) Clean

func (s *Spell) Clean() ([]string, error)

Clean removes the configured paths. It returns an error of type *spell.ErrGoCode for any error that occurs during the execution of the Go code.

func (*Spell) Formula

func (s *Spell) Formula() []string

Formula returns the spell incantation formula. Note that Spell implements spell.GoCode so this method always returns an empty slice!

func (*Spell) Kind

func (s *Spell) Kind() spell.Kind

Kind returns the spell incantation kind.

func (*Spell) Options

func (s *Spell) Options() interface{}

Options returns the spell incantation options.

Jump to

Keyboard shortcuts

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