gsh

package module
v0.0.0-...-20c0a63 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2016 License: MIT Imports: 13 Imported by: 0

README

gsh

experiments in golang x shell

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alias

func Alias(s *Session, cli []string) error

func Chdir

func Chdir(s *Session, cli []string) error

func Copy

func Copy(s *Session, cli []string) error

func Echo

func Echo(s *Session, cli []string) error

func Export

func Export(s *Session, cli []string) error

func Mkdir

func Mkdir(s *Session, cli []string) error

func Move

func Move(s *Session, cli []string) error

func Unalias

func Unalias(s *Session, cli []string) error

func Wget

func Wget(s *Session, cli []string) error

func Which

func Which(s *Session, cli []string) error

Types

type FuncMap

type FuncMap map[string](func(*Session, []string) error)

type Session

type Session struct {
	Env    map[string]string
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
	// contains filtered or unexported fields
}

func New

func New() *Session

func (*Session) Close

func (s *Session) Close() error

Close returns the current process state to went it was started.

func (*Session) Error

func (s *Session) Error() error

func (*Session) Exec

func (s *Session) Exec(cmds ...string) error

func (*Session) Funcs

func (s *Session) Funcs(funcs FuncMap) *Session

func (*Session) GetEnv

func (s *Session) GetEnv(key string) string

func (*Session) Glob

func (s *Session) Glob(pattern string) []string

Glob does the os.Glob but handles errors.

useful in making for-loops

func (*Session) Output

func (s *Session) Output() ([]byte, error)

func (*Session) PutEnv

func (s *Session) PutEnv(key string, val string)

func (*Session) Run

func (s *Session) Run() error

func (*Session) Script

func (s *Session) Script(str string) *Session

func (*Session) SetError

func (s *Session) SetError(e error)

func (*Session) Test

func (s *Session) Test(str string) bool

Directories

Path Synopsis
cmd
gsh

Jump to

Keyboard shortcuts

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