shield

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Badge

type Badge struct {
	// Required. Always the number 1.
	SchemaVersion int `json:"schemaVersion" yaml:"schemaVersion"`
	// Required. The left text, or the empty string to omit the left side of the badge. This can be overridden by the query string.
	Label string `json:"label" yaml:"label"`
	// Required. Can't be empty. The right text.
	Message string `json:"message" yaml:"message"`
	// Default: lightgrey. The right color. Supports the eight named colors above, as well as hex, rgb, rgba, hsl, hsla and css named colors. This can be overridden by the query string.
	Color string `json:"color" yaml:"color"`
	// Default: grey. The left color. This can be overridden by the query string.
	LabelColor string `json:"labelColor,omitempty" yaml:"labelColor,omitempty"`
	// Default: false. true to treat this as an error badge. This prevents the user from overriding the color. In the future it may affect cache behavior.
	IsError bool `json:"isError,omitempty" yaml:"isError,omitempty"`
	NamedLogo string `json:"namedLogo,omitempty" yaml:"namedLogo,omitempty"`
	// Default: none. An SVG string containing a custom logo.
	LogoSvg string `json:"logoSvg,omitempty" yaml:"logoSvg,omitempty"`
	// Default: none. Same meaning as the query string. Can be overridden by the query string.
	LogoColor string `json:"logoColor,omitempty" yaml:"logoColor,omitempty"`
	// Default: none. Same meaning as the query string. Can be overridden by the query string.
	LogoWidth string `json:"logoWidth,omitempty" yaml:"logoWidth,omitempty"`
	// Default: none. Same meaning as the query string. Can be overridden by the query string.
	LogoPosition string `json:"logoPosition,omitempty" yaml:"logoPosition,omitempty"`
	// Default: flat. The default template to use. Can be overridden by the query string.
	Syle string `json:"syle,omitempty" yaml:"syle,omitempty"`
	// Default: 300, min 300. Set the HTTP cache lifetime in seconds, which should be respected by the Shields' CDN and downstream users. Values below 300 will be ignored. This lets you tune performance and traffic vs. responsiveness. The value you specify can be overridden by the user via the query string, but only to a longer value.
	CacheSecondsDefault int `json:"cacheSecondsDefault,omitempty" yaml:"cacheSecondsDefault,omitempty"`
}

Badge https://shields.io/endpoint

func (*Badge) Setup

func (b *Badge) Setup(label string, coverage float64, color string, severity *SeverityMap)

Setup the badge

type SeverityMap

type SeverityMap map[string]int

SeverityMap map color to severity

Jump to

Keyboard shortcuts

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