Documentation ¶
Index ¶
Constants ¶
View Source
const TypeName = "go2chef.sanitycheck"
TypeName is the name of this plugin
Variables ¶
View Source
var ( UnixSuperuserUsername = "root" UnixSuperuserUID = "0" )
Unix superuser variables to allow testing
View Source
var (
ErrNotSuperuser = errors.New("not running as superuser")
)
ErrNotSuperuser is the error raised when not running as a superuser
View Source
var ErrSanityCheckNeedsFix = errors.New("sanity check needs fix")
ErrSanityCheckNeedsFix is the error raised when a sanity check needs a fix run
Functions ¶
func RegisterSanityCheck ¶
RegisterSanityCheck registers an additional sanity check
Types ¶
type CheckFn ¶
type CheckFn func(sc *SanityCheck) (FixFn, error)
CheckFn is the type for sanity checks
type FixFn ¶
type FixFn func(sc *SanityCheck) error
FixFn is the type for sanity check fixes
func EnsureSuperuser ¶
func EnsureSuperuser(sc *SanityCheck) (FixFn, error)
EnsureSuperuser checks that we're running as superuser
type SanityCheck ¶
type SanityCheck struct { SName string `mapstructure:"name"` Enabled []string `mapstructure:"enabled"` }
SanityCheck implements basic sanity checks, and provides an API for additional sanity-checks to be built as plugins.
func (*SanityCheck) Download ¶
func (s *SanityCheck) Download() error
Download is an noop for sanity checking
func (*SanityCheck) Execute ¶
func (s *SanityCheck) Execute() error
Execute performs the sanity checks
func (*SanityCheck) String ¶
func (s *SanityCheck) String() string
Click to show internal directories.
Click to hide internal directories.