gctrl

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

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

Go to latest
Published: Sep 14, 2019 License: MIT Imports: 18 Imported by: 2

README

gctrl

Read and parse the input, then call the corresponding function, finally print the result.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Call

func Call(text string) ([]interface{}, error)

func MustRegister

func MustRegister(fn interface{}, name, desc string)

func Register

func Register(fn interface{}, name, desc string) error

func Serve

func Serve(rw io.ReadWriter, config ServeConfig) error

func ServeUnix

func ServeUnix(path string, config ServeUnixConfig) error

func Stdio

func Stdio() io.ReadWriter

Types

type AfterCall

type AfterCall func(results []reflect.Value, err error)

type BeforeCall

type BeforeCall func(literal string)

type Controller

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

func New

func New() *Controller

func (*Controller) Call

func (this *Controller) Call(literal string) ([]interface{}, error)

func (*Controller) MustRegister

func (this *Controller) MustRegister(fn interface{}, name, desc string)

func (*Controller) Register

func (this *Controller) Register(fn interface{}, name, desc string) error

func (*Controller) Serve

func (this *Controller) Serve(rw io.ReadWriter, config ServeConfig) error

func (*Controller) ServeUnix

func (this *Controller) ServeUnix(path string, config ServeUnixConfig) error

type OnConn

type OnConn func(connID int64)

type OnDisconn

type OnDisconn func(connID int64, err error)

type ServeConfig

type ServeConfig struct {
	NoPrompt   bool
	NoColoring bool
	BeforeCall BeforeCall
	AfterCall  AfterCall
}

type ServeUnixConfig

type ServeUnixConfig struct {
	NoPrompt   bool
	NoColoring bool
	OnConn     OnConn
	OnDisconn  OnDisconn
	BeforeCall UnixBeforeCall
	AfterCall  UnixAfterCall
}

type UnixAfterCall

type UnixAfterCall func(connID int64, results []reflect.Value, err error)

type UnixBeforeCall

type UnixBeforeCall func(connID int64, literal string)

Directories

Path Synopsis
_examples

Jump to

Keyboard shortcuts

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