out

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package out provides out utilities for the Inertia CLI

Index

Constants

View Source
const (
	// EnvEmojiToggle is the environment variable used to disable or enable emoji
	EnvEmojiToggle = "INERTIA_EMOJI"
	// EnvColorToggle is the environment variable used to disable or enable colors
	EnvColorToggle = "INERTIA_COLOR"
)

Variables

This section is empty.

Functions

func Fatal

func Fatal(args ...interface{})

Fatal is a wrapper around fmt.Print that exits with status 1

func Fatalf

func Fatalf(format string, args ...interface{})

Fatalf is a wrapper around out.Printf that exits with status 1

func FormatRemoteDetails

func FormatRemoteDetails(remote cfg.Remote) string

FormatRemoteDetails prints the given remote configuration

func FormatStatus

func FormatStatus(remoteName string, s *api.DeploymentStatus) string

FormatStatus prints the given deployment status

func Fprintf

func Fprintf(out io.Writer, format string, args ...interface{})

Fprintf wraps formatters

func Print

func Print(args ...interface{})

Print wraps formatters

func Printf

func Printf(format string, args ...interface{})

Printf wraps formatters

func Println

func Println(args ...interface{})

Println wraps formatters

func Sprintf

func Sprintf(format string, args ...interface{}) string

Sprintf wraps formatters

func WithColor

func WithColor() bool

WithColor checks if colouring should be enabled

func WithEmoji

func WithEmoji() bool

WithEmoji checks if emoji should be enabled

Types

type ColorTraits

type ColorTraits color.Attribute

ColorTraits denotes colour customizations

const (
	// RD = red
	RD ColorTraits = ColorTraits(color.FgRed)
	// CY = cyan
	CY ColorTraits = ColorTraits(color.FgCyan)
	// GR = green
	GR ColorTraits = ColorTraits(color.FgGreen)
	// YE = yellow
	YE ColorTraits = ColorTraits(color.FgYellow)

	// BO = bold
	BO ColorTraits = ColorTraits(color.Bold)
	// UL = underline
	UL ColorTraits = ColorTraits(color.Underline)
)

type Colored

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

Colored converts a given string to the given colour

func C

func C(msg string, traits ...ColorTraits) *Colored

C creates a new colourable

func (Colored) String

func (c Colored) String() string

String lets us provide a custom stringifier

func (*Colored) With

func (c *Colored) With(args ...interface{}) *Colored

With indicates that the C should Printf with given args

type Colorer

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

Colorer wraps fatih/color.Color

func NewColorer

func NewColorer(traits ...ColorTraits) *Colorer

NewColorer instantiates a new Colorer

func (*Colorer) S

func (c *Colorer) S(args ...interface{}) string

S is a shortcut for Sprint

func (*Colorer) Sf

func (c *Colorer) Sf(f string, args ...interface{}) string

Sf is a shortcut for Sprintf

Jump to

Keyboard shortcuts

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