console

package module
v0.0.0-...-99b5fd5 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2015 License: GPL-3.0 Imports: 3 Imported by: 0

README

#go console

golang console for embedded code

init

init as singleton

c_ptr := console.GetPtr()

use

set output handler

type someHandler struct {}

func (p *someHandler) Output(text []byte) {
    fmt.Println(string(text))
}

c_ptr.Output(h)

variables

assignment of variables to be able to access them

c_ptr.AddBool("bb", &bb)
c_ptr.AddFloat("ff", &ff)
c_ptr.AddInt("ii", &ii)
c_ptr.AddString("ss", &ss)

update varibles from code

c_ptr.Exec("set ii 22")

functions

function assignment:

t := &testFunc{}
c_ptr.AddCommand("test", t.ShareMethod)

exec function with args

c_ptr.Exec("test")
c_ptr.Exec("test true")

local help

default commands:

c_ptr.Exec("ls")
ls
variables:
bb,ff,ii,ss,
console commands:
ls - prints all variables and commands
get - get value of variables
set - sets value of variable
help - this help

created for http://e154.ru

Documentation

Index

Constants

View Source
const (
	BOOL int = iota
	INT64
	FLOAT64
	STRING
)

Variables

This section is empty.

Functions

func GetPtr

func GetPtr() *console

Types

type Handler

type Handler interface {
	Output([]byte)
}

Jump to

Keyboard shortcuts

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