winsanitycheck

package
v0.0.0-...-f22496c Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const TypeName = "go2chef.winsanitycheck"

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 Loader

func Loader(config map[string]interface{}) (go2chef.Step, error)

Loader implements the go2chef.StepLoader interface required for plugins

func RegisterSanityCheck

func RegisterSanityCheck(name string, fn CheckFn)

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) Name

func (s *SanityCheck) Name() string

Name returns this step's name

func (*SanityCheck) SetName

func (s *SanityCheck) SetName(n string)

SetName sets this step's name

func (*SanityCheck) String

func (s *SanityCheck) String() string

func (*SanityCheck) Type

func (s *SanityCheck) Type() string

Type returns "sanitycheck"

Jump to

Keyboard shortcuts

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