replpkg

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2016 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error string

Error is an exported error.

const (
	ErrContinue Error = "<continue input>"
	ErrQuit     Error = "<quit session>"
)

ErrContinue and ErrQuit are specific exported error types.

func (Error) Error

func (e Error) Error() string

type Session

type Session struct {
	FilePath       string
	File           *ast.File
	Fset           *token.FileSet
	Types          *types.Config
	TypeInfo       types.Info
	ExtraFilePaths []string
	ExtraFiles     []*ast.File
	// contains filtered or unexported fields
}

Session encodes info about the current REPL session.

func NewSession

func NewSession() (*Session, error)

NewSession initiates a new REPL

func (*Session) Eval

func (s *Session) Eval(in string) (string, bytes.Buffer, error)

Eval handles the evaluation of code parsed from received messages

func (*Session) Run

func (s *Session) Run() ([]byte, bytes.Buffer, error)

Run calls "go run" with appropriate files appended.

Jump to

Keyboard shortcuts

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