tool

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildError

type BuildError struct {
	Tool Tool
	Err  error
}

func (*BuildError) Error

func (e *BuildError) Error() string

func (*BuildError) Unwrap

func (e *BuildError) Unwrap() error

type BuildErrors

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

func (*BuildErrors) Append

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

func (*BuildErrors) Empty

func (e *BuildErrors) Empty() bool

func (*BuildErrors) Error

func (e *BuildErrors) Error() string

func (*BuildErrors) Unwrap

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

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

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, global bool, 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 struct {
	Global bool
	// contains filtered or unexported fields
}

Tool represents a go package of a tool dependency.

func (Tool) Name

func (t Tool) Name() string

Name returns an executable name.

func (Tool) String

func (t Tool) String() 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