Documentation ¶
Index ¶
- Constants
- Variables
- func ExtensionTypeNames() []string
- type Extension
- type ExtensionType
- type Manager
- func (m *Manager) Dispatch(ext Extension, args []string, env *extension.Env, stdin io.Reader, ...) (rerr error)
- func (m *Manager) DryRun() bool
- func (m *Manager) Install(ctx context.Context, target string, force bool) error
- func (m *Manager) List(ctx context.Context, includeLatestVersion bool) ([]Extension, error)
- func (m *Manager) Remove(ext Extension) error
- func (m *Manager) SetClient(client *http.Client)
- func (m *Manager) SetDryRun(v bool)
- func (m *Manager) Upgrade(ctx context.Context, ext Extension) error
Constants ¶
View Source
const Prefix = "tdl-"
Variables ¶
View Source
var ( ErrAlreadyUpToDate = errors.New("already up to date") ErrOnlyGitHub = errors.New("only GitHub extension can be upgraded by tdl") )
View Source
var ErrInvalidExtensionType = fmt.Errorf("not a valid ExtensionType, try [%s]", strings.Join(_ExtensionTypeNames, ", "))
Functions ¶
func ExtensionTypeNames ¶
func ExtensionTypeNames() []string
ExtensionTypeNames returns a list of possible string values of ExtensionType.
Types ¶
type ExtensionType ¶
type ExtensionType string
ExtensionType ENUM(github, local)
const ( // ExtensionTypeGithub is a ExtensionType of type github. ExtensionTypeGithub ExtensionType = "github" // ExtensionTypeLocal is a ExtensionType of type local. ExtensionTypeLocal ExtensionType = "local" )
func ExtensionTypeValues ¶
func ExtensionTypeValues() []ExtensionType
ExtensionTypeValues returns a list of the values for ExtensionType
func ParseExtensionType ¶
func ParseExtensionType(name string) (ExtensionType, error)
ParseExtensionType attempts to convert a string to a ExtensionType.
func (*ExtensionType) Get ¶
func (x *ExtensionType) Get() interface{}
Get implements the Golang flag.Getter interface func.
func (ExtensionType) IsValid ¶
func (x ExtensionType) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (*ExtensionType) Set ¶
func (x *ExtensionType) Set(val string) error
Set implements the Golang flag.Value interface func.
func (ExtensionType) String ¶
func (x ExtensionType) String() string
String implements the Stringer interface.
func (*ExtensionType) Type ¶
func (x *ExtensionType) Type() string
Type implements the github.com/spf13/pFlag Value interface.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) Install ¶
Install installs an extension by target. Valid targets are: - GitHub: owner/repo - Local: path to executable.
Click to show internal directories.
Click to hide internal directories.