score

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddKeeper

func AddKeeper(keeper *Keeper) error

func TypeStrings added in v1.1.0

func TypeStrings() []string

TypeStrings returns a slice of all String values of the enum

Types

type Average added in v1.1.0

type Average struct {
	Value Value
	Count uint
}

func (*Average) Add added in v1.1.0

func (ba *Average) Add(v Value) *Average

func (*Average) AddMultiple added in v1.1.0

func (ba *Average) AddMultiple(v Value, multiple uint) *Average

func (*Average) Average added in v1.1.0

func (ba *Average) Average() Value

type Axis

type Axis interface {
	Setup(bench *data.Benchmarks, warns *data.Warnings) error
	Name() string
	HasTest(test data.TestTag) bool
	ScoreFor(handler data.HandlerTag) Value
	ScoreForTest(handler data.HandlerTag, test data.TestTag) Value
	ScoreForType(handler data.HandlerTag, which Type) Value
	Summary() template.HTML
	Exhibits() []Exhibit
	Documentation() template.HTML
}

type AxisCore added in v1.1.0

type AxisCore struct {
	// contains filtered or unexported fields
}

func (*AxisCore) AddExhibit added in v1.1.0

func (ac *AxisCore) AddExhibit(exhibit Exhibit)

func (*AxisCore) Exhibits added in v1.1.0

func (ac *AxisCore) Exhibits() []Exhibit

func (*AxisCore) SetSummary added in v1.1.0

func (ac *AxisCore) SetSummary(summary template.HTML)

func (*AxisCore) Summary added in v1.1.0

func (ac *AxisCore) Summary() template.HTML

type Exhibit

type Exhibit interface {
	HTML(data any) template.HTML
}

type ExhibitCore

type ExhibitCore struct {
	// contains filtered or unexported fields
}

func NewExhibitCore

func NewExhibitCore(tmpl *template.Template) ExhibitCore

func (*ExhibitCore) HTML

func (ec *ExhibitCore) HTML(data any) template.HTML

type Filter

type Filter interface {
	Keep(handler string) bool
}

func NewExcludeFilter

func NewExcludeFilter(items ...any) Filter

NewExcludeFilter returns a new "exclude" Filter object. Filtered items must be either string or *Group.

func NewIncludeFilter

func NewIncludeFilter(items ...any) Filter

NewIncludeFilter returns a new "include" Filter object. Filtered items must be either string or *Group.

type Group

type Group struct {
	// contains filtered or unexported fields
}

func NewFilterGroup

func NewFilterGroup(items ...any) *Group

NewFilterGroup creates a new Group object. Grouped items must be either string or *Group.

type Keeper

type Keeper struct {
	KeeperOptions
	// contains filtered or unexported fields
}

func GetKeeper

func GetKeeper(tag KeeperTag) *Keeper

func NewKeeper

func NewKeeper(tag KeeperTag, x, y Axis, doc template.HTML, options *KeeperOptions, filter Filter) *Keeper

func (*Keeper) Axes added in v1.1.0

func (k *Keeper) Axes() map[string]Axis

func (*Keeper) ChartCaption

func (k *Keeper) ChartCaption() template.HTML

func (*Keeper) ChartTitle

func (k *Keeper) ChartTitle() template.HTML

func (*Keeper) HandlerTags

func (k *Keeper) HandlerTags() []data.HandlerTag

func (*Keeper) Name

func (k *Keeper) Name() string

func (*Keeper) Overview

func (k *Keeper) Overview() template.HTML

Overview returns documentation applicable to all scorekeepers.

func (*Keeper) Setup

func (k *Keeper) Setup(bench *data.Benchmarks, warns *data.Warnings) error

func (*Keeper) Summary

func (k *Keeper) Summary() template.HTML

Summary returns documentation related to the current scorekeeper object.

func (*Keeper) Tag

func (k *Keeper) Tag() KeeperTag

func (*Keeper) TestTags added in v1.1.0

func (k *Keeper) TestTags() []data.TestTag

func (*Keeper) X

func (k *Keeper) X() Axis

func (*Keeper) Y

func (k *Keeper) Y() Axis

type KeeperOptions

type KeeperOptions struct {
	ChartCaption, Title template.HTML
}

type KeeperTag

type KeeperTag string

func Keepers

func Keepers() []KeeperTag

type Type added in v1.1.0

type Type uint8
const (
	Default Type = iota
	ByData
	Original
	ByTest
	SubScore
)

func List added in v1.1.0

func List(typeName ...string) []Type

func TypeString added in v1.1.0

func TypeString(s string) (Type, error)

TypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func TypeValues added in v1.1.0

func TypeValues() []Type

TypeValues returns all values of the enum

func (Type) ColHeader added in v1.1.0

func (t Type) ColHeader() string

func (Type) IsAType added in v1.1.0

func (i Type) IsAType() bool

IsAType returns "true" if the value is listed in the enum definition. "false" otherwise

func (Type) String added in v1.1.0

func (i Type) String() string

type Value

type Value float64

func (Value) Round

func (v Value) Round() Value

Jump to

Keyboard shortcuts

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