Versions in this module Expand all Collapse all v0 v0.2.0 Mar 13, 2019 v0.1.0 Jul 23, 2018 Changes in this version + const ConfigVersionKey + var Addr = BasicCmdWrapper + var Bang = BasicCmdWrapper + var Connect = BasicCmdWrapper + var DefReflectors = []Reflector + var DefaultConfig = Config + var Disconnect = BasicCmdWrapper + var Echo = BasicCmdWrapper + var ErrCmdNotFound = errors.New("the command was not found") + var ErrDisconnected = errors.New("the client is not connected to API") + var ErrFieldNotFound = errors.New("the field was not found") + var ErrInvalidConfig = errors.New("the configuration is invalid") + var ErrInvalidExitCode = errors.New("the exit code is invalid") + var ErrPromptNotFound = errors.New("the requested prompt was not found") + var ErrReflectParse = errors.New("could not parse the value") + var ErrUnsupportedReflectType = errors.New("the type is not currently supported by reflection") + var Exit = BasicCmdWrapper + var Help = BasicCmdWrapper + var Silent = BasicCmdWrapper + var StaticCmds = []Cmd + var Version = BasicCmdWrapper + func LoadConfig(set cfg.Set, filename string) error + func NewConfigurableSet() cfg.Set + func NewUseError(msg string) error + func ReflectFieldDesc(d *desc.FieldDescriptor) string + func ReflectFieldRequired(d *desc.FieldDescriptor) bool + func ReflectMethodDesc(d *desc.MethodDescriptor) string + func Resolver(c *script.Closure, sym script.SExp) (script.SExp, error) + func StackTrace(err error) errors.StackTrace + type ArgReflector interface + Parse func(*desc.FieldDescriptor, string) (interface{}, error) + type BasicCmd struct + Exec func(*BasicContext) error + Flags func() *pflag.FlagSet + Name string + NoFlags bool + Short string + Use string + type BasicCmdWrapper struct + Cmd BasicCmd + func (cmd BasicCmdWrapper) Exec(ctx *script.InterpreterContext, cli CLI) (script.SExp, error) + func (cmd BasicCmdWrapper) Long() string + func (cmd BasicCmdWrapper) LongUse() string + func (cmd BasicCmdWrapper) Match(name string) bool + func (cmd BasicCmdWrapper) Name() string + func (cmd BasicCmdWrapper) Short() string + func (cmd BasicCmdWrapper) Suggest(c Content) []Suggest + func (cmd BasicCmdWrapper) Use() string + type BasicContext struct + Args []string + CLI CLI + Ctx context.Context + Flags *pflag.FlagSet + Writer io.Writer + type BasicReflector struct + Checker ReflectChecker + Decoder ReflectDecoder + Encoder ReflectEncoder + Zero interface{} + func (r BasicReflector) Flag(d *desc.FieldDescriptor, f *pflag.FlagSet) + func (r BasicReflector) Parse(d *desc.FieldDescriptor, s string) (interface{}, error) + func (r BasicReflector) ParseFlag(d *desc.FieldDescriptor, f *pflag.FlagSet) (interface{}, error) + func (r BasicReflector) Pretty(d *desc.FieldDescriptor, v interface{}) (string, error) + func (r BasicReflector) Supports(d *desc.FieldDescriptor) bool + type CLI interface + Address func() string + Commands func() []Cmd + Config func() Config + Connect func(ctx context.Context, addr string) error + Console func() *Console + DidJustExecute func() bool + Disconnect func() error + Exec func(ctx context.Context, in string) error + Run func(ctx context.Context, in string) + Start func(context.Context) + Suggest func(cnt Content) []Suggest + func New(configSet cfg.ConfigSet) (CLI, error) + type Cmd interface + Exec func(*script.InterpreterContext, CLI) (script.SExp, error) + Long func() string + LongUse func() string + Match func(string) bool + Name func() string + Short func() string + Suggest func(Content) []Suggest + Use func() string + type Config struct + APIAddress string + ConfigVersion int + DialTimeout string + EnableColorOutput bool + EnableDebugOutput bool + InitScripts []string + PromptBackend string + RequestTimeout string + TLSCertificateFile string + TLSServerNameOverride string + type ConfigHandler struct + func (h *ConfigHandler) Config() interface{} + func (h *ConfigHandler) ID() string + func (h *ConfigHandler) SetConfig(config interface{}) error + type Console struct + func NewConsole(out io.Writer, color bool) *Console + func (c *Console) Blue() + func (c *Console) Debug(v ...interface{}) + func (c *Console) Debugf(format string, v ...interface{}) + func (c *Console) Debugln(v ...interface{}) + func (c *Console) Error(v ...interface{}) + func (c *Console) Errorf(format string, v ...interface{}) + func (c *Console) Errorln(v ...interface{}) + func (c *Console) Gray() + func (c *Console) Green() + func (c *Console) Info(v ...interface{}) + func (c *Console) Infof(format string, v ...interface{}) + func (c *Console) Infoln(v ...interface{}) + func (c *Console) Print(v ...interface{}) + func (c *Console) Printf(format string, v ...interface{}) + func (c *Console) Println(v ...interface{}) + func (c *Console) Red() + func (c *Console) Reset() + func (c *Console) SetDebug(debug bool) + func (c *Console) Success(v ...interface{}) + func (c *Console) Successf(format string, v ...interface{}) + func (c *Console) Successln(v ...interface{}) + func (c *Console) Warning(v ...interface{}) + func (c *Console) Warningf(format string, v ...interface{}) + func (c *Console) Warningln(v ...interface{}) + func (c *Console) Yellow() + type ConsoleRPCEventListener struct + func (el *ConsoleRPCEventListener) Connected() bool + func (el *ConsoleRPCEventListener) Start(ctx context.Context) error + type Content interface + GetWordBeforeCursor func() string + TextBeforeCursor func() string + type EventListener interface + Connected func() bool + Start func(context.Context) error + func NewConsoleClientEventListener(cons *Console, client pbevent.EmitterClient, sig Signaler) EventListener + func NewConsoleRPCEventListener(cons *Console, conn *grpc.ClientConn) EventListener + type FlagReflector interface + Flag func(*desc.FieldDescriptor, *pflag.FlagSet) + ParseFlag func(*desc.FieldDescriptor, *pflag.FlagSet) (interface{}, error) + type ReflectChecker func(*desc.FieldDescriptor) bool + type ReflectDecoder func(*desc.FieldDescriptor, string) (interface{}, error) + type ReflectEncoder func(*desc.FieldDescriptor, interface{}) (string, error) + type Reflector interface + Supports func(*desc.FieldDescriptor) bool + func NewBase58Reflector() Reflector + func NewBlockchainBlocksReflector() Reflector + func NewBlockchainTransactionsReflector() Reflector + func NewBoolReflector() Reflector + func NewByterateReflector() Reflector + func NewBytesReflector() Reflector + func NewBytesizeReflector() Reflector + func NewDurationReflector() Reflector + func NewEnumReflector() Reflector + func NewInt32Reflector() Reflector + func NewInt64Reflector() Reflector + func NewMaddrReflector() Reflector + func NewStringReflector() Reflector + func NewTimeReflector() Reflector + func NewUint32Reflector() Reflector + func NewUint64Reflector() Reflector + type ResponseReflector interface + Pretty func(*desc.FieldDescriptor, interface{}) (string, error) + type Rline struct + func NewRline(cli CLI) *Rline + func (p *Rline) Do(line []rune, pos int) (newLine [][]rune, length int) + func (p *Rline) GetWordBeforeCursor() string + func (p *Rline) Run(ctx context.Context, rc io.ReadCloser) + func (p *Rline) TextBeforeCursor() string + type ServerReflector struct + func NewServerReflector(cons *Console, termWidth int, reflectors ...Reflector) ServerReflector + func (r ServerReflector) Reflect(ctx context.Context, conn *grpc.ClientConn) ([]Cmd, error) + type ServerStream interface + RecvMsg func() (proto.Message, error) + type Signaler interface + Signal func(os.Signal) error + type Suggest struct + Desc string + Text string + type UseError struct + func (err *UseError) Error() string + func (err *UseError) Use() string