gsh

package
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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdMap = map[string]func(argv ...string) pipe.Pipe{
	"wget":             Wget,
	"which":            Which,
	"base64":           Base64,
	"cat":              Cat,
	"head":             Head,
	"gitLastModified":  GitLastModified,
	"fileLastModified": FileLastModified,
	"strptime":         ParseTime,
}

Functions

func Base64

func Base64(argv ...string) pipe.Pipe

func Cat

func Cat(argv ...string) pipe.Pipe

func CatShowVisible

func CatShowVisible() string

func FileLastModified

func FileLastModified(argv ...string) pipe.Pipe

func ForEachLine

func ForEachLine(s *pipe.State, args []string, f func(line []byte) ([]byte, error)) error

ForEachLine

if we have args:

use args

if we dont have args

run through each line

func GitLastModified

func GitLastModified(argv ...string) pipe.Pipe

GitLastModified returns the the last-modified timestamp of a given file or files

func HTTPLastModified

func HTTPLastModified(argv ...string) pipe.Pipe
func Head(argv ...string) pipe.Pipe

func ParseTime

func ParseTime(argv ...string) pipe.Pipe

func Run

func Run(argv ...string) pipe.Pipe

Run runs a full shell style command "ls -l /foo"

func RunArgs

func RunArgs(cmd string, args ...string) pipe.Pipe

RunArgs runs a single command with explicit arguments

func Wget

func Wget(argv ...string) pipe.Pipe

func Which

func Which(argv ...string) pipe.Pipe

Which

Types

type Base64Cmd

type Base64Cmd struct {
}

func (*Base64Cmd) Flags

func (cmd *Base64Cmd) Flags() *flag.FlagSet

func (*Base64Cmd) Name

func (cmd *Base64Cmd) Name() string

func (*Base64Cmd) Run

func (cmd *Base64Cmd) Run(s *pipe.State, argv []string) error

type CatCmd

type CatCmd struct {
	ShowVisible bool
}

func (*CatCmd) Flags

func (cmd *CatCmd) Flags() *flag.FlagSet

func (*CatCmd) Name

func (cmd *CatCmd) Name() string

func (*CatCmd) Run

func (cmd *CatCmd) Run(s *pipe.State, argv []string) error

type FileLastModifiedCmd

type FileLastModifiedCmd struct {
}

func (*FileLastModifiedCmd) Flags

func (cmd *FileLastModifiedCmd) Flags() *flag.FlagSet

func (*FileLastModifiedCmd) Name

func (cmd *FileLastModifiedCmd) Name() string

func (*FileLastModifiedCmd) Run

func (cmd *FileLastModifiedCmd) Run(s *pipe.State, argv []string) error

type GitLastModifiedCmd

type GitLastModifiedCmd struct {
}

func (*GitLastModifiedCmd) Flags

func (cmd *GitLastModifiedCmd) Flags() *flag.FlagSet

func (*GitLastModifiedCmd) Name

func (cmd *GitLastModifiedCmd) Name() string

func (*GitLastModifiedCmd) Run

func (cmd *GitLastModifiedCmd) Run(s *pipe.State, args []string) error

type HTTPLastModifiedCmd

type HTTPLastModifiedCmd struct {
}

func (*HTTPLastModifiedCmd) Flags

func (cmd *HTTPLastModifiedCmd) Flags() *flag.FlagSet

func (*HTTPLastModifiedCmd) Name

func (cmd *HTTPLastModifiedCmd) Name() string

func (*HTTPLastModifiedCmd) Run

func (cmd *HTTPLastModifiedCmd) Run(s *pipe.State, argv []string) error

type HeadCmd

type HeadCmd struct {
	Chars int
	Lines int
}

func (*HeadCmd) Flags

func (cmd *HeadCmd) Flags() *flag.FlagSet

func (*HeadCmd) Name

func (cmd *HeadCmd) Name() string

func (*HeadCmd) Run

func (cmd *HeadCmd) Run(s *pipe.State, argv []string) error

type ParseTimeCmd

type ParseTimeCmd struct {
	InFormat  string
	OutFormat string
}

func (*ParseTimeCmd) Flags

func (cmd *ParseTimeCmd) Flags() *flag.FlagSet

func (*ParseTimeCmd) Name

func (cmd *ParseTimeCmd) Name() string

func (*ParseTimeCmd) Run

func (cmd *ParseTimeCmd) Run(s *pipe.State, argv []string) error

type WgetCmd

type WgetCmd struct {
	OutputFile string
	Method     string
}

func (*WgetCmd) Flags

func (cmd *WgetCmd) Flags() *flag.FlagSet

func (*WgetCmd) Name

func (cmd *WgetCmd) Name() string

func (*WgetCmd) Run

func (cmd *WgetCmd) Run(s *pipe.State, argv []string) error

type WhichCmd

type WhichCmd struct {
}

func (*WhichCmd) Flags

func (cmd *WhichCmd) Flags() *flag.FlagSet

func (*WhichCmd) Name

func (cmd *WhichCmd) Name() string

func (*WhichCmd) Run

func (cmd *WhichCmd) Run(s *pipe.State, args []string) error

Jump to

Keyboard shortcuts

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