utils

package
v0.0.0-...-7e7ec5c Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GitExecDiff

func GitExecDiff(path, filename string) (string, error)

GitExecDiff uses os/exec to pull a git diff.

func SendEmail

func SendEmail(c *configuration.Config, subject, message string)

SendEmail to user - Consider using a library.

func WriteFile

func WriteFile(c string, name string, s configuration.Config)

WriteFile persists the pulled device strings to disk.

Types

type Git

type Git struct {
	Repo *git.Repository

	// TODO: Consider whether it makes sense to allow path to be a value
	// that is not identical to Config.Workspace.
	Path string
}

Git tracks the repository used through the application.

func (*Git) GitCommit

func (g *Git) GitCommit() ([]string, error)

GitCommit any changes found, and returns a string of diffs.

func (*Git) GitDiff

func (g *Git) GitDiff(filename string) string

GitDiff just tests blame.

func (*Git) GitDiff2

func (g *Git) GitDiff2(filename string) string

GitDiff2 testing diff trees.

func (*Git) GitDiff3

func (g *Git) GitDiff3(filename string) string

GitDiff3 testing file inspection.

func (*Git) GitDiff4

func (g *Git) GitDiff4(filename string) string

GitDiff4 based on https://github.com/src-d/go-git/issues/468

func (*Git) GitHash

func (g *Git) GitHash(filename string) string

GitHash for the filename.

func (*Git) Open

func (g *Git) Open() error

Open the repository.

type SSHRunner

type SSHRunner struct {
	Ciphers  []string
	ReadWait time.Duration
	// contains filtered or unexported fields
}

SSHRunner holds the persistent pieces of a specific SSH device connection.

func (*SSHRunner) Close

func (s *SSHRunner) Close()

Close attempts to close the session and connection.

func (*SSHRunner) Connect

func (s *SSHRunner) Connect(user, pass, host string)

Connect to the SSH Create the initial connection.

func (*SSHRunner) ShellCmd

func (s *SSHRunner) ShellCmd(cmd []string, re *regexp.Regexp) string

ShellCmd sends a request to the SSH connection and returns the output.

func (*SSHRunner) StartShell

func (s *SSHRunner) StartShell()

StartShell must be called once before running ShellCmd.

Jump to

Keyboard shortcuts

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