label

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: MIT Imports: 6 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrTemplateLoad

func IsErrTemplateLoad(err error) bool

IsErrTemplateLoad checks if an error is a ErrTemplateLoad.

func LoadFormatted

func LoadFormatted(name string) (string, error)

LoadFormatted loads the labels' list of a template file as a string separated by comma

func NormalizeColor

func NormalizeColor(color string) (string, error)

NormalizeColor normalizes a color string to a 6-character hex code

Types

type ErrTemplateLoad

type ErrTemplateLoad struct {
	TemplateFile  string
	OriginalError error
}

ErrTemplateLoad represents a "ErrTemplateLoad" kind of error.

func (ErrTemplateLoad) Error

func (err ErrTemplateLoad) Error() string

type Label

type Label struct {
	Name        string `yaml:"name"`
	Color       string `yaml:"color"`
	Description string `yaml:"description,omitempty"`
	Exclusive   bool   `yaml:"exclusive,omitempty"`
}

Label represents label information loaded from template

func GetTemplateFile

func GetTemplateFile(name string) ([]*Label, error)

GetTemplateFile loads the label template file by given name, then parses and returns a list of name-color pairs and optionally description.

Jump to

Keyboard shortcuts

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