checkup

package
v0.0.0-...-b15899e Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const MSG_ALL_GOOD_CONCLUSION string = "Hooray, all good. Keep this up!"
View Source
const MSG_ETC_ITEM string = "    - etc."
View Source
const MSG_NO_RECOMMENDATION string = "No recommendations."
View Source
const RECOMMENDATION_ITEMS_LIMIT int = 5

Variables

This section is empty.

Functions

func CheckUnmarshalResult

func CheckUnmarshalResult(err error) bool

func GetItemsSortedByNum

func GetItemsSortedByNum(data interface{}) []string

Get map keys sorted by field num inside struct

func GetMasterHostName

func GetMasterHostName(hosts ReportHosts) string

func GetUniques

func GetUniques(array []string) []string

func InList

func InList(items []string, item string) bool

func InListPartial

func InListPartial(items []string, item string) bool

func LimitList

func LimitList(array []string) []string

func LoadRawJsonReport

func LoadRawJsonReport(filePath string) []byte

func PrintResultConclusions

func PrintResultConclusions(result ReportResult)

func PrintResultRecommendations

func PrintResultRecommendations(result ReportResult)

func ResultInList

func ResultInList(items []ReportResultItem, id string) bool

func SaveJsonReportResults

func SaveJsonReportResults(data map[string]interface{}, reportResult ReportResult)

func SaveReportResult

func SaveReportResult(data map[string]interface{},
	result ReportResult) map[string]interface{}

func SortItemsByFloat64

func SortItemsByFloat64(data interface{}, field string, reverse bool) []string

Get map keys sorted by defined float64 field inside struct

func SortItemsByInt

func SortItemsByInt(data interface{}, field string, reverse bool) []string

Get map keys sorted by defined int field inside struct

func StringInArray

func StringInArray(val string, array []string) (exists bool, index int)

Check if the string exists in the array. If it is so, return its index

Types

type ReportHost

type ReportHost struct {
	InternalAlias        string `json:"internal_alias"`
	Index                string `json:"index"`
	Role                 string `json:"role"`
	RoleChangeDetectedAt string `json:"role_change_detected_at"`
}

type ReportHosts

type ReportHosts map[string]ReportHost

type ReportLastCheck

type ReportLastCheck struct {
	Epoch       string `json:"epoch"`
	Timestamptz string `json:"timestamptz"`
	Dir         string `json:"dir"`
}

type ReportLastNodes

type ReportLastNodes struct {
	Hosts     ReportHosts     `json:"hosts"`
	LastCheck ReportLastCheck `json:"last_check"`
}

type ReportResult

type ReportResult struct {
	P1              bool
	P2              bool
	P3              bool
	Conclusions     []ReportResultItem
	Recommendations []ReportResultItem
}

func (*ReportResult) AppendConclusion

func (r *ReportResult) AppendConclusion(id string, conclusion string, a ...interface{})

func (*ReportResult) AppendRecommendation

func (r *ReportResult) AppendRecommendation(id string, reccomendation string,
	a ...interface{})

type ReportResultItem

type ReportResultItem struct {
	Id      string
	Message string
}

func GetResultItem

func GetResultItem(items []ReportResultItem, id string) (*ReportResultItem, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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