jterm

package module
v0.0.0-...-e0b81fb Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

README

jterm

Thin wrapper over the jquery.terminal) library for use with gopherjs.

Currently the library is only partially complete. Implimentation may change.

Install

go get -u github.com/JamesHovious/jterm

Demos & tutorials to come!

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

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

func CallTerminal(j, t Terminal, post func(c, t string) func() string) Terminal

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

func NewTerminal(args string) Terminal

NewTerminal will return a new Terminal struct. It is a "superclass" of jquery.JQuery

func (Terminal) Clear

func (t Terminal) Clear()

Clear will clear the terminal.

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) Disable

func (t Terminal) Disable()

Disable disables the terminal.

func (Terminal) Echo

func (t Terminal) Echo(s ...interface{})

Echo will insert a string on a new line in the terminal.

func (Terminal) Enable

func (t Terminal) Enable()

Enable enables the terminal.

func (Terminal) Error

func (t Terminal) Error(e interface{})

Error displays the input in red.

func (Terminal) GetCommand

func (t Terminal) GetCommand() string

GetCommand will return the text for the current command.

func (Terminal) GetName

func (t Terminal) GetName() string

GetName will return the name of the current terminal. Renamed from Name() to GetName().

func (Terminal) GetPrompt

func (t Terminal) GetPrompt() string

GetPrompt willl return the current prompt.

func (Terminal) Insert

func (t Terminal) Insert(s string)

Insert will insert text intot he current cursor position.

func (Terminal) IsBottom

func (t Terminal) IsBottom() bool

IsBottom returns true if the terminal is scrolled to the bottom.

func (Terminal) Level

func (t Terminal) Level() int

Level will return how deeply nested in the interpreters you currently are.

func (Terminal) LoginName

func (t Terminal) LoginName() string

LoginName will reutrn the login name which was used in authetntication.

func (Terminal) Logout

func (t Terminal) Logout()

Logout will log you out from the current terminal.

func (Terminal) Paused

func (t Terminal) Paused() bool

Paused will return true if the terminal is paused.

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) Reset

func (t Terminal) Reset()

Reset will reset the terminal

func (Terminal) ScrollToBottom

func (t Terminal) ScrollToBottom()

ScrollToBottom will scroll to the bottom of the terminal.

func (Terminal) SetCommand

func (t Terminal) SetCommand(s string)

SetCommand will set the current command.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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