state

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DistributionID added in v0.0.4

type DistributionID string
const (
	UnknownLinux DistributionID = "linux" // default
	Ubuntu       DistributionID = "ubuntu"
	Debian       DistributionID = "debian"
	Arch         DistributionID = "arch"
	RHEL         DistributionID = "rhel"
	Fedora       DistributionID = "fedora"
	CentOS       DistributionID = "centos"
	Kali         DistributionID = "kali"
	Parrot       DistributionID = "parrot"
	Alpine       DistributionID = "alpine"
	OpenSUSE     DistributionID = "opensuse"
)

type State

type State struct {
	HasPassword   bool
	SudoEntries   Sudoers
	Hostname      string
	DistroID      DistributionID
	DistroVersion string
	KernelVersion string
}

func New

func New() *State

func (*State) Assess

func (s *State) Assess()

func (*State) IsDebianLike added in v0.0.4

func (s *State) IsDebianLike() bool

func (*State) IsPackageInstalled added in v0.0.4

func (s *State) IsPackageInstalled(name string) bool

type SudoEntry

type SudoEntry struct {
	AllUsers        bool
	UserName        string
	AllHosts        bool
	Hostname        string
	AllCommands     bool
	Command         string
	NoPasswd        bool
	BinaryName      string
	HostnameMatches bool
}

type Sudoers

type Sudoers []*SudoEntry

func (Sudoers) GetEntryForBinary

func (s Sudoers) GetEntryForBinary(binary string, hasPasswd bool) (*SudoEntry, error)

Jump to

Keyboard shortcuts

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