Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Color ¶
type Color = uint64
const SpecialColorRemover Color = 1 << 63
@color remover works so: C + remover = transparent.
const SpecialColorTransparent Color = 0
All functions without any colors are transparent: C + transparent = C.
type ColorContainer ¶
type ColorContainer struct {
Colors []Color
}
ColorContainer is class containing colors after @color parsing above each function (order is important).
func (*ColorContainer) Add ¶
func (c *ColorContainer) Add(color Color)
func (*ColorContainer) Contains ¶
func (c *ColorContainer) Contains(needColor Color) bool
func (*ColorContainer) Empty ¶
func (c *ColorContainer) Empty() bool
type Palette ¶
Palette is a group of rulesets. All colors are stored as numbers, not as strings:
They are numbers 1 << n, as we want to use bitmasks to quickly test whether to check a rule for callstack.
func NewPalette ¶
func NewPalette() *Palette
func OpenPaletteFromFile ¶
OpenPaletteFromFile returns a ready-use palette from a file.
func ReadPaletteFileJSON ¶
func ReadPaletteFileYAML ¶
func (*Palette) AddRuleset ¶
func (*Palette) ColorExists ¶
func (*Palette) GetColorByName ¶
func (*Palette) GetNameByColor ¶
func (*Palette) RegisterColorName ¶
type Rule ¶
Rule are representation of human-written "api has-curl" => "error text" or "api allow-curl has-curl" => 1 All colors are pre-converted to numeric while reading strings.
func (*Rule) ContainsIn ¶
Click to show internal directories.
Click to hide internal directories.