util

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SeverityMap = map[string]SeverityInfo{
	"critical": {
		SeverityLabel:      "critical",
		SeverityColor:      "#B50101",
		SeverityColorLight: "#E5A6A6",
		SeverityValue:      6,
	},
	"high": {
		SeverityLabel:      "high",
		SeverityColor:      "#F26A35",
		SeverityColorLight: "#FBCBB9",
		SeverityValue:      5,
	},
	"medium": {
		SeverityLabel:      "medium",
		SeverityColor:      "#FCB64E",
		SeverityColorLight: "#FEE6C1",
		SeverityValue:      4,
	},
	"low": {
		SeverityLabel:      "low",
		SeverityColor:      "#FFE98C",
		SeverityColorLight: "#FFF4C5",
		SeverityValue:      3,
	},
	"normal": {
		SeverityLabel:      "normal",
		SeverityColor:      "#99D18B",
		SeverityColorLight: "#DCEFD7",
		SeverityValue:      2,
	},
	"info": {
		SeverityLabel:      "info",
		SeverityColor:      "#AED3E5",
		SeverityColorLight: "#E3F0F6",
		SeverityValue:      1,
	},
}
View Source
var StatusInfoMap = map[string]int{
	"new":         1,
	"in progress": 2,
	"pending":     3,
	"resolved":    4,
	"closed":      5,
}

Functions

func CheckInputValidInt added in v0.10.11

func CheckInputValidInt(lower_bound int, upper_bound int) func(interface{}, cty.Path) diag.Diagnostics

func CheckInputValidString added in v0.10.11

func CheckInputValidString(valid_values []string) func(interface{}, cty.Path) diag.Diagnostics

func GetStatusInfoByValue added in v0.10.11

func GetStatusInfoByValue(value int) (string, error)

func GetSupportedSeverities added in v0.10.11

func GetSupportedSeverities() *[]string

func GetSupportedStatuses added in v0.10.11

func GetSupportedStatuses() *[]string

func Sha256 added in v0.11.0

func Sha256(data []byte) string

Types

type HandleCode added in v0.10.15

type HandleCode int64
const (
	ReturnError HandleCode = 0
	Ignore      HandleCode = 1
	Retry       HandleCode = 2
)

type Limiter

type Limiter chan struct{}

func NewLimiter

func NewLimiter(n int) *Limiter

func (*Limiter) Acquire

func (l *Limiter) Acquire()

func (*Limiter) Release

func (l *Limiter) Release()

type SeverityInfo added in v0.10.11

type SeverityInfo struct {
	// Severity label assigned for the threshold level, including info, warning, critical, etc.
	SeverityLabel string
	// Severity color assigned for the threshold level
	SeverityColor string
	// Severity light color assigned for the threshold level
	SeverityColorLight string
	// Value for threshold level.
	SeverityValue int
}

func GetSeverityInfoByValue added in v0.10.11

func GetSeverityInfoByValue(severityValue int) (*SeverityInfo, error)

Jump to

Keyboard shortcuts

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