system

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ShellCategory   = "general shell"
	BuildCategory   = "general build"
	SystemCategory  = "system"
	GeneralCategory = "general"
)

Variables

View Source
var BashCompletionSource string
View Source
var BinName = path.Base(os.Args[0])
View Source
var ShellFunctionsSource string
View Source
var TmpDirName = "tmp"

Functions

func HasFeature

func HasFeature(name string, commands []*cli.Command) (present bool)

func ListFeatures

func ListFeatures(commands []*cli.Command) (names []string)

Types

type CCommand

type CCommand struct {
	TagName string

	App *cli.App
	Ctx context.Context
	// contains filtered or unexported fields
}

func (*CCommand) Context

func (c *CCommand) Context() (ctx context.Context)

func (*CCommand) ExtraCommands

func (s *CCommand) ExtraCommands(app *cli.App) (commands []*cli.Command)

func (*CCommand) Init

func (c *CCommand) Init(this interface{})

func (*CCommand) Name

func (c *CCommand) Name() (name string)

func (*CCommand) Prepare

func (s *CCommand) Prepare(ctx *cli.Context) (err error)

func (*CCommand) Setup

func (c *CCommand) Setup(app *cli.App) (err error)

func (*CCommand) This

func (c *CCommand) This() (self Command)

type CSystem

type CSystem struct {
	CCommand

	Url string

	Version   string
	Root      string
	TarGz     string
	TarGzPath string
	TarGzUrl  string
	TarUnzip  bool
}

func (*CSystem) Clean

func (s *CSystem) Clean(ctx *cli.Context) (err error)

func (*CSystem) CleanAction

func (s *CSystem) CleanAction(ctx *cli.Context) (err error)

func (*CSystem) Export

func (s *CSystem) Export(ctx *cli.Context) (err error)

func (*CSystem) ExportAction

func (s *CSystem) ExportAction(ctx *cli.Context) (err error)

func (*CSystem) ExportPathVariable

func (s *CSystem) ExportPathVariable(export bool)

func (*CSystem) ExportString

func (s *CSystem) ExportString(ctx *cli.Context) (content string, err error)

func (*CSystem) GetDefaultVersion

func (s *CSystem) GetDefaultVersion() (version string)

func (*CSystem) GetExportPaths added in v0.1.7

func (s *CSystem) GetExportPaths() (list []string)

func (*CSystem) GetInstalledVersion

func (s *CSystem) GetInstalledVersion() (version string, err error)

func (*CSystem) GetKnownSums

func (s *CSystem) GetKnownSums() (sums map[string]string, err error)

func (*CSystem) IncludeCommands

func (s *CSystem) IncludeCommands(app *cli.App) (commands []*cli.Command)

func (*CSystem) Init

func (s *CSystem) Init(this interface{})

func (*CSystem) InitAction

func (s *CSystem) InitAction(ctx *cli.Context) (err error)

func (*CSystem) InitSystem

func (s *CSystem) InitSystem(ctx *cli.Context) (err error)

func (*CSystem) MakeDirs

func (s *CSystem) MakeDirs() (err error)

func (*CSystem) ParseFileName

func (s *CSystem) ParseFileName(path string) (version, osName, osArch string, err error)

func (*CSystem) ParseVersionString

func (s *CSystem) ParseVersionString(ver string) (version string, err error)

func (*CSystem) PostInitSystem

func (s *CSystem) PostInitSystem(ctx *cli.Context) (err error)

func (*CSystem) Self

func (s *CSystem) Self() (self System)

func (*CSystem) UnExport

func (s *CSystem) UnExport(ctx *cli.Context) (err error)

func (*CSystem) UnExportAction

func (s *CSystem) UnExportAction(ctx *cli.Context) (err error)

func (*CSystem) UnExportPathVariable

func (s *CSystem) UnExportPathVariable(export bool)

func (*CSystem) UnExportString

func (s *CSystem) UnExportString(ctx *cli.Context) (content string, err error)

func (*CSystem) VersionAction

func (s *CSystem) VersionAction(ctx *cli.Context) (err error)

type Command

type Command interface {
	Init(this interface{})
	Name() (name string)
	This() (self Command)
	Setup(app *cli.App) (err error)
	Prepare(ctx *cli.Context) (err error)
	ExtraCommands(app *cli.App) (commands []*cli.Command)
}

type System

type System interface {
	Command

	Self() (self System)
	GetKnownSums() (sums map[string]string, err error)
	ParseVersionString(ver string) (version string, err error)
	ParseFileName(path string) (version, osName, osArch string, err error)
	MakeDirs() (err error)
	InitAction(ctx *cli.Context) (err error)
	VersionAction(ctx *cli.Context) (err error)
	CleanAction(ctx *cli.Context) (err error)
	ExportPathVariable(export bool)
	GetExportPaths() []string
	ExportAction(ctx *cli.Context) (err error)
	UnExportPathVariable(export bool)
	UnExportAction(ctx *cli.Context) (err error)
	InitSystem(ctx *cli.Context) (err error)
	PostInitSystem(ctx *cli.Context) (err error)
	Clean(ctx *cli.Context) (err error)
	Export(ctx *cli.Context) (err error)
	ExportString(ctx *cli.Context) (content string, err error)
	UnExport(ctx *cli.Context) (err error)
	UnExportString(ctx *cli.Context) (content string, err error)
	GetInstalledVersion() (version string, err error)
	GetDefaultVersion() (version string)
	IncludeCommands(app *cli.App) (commands []*cli.Command)
}

type SystemsManager

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

func Manager

func Manager() (m *SystemsManager)

func (*SystemsManager) AddCommand

func (m *SystemsManager) AddCommand(c Command) *SystemsManager

func (*SystemsManager) AddSystem

func (m *SystemsManager) AddSystem(s System) *SystemsManager

func (*SystemsManager) Setup

func (m *SystemsManager) Setup(app *cli.App) (err error)

func (*SystemsManager) Shutdown

func (m *SystemsManager) Shutdown()

Jump to

Keyboard shortcuts

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