tool

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: MIT Imports: 15 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildError added in v0.6.1

type BuildError struct {
	Tool Tool
	Err  error
}

func (*BuildError) Error added in v0.6.1

func (e *BuildError) Error() string

func (*BuildError) Unwrap added in v0.6.1

func (e *BuildError) Unwrap() error

type BuildErrors added in v0.6.1

type BuildErrors struct {
	sync.RWMutex
	Errs []*BuildError
}

func (*BuildErrors) Append added in v0.6.1

func (e *BuildErrors) Append(t Tool, err error)

func (*BuildErrors) Empty added in v0.6.1

func (e *BuildErrors) Empty() bool

func (*BuildErrors) Error added in v0.6.1

func (e *BuildErrors) Error() string

func (*BuildErrors) Unwrap added in v0.6.1

func (e *BuildErrors) Unwrap() error

type Config

type Config struct {
	FS           afero.Fs
	WorkingDir   string
	RootDir      string
	ManifestName string
	BinDirName   string
	Verbose      bool
	Log          *log.Logger
}

Config contains configurations to manage development tools.

func (*Config) BinDir

func (c *Config) BinDir() string

func (*Config) BinPath

func (c *Config) BinPath(bin string) string

func (*Config) ManifestPath

func (c *Config) ManifestPath() string

func (*Config) RequireManifest added in v0.4.0

func (c *Config) RequireManifest() error

RequireManifest returns an error if the manifest file does not exist.

type Manifest

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

Manifest contains tool list

func NewManifest

func NewManifest(tools []Tool, mType manager.Type) *Manifest

NewManifest creates a new Manifest instance.

func (*Manifest) AddTool

func (m *Manifest) AddTool(tool Tool)

AddTool adds a new tool to the manifest.

func (*Manifest) FindTool

func (m *Manifest) FindTool(name string) (t Tool, ok bool)

FindTool returns a tool by a name.

func (*Manifest) ManagerType added in v0.5.0

func (m *Manifest) ManagerType() manager.Type

func (*Manifest) Tools

func (m *Manifest) Tools() []Tool

Tools returns a tool list.

type Parser

type Parser interface {
	Parse(path string) (*Manifest, error)
}

Parser retrieve tool packages from given paths.

func NewParser

func NewParser(fs afero.Fs, mType manager.Type) Parser

NewParser creates a new parser instance.

type Repository

type Repository interface {
	List(ctx context.Context) ([]Tool, error)
	Add(ctx context.Context, pkgs ...string) error
	Build(ctx context.Context, t Tool) (string, error)
	BuildAll(ctx context.Context) error
	Run(ctx context.Context, name string, args ...string) error
}

Repository is an interface for managing and operating tools

func NewRepository

func NewRepository(executor manager.Executor, manager manager.Interface, managerType manager.Type, cfg *Config) Repository

NewRepository creates a new Repository instance.

type Tool

type Tool string

Tool represents a go package of a tool dependency.

func (Tool) Name

func (t Tool) Name() string

Name returns an executable name.

type Writer

type Writer interface {
	Write(path string, m *Manifest) error
}

Writer creates a tool file to manage tool dependencies.

func NewWriter

func NewWriter(fs afero.Fs) Writer

NewWriter creates a new Writer instance.

Jump to

Keyboard shortcuts

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