api

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CmdSymbolName = "Commands"
	DefaultPrompt = "gosh>"
)

Variables

View Source
var PluginsDir = plugins()

Functions

func GetPrompt

func GetPrompt(ctx context.Context) string

func GetStdout

func GetStdout(ctx context.Context) io.Writer

Types

type Command

type Command interface {
	Name() string
	Usage() string
	ShortDesc() string
	LongDesc() string
	Exec(context.Context, []string) (context.Context, error)
}

Command represents an executable a command

type Commands

type Commands interface {
	Module
	Registry() map[string]Command
}

Commands a plugin that contains one or more command

type Module

type Module interface {
	Init(context.Context) error
}

Module a plugin that can be initialized

Jump to

Keyboard shortcuts

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