system

package
v0.0.0-...-dc902cf Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action func()

Action is a callback for a function call result

type Command

type Command struct {
	ID CommandID

	WelcomeMessage string
	GoodbyeMessage string
	ErrorAction    Action
	SuccessAction  Action

	Command   string
	Arguments []string
}

Command is a command descriptor

type CommandID

type CommandID string

CommandID is just an identificator of commands

type ICommandRunner

type ICommandRunner interface {
	Run(command Command)
}

ICommandRunner is an interface of commands runner

type IOsDetector

type IOsDetector interface {
	GetOsInfo() (OsInfo, UserInfo, error)
}

IOsDetector is an interface for Os detection system

func NewOsDetector

func NewOsDetector() IOsDetector

NewOsDetector is a factory for osDetector

type IRunner

type IRunner interface {
	Run(command Command)
}

IRunner is an interface of commands runner which runs commands

func NewBashRunner

func NewBashRunner(userIO interactivity.IO) IRunner

NewBashRunner creates an instance of bashRunner

type OsClass

type OsClass string

OsClass type

const (
	NotSupported OsClass = ""
	Linux        OsClass = "Linux"
)

Supported operating systems

type OsInfo

type OsInfo struct {
	OsClass   OsClass
	OsName    string
	OsVersion string
}

OsInfo is a storage of operating system info

type UserInfo

type UserInfo struct {
	Name   string
	UserID int
}

UserInfo provides a bit of information about current user

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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