go-prompt/_example
Masashi SHIBATA 57a774d2c6
Add http-prompt example and add README for examples. (#51)
* Add http-prompt example

* Add README for examples

* Add live-prefix description
2018-10-20 22:46:18 +09:00
..
exec-command Update example 2017-08-15 01:48:07 +09:00
http-prompt Add http-prompt example and add README for examples. (#51) 2018-10-20 22:46:18 +09:00
live-prefix Run goimports 2018-02-13 23:42:52 +09:00
simple-echo Add http-prompt example and add README for examples. (#51) 2018-10-20 22:46:18 +09:00
README.md Add http-prompt example and add README for examples. (#51) 2018-10-20 22:46:18 +09:00

Examples of go-prompt

This directory includes some examples using go-prompt. These examples are useful to know the usage of go-prompt and check behavior for development.

simple-input

simple-input

A simple input example using prompt.Input.

simple-echo

simple-echo

A simple echo application using prompt.Run.

http-prompt

http-prompt

A simple http-prompt implementation using go-prompt in less than 200 lines of Go.

live-prefix

live-prefix

A example application which changes a prefix string dynamically. This feature is used like ktr0731/evans which is interactive gRPC client using go-prompt.

exec-command

Run another CLI tool via os/exec package. More practical example is a source code of kube-prompt. I recommend you to look this if you want to create tools like kube-prompt.