checker

package
v0.0.0-...-3e5ee02 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GConfig = Config{
	Port:  "45241",
	Rules: nil,
}

Functions

func LoadConfig

func LoadConfig(configName string)

func ToMap

func ToMap(str string) map[string]string

Types

type BaseCheck

type BaseCheck struct {
	Name string
}

func (*BaseCheck) GetTestName

func (b *BaseCheck) GetTestName() string

type Config

type Config struct {
	Port  string
	Rules []IRule
}

type FileCheck

type FileCheck struct {
	BaseCheck
	FilePath string
	MaxAge   time.Duration
	MinSize  int64
}

func (*FileCheck) CheckRule

func (p *FileCheck) CheckRule() *RuleResult

type IRule

type IRule interface {
	GetTestName() string
	CheckRule() *RuleResult
}

func FileParser

func FileParser(sections []string) IRule

func ProcessParser

func ProcessParser(sections []string) IRule

type ProcessCheck

type ProcessCheck struct {
	BaseCheck
	Executable string
}

func (*ProcessCheck) CheckRule

func (p *ProcessCheck) CheckRule() *RuleResult

type RuleResult

type RuleResult struct {
	Passed bool
	Name   string
	Extra  string
}

Jump to

Keyboard shortcuts

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