cli

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestCLIVersion

func TestCLIVersion(t *testing.T)

Types

type CLI

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

CLI represents a command-line interface. This class is not threadsafe.

func NewCLI

func NewCLI() *CLI

NewCLI returns an initialized CLI

func (*CLI) DelVar

func (cli *CLI) DelVar(key string) error

func (*CLI) Embeddable

func (cli *CLI) Embeddable() *CLI

Embeddable returns a CLI that you can embed into your own Go programs. This is not thread-safe.

func (*CLI) Execute

func (cli *CLI) Execute()

Execute parses the command line and processes it.

func (*CLI) GetAccount

func (cli *CLI) GetAccount(name, keyType string) (string, error)

GetAccount returns the account address or seed for "name". Set keyType to "address" or "seed" to specify the return value.

func (*CLI) GetAccountOrSeed

func (cli *CLI) GetAccountOrSeed(name, keyType string) (string, error)

GetAccountOrSeed returns the account address or seed for "name". It prefers keyType ("address" or "seed")

func (*CLI) GetGlobalVar

func (cli *CLI) GetGlobalVar(key string) (string, error)

GetGlobalVar reads global var "key"

func (*CLI) GetVar

func (cli *CLI) GetVar(key string) (string, error)

func (*CLI) LoadAccount added in v0.3.1

func (cli *CLI) LoadAccount(logFields logrus.Fields, name string) *microstellar.Account

LoadAccount loads information for "name" from horizon.

func (*CLI) ResolveAccount added in v0.2.8

func (cli *CLI) ResolveAccount(fields logrus.Fields, lookupKey string, keyType string) (string, error)

ResolveAccount returns an address or seed (depending on keyType), by looking up lookupKey in the local store (or in federation servers.)

func (*CLI) ResolveAsset added in v0.2.8

func (cli *CLI) ResolveAsset(name string) (*microstellar.Asset, error)

ResolveAsset looks up name and returns a microstellar Asset

func (*CLI) Run

func (cli *CLI) Run(args ...string) string

Run executes CLI with the given arguments. Used for testing. Not thread safe.

func (*CLI) RunCommand

func (cli *CLI) RunCommand(command string) string

RunCommand is a helper that lets you send a full command line to Run, so you don't have to break up your arguments.

func (*CLI) SetGlobalVar

func (cli *CLI) SetGlobalVar(key string, value string) error

SetGlobalVar writes the kv pair to the global namespace in the storage backend

func (*CLI) SetStore

func (cli *CLI) SetStore(store store.API)

SetStore lets you set the data store (used for testing.)

func (*CLI) SetVar

func (cli *CLI) SetVar(key string, value string) error

SetVar writes the kv pair to the storage backend

func (*CLI) StopWatcher

func (cli *CLI) StopWatcher()

Stop an existing watcher from streaming.

func (*CLI) TestCommand

func (cli *CLI) TestCommand(command string) string

TestCommand is a helper function that calls Run(...) in test mode. When running in test mode, os.Exit is not called on errors.

Jump to

Keyboard shortcuts

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