utils

package
v2.9.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BrowserLauncher

func BrowserLauncher() ([]string, error)

func Check

func Check(err error)

func CommandPath

func CommandPath(cmd string) (string, error)

func ConcatPaths

func ConcatPaths(paths ...string) string

func JSONPath

func JSONPath(out io.Writer, src io.Reader, colorize bool)

func RgbToTermColorCode

func RgbToTermColorCode(color *Color) string

func TimeAgo

func TimeAgo(t time.Time) string

Types

type ArgsParser

type ArgsParser struct {
	PositionalIndices []int
	HasTerminated     bool
	// contains filtered or unexported fields
}

func NewArgsParser

func NewArgsParser() *ArgsParser

func NewArgsParserWithUsage

func NewArgsParserWithUsage(usage string) *ArgsParser

func (*ArgsParser) AllValues

func (p *ArgsParser) AllValues(name string) []string

func (*ArgsParser) Bool

func (p *ArgsParser) Bool(name string) bool

func (*ArgsParser) HasReceived

func (p *ArgsParser) HasReceived(name string) bool

func (*ArgsParser) Int

func (p *ArgsParser) Int(name string) int

func (*ArgsParser) Parse

func (p *ArgsParser) Parse(args []string) ([]string, error)

func (*ArgsParser) RegisterBool

func (p *ArgsParser) RegisterBool(name string, aliases ...string)

func (*ArgsParser) RegisterValue

func (p *ArgsParser) RegisterValue(name string, aliases ...string)

func (*ArgsParser) Value

func (p *ArgsParser) Value(name string) string

type Color

type Color struct {
	Red   uint8
	Green uint8
	Blue  uint8
}
var (
	Black, White *Color
)

func NewColor

func NewColor(hex string) (*Color, error)

func (*Color) ContrastRatio

func (c *Color) ContrastRatio(other *Color) float64

func (*Color) Distance

func (c *Color) Distance(other *Color) float64

func (*Color) Luminance

func (c *Color) Luminance() float64

Jump to

Keyboard shortcuts

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