Documentation ¶
Overview ¶
Package jterm is a binding of gopherjs to jquery.terminal. This lets you use jquery.terminal without writing any JavaScript. There is the examples directory to show some simple use cases. In some cases jqeury.terminal has properties and methods that have the same name. Go doesn't allow this to happen. In these cases the method name may have been changed slightly in this package.
Index ¶
- type Terminal
- func (t Terminal) Clear()
- func (t Terminal) ClearHistoryState()
- func (t Terminal) Destroy()
- func (t Terminal) Disable()
- func (t Terminal) Echo(s ...interface{})
- func (t Terminal) Enable()
- func (t Terminal) Error(e interface{})
- func (t Terminal) GetCommand() string
- func (t Terminal) GetName() string
- func (t Terminal) GetPrompt() string
- func (t Terminal) Insert(s string)
- func (t Terminal) IsBottom() bool
- func (t Terminal) Level() int
- func (t Terminal) LoginName() string
- func (t Terminal) Logout()
- func (t Terminal) Paused() bool
- func (t Terminal) Pop()
- func (t Terminal) Purge()
- func (t Terminal) Reset()
- func (t Terminal) ScrollToBottom()
- func (t Terminal) SetCommand(s string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Terminal ¶
type Terminal struct { Greetings string `js:"greetings"` History bool `js:"history"` Exit bool `js:"exit"` Prompt interface{} `js:"prompt"` Name string `js:"name"` ScrollBottomOffset int `js:"scollBottomOffse"` ScrollOnEcho bool `js:"scrollOnEcho"` EchoCommand bool `js:"echoCommand"` // contains filtered or unexported fields }
Terminal is a struct with fields that correspond to jquery.terminal options.
func CallTerminal ¶
CallTerminal will call the jQuery.terminal method, which is the entry point for the library.
func DefaultTerminal ¶
func DefaultTerminal() Terminal
DefaultTerminal returns a Terminal struct with all of the default values pre-populated.
func NewTerminal ¶
NewTerminal will return a new Terminal struct. It is a "superclass" of jquery.JQuery
func (Terminal) ClearHistoryState ¶
func (t Terminal) ClearHistoryState()
ClearHistoryState will clear the history from the localstorage.
func (Terminal) Destroy ¶
func (t Terminal) Destroy()
Destroy removes everything created by the terminal. It will not destroy the content in the local storage. If you want to destroy the localstorage as well use Purge()
func (Terminal) Echo ¶
func (t Terminal) Echo(s ...interface{})
Echo will insert a string on a new line in the terminal.
func (Terminal) GetCommand ¶
GetCommand will return the text for the current command.
func (Terminal) GetName ¶
GetName will return the name of the current terminal. Renamed from Name() to GetName().
func (Terminal) Logout ¶
func (t Terminal) Logout()
Logout will log you out from the current terminal.
func (Terminal) Pop ¶
func (t Terminal) Pop()
Pop will remove the current interpreter from the stack and run ht eprevious one.
func (Terminal) Purge ¶
func (t Terminal) Purge()
Purge will remove all local storage left by the terminal.
func (Terminal) ScrollToBottom ¶
func (t Terminal) ScrollToBottom()
ScrollToBottom will scroll to the bottom of the terminal.
func (Terminal) SetCommand ¶
SetCommand will set the current command.