packages

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Undefined  = ""
	PHP        = "php"
	Javascript = "javascript"
	Ruby       = "ruby"
	Python     = "python"
	Go         = "go"
)

language constants

Variables

View Source
var (
	ErrUnknownLang                   = errors.New("command language is not defined")
	ErrRuntimeNotFound               = errors.New("unable to locate runtime")
	ErrRuntimeNoVersionFound         = errors.New("unable to determine installed version, minimum version required")
	ErrRuntimeMinimumVersionRequired = errors.New("higher version is required to install this command")
	ErrPackageManagerNotFound        = errors.New("unable to locate package manager in PATH")
	ErrPackageManagerExec            = errors.New("unable to execute package manager")
	ErrPackageNeedsReinstall         = errors.New("you must reinstall this package to continue")
	ErrPackageCompileFailure         = errors.New("unable to build binary")
)

Defined errors

Functions

This section is empty.

Types

type LangManager

type LangManager interface {
	Install(ctx context.Context, dir string, requirements LanguageRequirements, commands []string) error
	FindExec(ctx context.Context, requirements LanguageRequirements, cmdExec string) ([]string, error)
}

LangManager allows operations on different programming languages

func NewLangManager

func NewLangManager() LangManager

NewLangManager returns a default language manager

type LanguageRequirements

type LanguageRequirements struct {
	Go     string `json:"go"`
	Php    string `json:"php"`
	Node   string `json:"node"`
	Ruby   string `json:"ruby"`
	Python string `json:"python"`
}

LanguageRequirements contains version requirements for all supported programming languages

type Mock

type Mock struct {
	mock.Mock
}

Mock LangManager interface

func (*Mock) FindExec

func (m *Mock) FindExec(_ context.Context, requirements LanguageRequirements, cmdExec string) ([]string, error)

FindExec mock

func (*Mock) Install

func (m *Mock) Install(_ context.Context, dir string, requirements LanguageRequirements, commands []string) error

Install mock

Jump to

Keyboard shortcuts

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