console

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: GPL-3.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONFIG_TPL = `` /* 159-byte string literal not displayed */

)

Variables

View Source
var (
	RedPrintf     = color.New(color.FgRed).PrintfFunc()
	MagentaPrintf = color.New(color.FgMagenta).PrintfFunc()
)

Functions

func CmdErrLogger

func CmdErrLogger(pipe io.ReadCloser)

func CreateProject

func CreateProject(prjPath string) error

func EditFile

func EditFile(filename, editor string) error

func Execute

func Execute()

func Fatal

func Fatal(msg string, a ...interface{})

func Init

func Init()

func ListProjects

func ListProjects() *proto.PrjListResponse

func NewPrompt

func NewPrompt(prjName, prjID, prjPath string)

func OpenProject

func OpenProject(prjPath string) (string, string, error)

func ProgressAbort added in v0.3.0

func ProgressAbort(bars []ProgressBarT, drop bool)

func ProgressCloseHandleMsg added in v0.3.0

func ProgressCloseHandleMsg(mpBar *mpb.Progress, bars []ProgressBarT, msg *proto.ProjectCloseMsg)

func ProgressForceComplete added in v0.3.0

func ProgressForceComplete(bars []ProgressBarT)

func ProgressRunHandleMsg added in v0.3.0

func ProgressRunHandleMsg(mpBar *mpb.Progress, bars []ProgressBarT, msg *proto.TopologyRunMsg)

func StartRemoteConsole

func StartRemoteConsole(server, node string, shell bool) error

Types

type ConnectCompleter

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

func NewConnectCompleter

func NewConnectCompleter(projects *proto.PrjListResponse) *ConnectCompleter

func (*ConnectCompleter) Complete

type NetemCommand

type NetemCommand struct {
	Desc  string
	Usage string
	Args  []string
	Run   func(p *NetemPrompt, cmdArgs []string)
}

type NetemConsoleClient

type NetemConsoleClient struct {
	Conn   *grpc.ClientConn
	Client proto.NetemClient
}

func NewClient

func NewClient(server string) (*NetemConsoleClient, error)

type NetemNode

type NetemNode struct {
	Name       string
	Interfaces []string
}

type NetemPrompt

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

func NewNetemPrompt

func NewNetemPrompt(server, prjID, prjPath string) *NetemPrompt

func (*NetemPrompt) Capture

func (p *NetemPrompt) Capture(cmdArgs []string)

func (*NetemPrompt) Check

func (p *NetemPrompt) Check(client proto.NetemClient, cmdArgs []string)

func (*NetemPrompt) Close

func (p *NetemPrompt) Close() error

func (*NetemPrompt) Config added in v0.1.4

func (p *NetemPrompt) Config(client proto.NetemClient, cmdArgs []string)

func (*NetemPrompt) CopyFrom

func (p *NetemPrompt) CopyFrom(srcNode, srcPath, destPath string)

func (*NetemPrompt) CopyTo

func (p *NetemPrompt) CopyTo(srcPath, destNode, destPath string)

func (*NetemPrompt) Edit

func (p *NetemPrompt) Edit(client proto.NetemClient, cmdArgs []string)

func (*NetemPrompt) Exec added in v0.4.0

func (p *NetemPrompt) Exec(client proto.NetemClient, cmdArgs []string)

func (*NetemPrompt) Execute

func (p *NetemPrompt) Execute(s string)

func (*NetemPrompt) IfState

func (p *NetemPrompt) IfState(client proto.NetemClient, cmdArgs []string)

func (*NetemPrompt) RegisterCommands

func (p *NetemPrompt) RegisterCommands()

func (*NetemPrompt) Reload

func (p *NetemPrompt) Reload(client proto.NetemClient, cmdArgs []string)

func (*NetemPrompt) Restart

func (p *NetemPrompt) Restart(client proto.NetemClient, cmdArgs []string)

func (*NetemPrompt) Run

func (p *NetemPrompt) Run(client proto.NetemClient, cmdArgs []string)

func (*NetemPrompt) Save

func (p *NetemPrompt) Save(client proto.NetemClient, cmdArgs []string)

func (*NetemPrompt) SaveAs

func (p *NetemPrompt) SaveAs(client proto.NetemClient, cmdArgs []string)

func (*NetemPrompt) Start

func (p *NetemPrompt) Start(client proto.NetemClient, cmdArgs []string)

func (*NetemPrompt) StartAll added in v0.3.0

func (p *NetemPrompt) StartAll(client proto.NetemClient, cmdArgs []string)

func (*NetemPrompt) Status

func (p *NetemPrompt) Status(client proto.NetemClient, cmdArgs []string)

func (*NetemPrompt) Stop

func (p *NetemPrompt) Stop(client proto.NetemClient, cmdArgs []string)

func (*NetemPrompt) StopAll added in v0.3.0

func (p *NetemPrompt) StopAll(client proto.NetemClient, cmdArgs []string)

type ProgressBarT added in v0.3.0

type ProgressBarT struct {
	Total int
	Bar   *mpb.Bar
}

type PromptCompleter

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

func NewPromptCompleter

func NewPromptCompleter(prompt *NetemPrompt) *PromptCompleter

func (*PromptCompleter) Complete

Jump to

Keyboard shortcuts

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