utils

package
v1.4.6 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearNewline

func ClearNewline(str string) string

func CopyDir added in v1.1.3

func CopyDir(src, dst string) error

CopyDir copies a whole directory recursively

func CopyFile added in v1.1.3

func CopyFile(src, dst string) error

CopyFile copies a single file from src to dst

func GetScriptExt

func GetScriptExt(scriptMode string) string

GetScriptExt return script extension default bash

func ParseCommandLine

func ParseCommandLine(command string) ([]string, error)

ParseCommandLine parse cmd arg

Types

type Env added in v1.4.5

type Env struct {
	Shell string `json:"SHELL"`
	Term  string `json:"TERM"`
}

type GIT

type GIT struct {
	Dir    string
	Output bytes.Buffer
	Err    bytes.Buffer
}

func (*GIT) Add added in v1.1.2

func (git *GIT) Add(options ...string) error

func (*GIT) Branch added in v1.1.1

func (git *GIT) Branch(options ...string) error

func (*GIT) Checkout

func (git *GIT) Checkout(options ...string) error

func (*GIT) Clone

func (git *GIT) Clone(options ...string) error

func (*GIT) Current added in v1.4.5

func (git *GIT) Current() error

func (*GIT) Fetch added in v1.1.1

func (git *GIT) Fetch(options ...string) error

func (*GIT) Log

func (git *GIT) Log(options ...string) error

func (*GIT) LsRemote added in v1.3.4

func (git *GIT) LsRemote(options ...string) error

func (*GIT) Pull

func (git *GIT) Pull(options ...string) error

func (*GIT) Reset added in v1.1.1

func (git *GIT) Reset(options ...string) error

func (*GIT) Run

func (git *GIT) Run(operator string, options ...string) error
type Header struct {
	Title     string `json:"title"`
	Version   int    `json:"version"`
	Height    int    `json:"height"`
	Width     int    `json:"width"`
	Env       Env    `json:"env"`
	Timestamp int    `json:"Timestamp"`
}

type Recorder added in v1.4.5

type Recorder struct {
	File      *os.File
	Timestamp int
}

func NewRecorder added in v1.4.5

func NewRecorder(recordingPath, term string, h int, w int) (recorder *Recorder, err error)

func (*Recorder) Close added in v1.4.5

func (recorder *Recorder) Close()

func (*Recorder) WriteData added in v1.4.5

func (recorder *Recorder) WriteData(data string) (err error)

func (*Recorder) WriteHeader added in v1.4.5

func (recorder *Recorder) WriteHeader(header *Header) (err error)

type SSHConfig added in v1.4.4

type SSHConfig struct {
	User         string
	Password     string
	Path         string
	Host         string
	Port         int
	JumpUser     string
	JumpPassword string
	JumpPath     string
	JumpHost     string
	JumpPort     int
}

SSHConfig -

func (SSHConfig) Dial added in v1.4.4

func (sshConfig SSHConfig) Dial() (*ssh.Client, error)

func (SSHConfig) GetOSInfo added in v1.4.4

func (sshConfig SSHConfig) GetOSInfo() string

func (SSHConfig) ToRsyncOption added in v1.4.4

func (sshConfig SSHConfig) ToRsyncOption() string

type SVN added in v1.3.4

type SVN struct {
	Dir    string
	Output bytes.Buffer
	Err    bytes.Buffer
}

func (*SVN) Clone added in v1.3.4

func (svn *SVN) Clone(options ...string) error

func (*SVN) LS added in v1.4.0

func (svn *SVN) LS(options ...string) error

func (*SVN) Log added in v1.3.4

func (svn *SVN) Log(options ...string) error

func (*SVN) Pull added in v1.3.4

func (svn *SVN) Pull(options ...string) error

func (*SVN) Run added in v1.3.4

func (svn *SVN) Run(operator string, options ...string) error

Jump to

Keyboard shortcuts

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