Documentation

Overview

Package api implements all the function required for the user interfaces.

It implements all the necessary funcitons to send and receive data form the monitor. It exposes funtions to control the behavior of the OWTF Health Monitor.

Index

Constants

This section is empty.

Variables

var (
	//StatusFunc is a map of all the function which gives json byte array of module status
	StatusFunc map[string]func() []byte
	//ConfFunc is the map of all the function which gives json byte array of module config
	ConfFunc map[string]func() []byte
	//ConfSaveFunc is the map of all the function which save the module config to database
	ConfSaveFunc map[string]func([]byte, string) error
)

Functions

func BasicDiskCleanup

func BasicDiskCleanup(directory string)

BasicDiskCleanup takes basic cleanup action if the directory is "/" or "$HOME"

func CPUStatus

func CPUStatus() cpu.Info

CPUStatus returns status and information of the CPU module. Information contains CPU usage.

func ChangeModuleStatus

func ChangeModuleStatus(module string, status bool)

ChangeModuleStatus sends the signal to main function about the changing the status of module

func CleanTrashFolder

func CleanTrashFolder() error

CleanTrashFolder cleans the trash folder

func CompressFolder

func CompressFolder(inputFName string, outputFname string) error

CompressFolder compresses the folder with output file name as outFName

func DeletePackageManagerCache

func DeletePackageManagerCache() error

DeletePackageManagerCache cleans the package manager's cache directory

func DiskStatus

func DiskStatus() map[string]disk.PartitionInfo

DiskStatus returns status and information of the disk module. Information contains free and total inode + disk blocks.

func GetActiveProfile

func GetActiveProfile() string

GetActiveProfile returns current active profile

func GetAllProfiles

func GetAllProfiles() []string

GetAllProfiles send the array of all the profiles name from the database

func GetConfJSON

func GetConfJSON(module string) []byte

GetConfJSON will return json string of the config of module provided as a parameter

func GetStatusJSON

func GetStatusJSON(module string) []byte

GetStatusJSON will return json string of the status of module provided as a parameter

func LiveStatus

func LiveStatus() live.Status

LiveStatus returns status of the live module.

func LoadNewProfile

func LoadNewProfile(profile string) error

LoadNewProfile will laod the profile with specified name

func ModuleStatus

func ModuleStatus(module string) bool

ModuleStatus return the running status of the given module.

func PauseOWTF

func PauseOWTF() error

PauseOWTF sends request to OWTF to pauses all the workers

func RAMStatus

func RAMStatus() ram.Info

RAMStatus returns status and information of the ram module. Information contains free RAM.

func ResumeOWTF

func ResumeOWTF() error

ResumeOWTF sends request to OWTF to resume all the workers

func SaveConfig

func SaveConfig(module string, data []byte) error

SaveConfig saves the config obtained to the database and load it

func TargetStatus

func TargetStatus() map[string]target.Status

TargetStatus returns status of the target module

Types

This section is empty.