statesetting

package
v0.0.0-...-d841f61 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	TypeNumber = iota
	TypePercentage
)
View Source
const (
	MethodWorst        = "worst"
	MethodWorstOfShare = "worst_of_share"
)
View Source
const (
	TypeJUnit = "junit"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	Get(settingType string) (StateSetting, error)
}

func NewMongoAdapter

func NewMongoAdapter(client mongo.DbClient) Adapter

type JUnitThresholds

type JUnitThresholds struct {
	Skipped  StateThresholds `bson:"skipped"`
	Errors   StateThresholds `bson:"errors"`
	Failures StateThresholds `bson:"failures"`
}

func (JUnitThresholds) GetState

func (s JUnitThresholds) GetState(skipped, errors, failures, total int64) int

type StateSetting

type StateSetting struct {
	ID              string           `bson:"_id"`
	Type            string           `bson:"type"`
	Method          string           `bson:"method"`
	JUnitThresholds *JUnitThresholds `bson:"junit_thresholds,omitempty"`
}

func DefaultWorst

func DefaultWorst() StateSetting

type StateThresholds

type StateThresholds struct {
	Minor    float64 `bson:"minor"`
	Major    float64 `bson:"major"`
	Critical float64 `bson:"critical"`
	Type     int     `bson:"type"`
}

func (StateThresholds) GetState

func (s StateThresholds) GetState(value, total int64) int

Jump to

Keyboard shortcuts

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