internal

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdaptorAuto  = "auto"
	AdaptorGoEnv = "goenv"
	AdaptorBrew  = "brew"
	AdaptorScoop = "scoop"
)

Adaptor name consts: scoop, winget

Variables

This section is empty.

Functions

This section is empty.

Types

type Adaptor

type Adaptor interface {
	Name() string
	List() error
	ApplyOpFunc(fn OpFunc)
	Switch(ver string) error
	Install(ver string) error
	Update(ver string) error
	Uninstall(ver string) error
}

Adaptor interface

func MakeAdaptor

func MakeAdaptor(adaptor string) (Adaptor, error)

MakeAdaptor instance

type BrewAdaptor

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

BrewAdaptor struct

func NewBrewAdaptor

func NewBrewAdaptor() *BrewAdaptor

NewBrewAdaptor instance

func (*BrewAdaptor) ApplyOpFunc

func (a *BrewAdaptor) ApplyOpFunc(fn OpFunc)

ApplyOpFunc handle

func (*BrewAdaptor) Install

func (a *BrewAdaptor) Install(ver string) error

Install go by given version

func (*BrewAdaptor) List

func (a *BrewAdaptor) List() error

List installed version

func (*BrewAdaptor) Name

func (a *BrewAdaptor) Name() string

Name of adaptor

func (*BrewAdaptor) Switch

func (a *BrewAdaptor) Switch(ver string) error

Switch go to given version

func (*BrewAdaptor) Uninstall

func (a *BrewAdaptor) Uninstall(ver string) error

Uninstall go by given version

func (*BrewAdaptor) Update

func (a *BrewAdaptor) Update(ver string) error

Update go by given version

type CallOpts

type CallOpts struct {
	LibDir string
	Yes    bool
}

CallOpts struct

type GoEnvAdaptor

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

GoEnvAdaptor struct

func NewGoEnvAdaptor

func NewGoEnvAdaptor() *GoEnvAdaptor

NewGoEnvAdaptor instance

func (*GoEnvAdaptor) ApplyOpFunc

func (a *GoEnvAdaptor) ApplyOpFunc(fn OpFunc)

ApplyOpFunc handle

func (*GoEnvAdaptor) Install

func (a *GoEnvAdaptor) Install(ver string) error

func (*GoEnvAdaptor) List

func (a *GoEnvAdaptor) List() error

func (*GoEnvAdaptor) Name

func (a *GoEnvAdaptor) Name() string

Name of adaptor

func (*GoEnvAdaptor) Switch

func (a *GoEnvAdaptor) Switch(ver string) error

func (*GoEnvAdaptor) Uninstall

func (a *GoEnvAdaptor) Uninstall(ver string) error

func (*GoEnvAdaptor) Update

func (a *GoEnvAdaptor) Update(ver string) error

type HandleFn

type HandleFn func(ver string) error

HandleFn define

type OpFunc

type OpFunc func(opts *CallOpts)

OpFunc define

type ScoopAdaptor

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

ScoopAdaptor struct

func NewScoopAdaptor

func NewScoopAdaptor() *ScoopAdaptor

NewScoopAdaptor instance

func (*ScoopAdaptor) ApplyOpFunc

func (a *ScoopAdaptor) ApplyOpFunc(fn OpFunc)

ApplyOpFunc handle

func (*ScoopAdaptor) Install

func (a *ScoopAdaptor) Install(ver string) error

func (*ScoopAdaptor) List

func (a *ScoopAdaptor) List() error

func (*ScoopAdaptor) Name

func (a *ScoopAdaptor) Name() string

Name of adaptor

func (*ScoopAdaptor) Switch

func (a *ScoopAdaptor) Switch(ver string) error

func (*ScoopAdaptor) Uninstall

func (a *ScoopAdaptor) Uninstall(ver string) error

func (*ScoopAdaptor) Update

func (a *ScoopAdaptor) Update(ver string) error

type StdAdaptor

type StdAdaptor struct {
	ListFn    func() error
	SwitchFn  HandleFn
	InstallFn HandleFn
	UpdateFn  HandleFn
	// UninstallFn handler
	UninstallFn HandleFn
	// contains filtered or unexported fields
}

StdAdaptor struct

func NewStdAdaptor

func NewStdAdaptor(name string) *StdAdaptor

NewStdAdaptor instance

func (*StdAdaptor) ApplyOpFunc

func (a *StdAdaptor) ApplyOpFunc(fn OpFunc)

ApplyOpFunc handle

func (*StdAdaptor) Install

func (a *StdAdaptor) Install(ver string) error

func (*StdAdaptor) List

func (a *StdAdaptor) List() error

func (*StdAdaptor) Name

func (a *StdAdaptor) Name() string

Name of adaptor

func (*StdAdaptor) Switch

func (a *StdAdaptor) Switch(ver string) error

func (*StdAdaptor) Uninstall

func (a *StdAdaptor) Uninstall(ver string) error

func (*StdAdaptor) Update

func (a *StdAdaptor) Update(ver string) error

func (*StdAdaptor) WithOptions

func (a *StdAdaptor) WithOptions(fns ...OpFunc) *StdAdaptor

Jump to

Keyboard shortcuts

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