cli

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package cli is the Olric command line interface, a simple program that allows to send commands to Olric, and read the replies sent by the server, directly from the terminal.

Index

Constants

View Source
const (
	Cyan          = 36
	Green         = 32
	Magenta       = 35
	Red           = 31
	Yellow        = 33
	BackgroundRed = 41
)

Borrowed from https://github.com/chzyer/readline/blob/master/example/readline-pass-strength/readline-pass-strength.go

Variables

View Source
var ColorResetEscape = "\033[0m"

Reset sequence

Functions

func ColorEscape added in v0.4.0

func ColorEscape(color int) string

ColorResetEscape translates a ANSI color number to a color escape.

func Colorize added in v0.4.0

func Colorize(msg string, color int) string

Colorize the msg using ANSI color escapes

Types

type CLI

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

CLI defines the command line client for Olric.

func New

func New(addr, serializer, timeout string) (*CLI, error)

New returns a new CLI instance.

func (*CLI) RunCommand

func (c *CLI) RunCommand(dmap, cmd string) error

RunCommand runs the given command on dmap.

func (*CLI) WaitForCommand

func (c *CLI) WaitForCommand(dmap string) error

WaitForCommand waits for new input from stdin.

Jump to

Keyboard shortcuts

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