core

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Success int = iota
	Failed
	Error
)

enum for error types ...

View Source
const (
	Linux   string = "linux"
	Windows        = "windows"
)

const ...

Variables

This section is empty.

Functions

func CreateConfig

func CreateConfig(fn string) error

CreateConfig create config file ...

func FileExist

func FileExist(fn string) bool

FileExist ...

func RunCommand

func RunCommand(command string, directory string, logger *zap.SugaredLogger, result chan OperationStatus)

RunCommand runs command using the passed function parameters

Types

type CommandOut

type CommandOut struct {
	StdOutput []byte
	StdError  []byte
}

CommandOut ...

type Commands

type Commands struct {
	Commands JsonFile `json:"commands"`
}

Commands ...

func ReadConfig

func ReadConfig(fn string) (*Commands, error)

ReadConfig function reads the settings file ...

type Handler

type Handler interface {
	// contains filtered or unexported methods
}

type HandlerObjects

type HandlerObjects struct {
	Logger *zap.SugaredLogger
	Config JsonInner
}

HandlerObjects ...

func (HandlerObjects) Concurrent

func (h HandlerObjects) Concurrent()

Concurrent ...

func (HandlerObjects) Sync

func (h HandlerObjects) Sync()

Sync ...

type Instance

type Instance struct {
	Logger          *zap.SugaredLogger
	Config          *Commands
	OperatingSystem string
}

Instance ...

func InitApplication

func InitApplication() (i Instance, e error)

InitApplication starts the application by initializing the config and logger ...

func (*Instance) StartHandler

func (i *Instance) StartHandler()

StartHandler function responsible for starting appropriate ...

type JsonFile

type JsonFile struct {
	Concurrent bool        `json:"concurrent"`
	List       []JsonInner `json:"list"`
}

JsonFile ...

type JsonInner

type JsonInner struct {
	Directory  string      `json:"directory"`
	Concurrent bool        `json:"concurrent"`
	List       []ListItems `json:"list"`
}

JsonInner represents the structure of the innser json ...

type ListItems

type ListItems struct {
	CMD string `json:"cmd"`
}

ListItems ...

type OperationStatus

type OperationStatus struct {
	Status   int
	Result   execute.ExecResult
	Duration time.Duration
}

OperationStatus ...

func RunCommandSync

func RunCommandSync(command string, directory string, logger *zap.SugaredLogger) (result OperationStatus)

RunCommandSync runs command synchronously ...

Jump to

Keyboard shortcuts

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