workspace

package
v0.0.0-...-df565ed Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateHistory

func CreateHistory(name string, idx int, before, after io.Reader) error

CreateHistory is func to create hisotry

func CreateJob

func CreateJob(cfg *Job) error

CreateJob create new job

func CreateTmp

func CreateTmp(name string) error

CreateTmp creates tmp dir and returns error

func DeleteTmp

func DeleteTmp(name string) error

DeleteTmp delete tmp dir and returns error

func EditJob

func EditJob(name string) error

EditJob opens vim to edit job.json of target job and returns error

func GetJob

func GetJob(name string, out interface{}) error

GetJob returns job configuration of operation

func GetJobs

func GetJobs() (jobs []string)

GetJobs returns the slice of Job

func Init

func Init() error

Init is function initialize workspace

func PutTmp

func PutTmp(job, name string, reader io.Reader) error

PutTmp creates file in tmp dir and returns error

func RemoveJob

func RemoveJob(name string) error

RemoveJob remove job and returns error

func ShowHistory

func ShowHistory(name, idx string) error

ShowHistory is func to open job execution history

func TmpDiff

func TmpDiff(name, before, after string) error

TmpDiff execute vimdiff of files in tmp dir

func UpdateJob

func UpdateJob(job *Job) error

UpdateJob is func to update job.json

Types

type Job

type Job struct {
	Name        string    `json:"name"`
	Hosts       []string  `json:"hosts"`
	Port        string    `json:"port"`
	Abs         string    `json:"abs"`
	Username    string    `json:"username"`
	PrivateKey  string    `json:"private_key"`
	LastUpdated time.Time `json:"last_updated"`
	LatestIdx   int       `json:"latest_idx"`
}

Job is struct of operation configuration

Jump to

Keyboard shortcuts

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