inertia: Index | Files

package out

import ""

Package out provides out utilities for the Inertia CLI


Package Files

decor.go doc.go format.go print.go


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"

func Fatal Uses

func Fatal(args ...interface{})

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

func Fatalf Uses

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

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

func FormatRemoteDetails Uses

func FormatRemoteDetails(remote cfg.Remote) string

FormatRemoteDetails prints the given remote configuration

func FormatStatus Uses

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

FormatStatus prints the given deployment status

func Fprintf Uses

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

Fprintf wraps formatters

func Print Uses

func Print(args ...interface{})

Print wraps formatters

func Printf Uses

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

Printf wraps formatters

func Println Uses

func Println(args ...interface{})

Println wraps formatters

func Sprintf Uses

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

Sprintf wraps formatters

func WithColor Uses

func WithColor() bool

WithColor checks if colouring should be enabled

func WithEmoji Uses

func WithEmoji() bool

WithEmoji checks if emoji should be enabled

type ColorTraits Uses

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 Uses

type Colored struct {
    // contains filtered or unexported fields

Colored converts a given string to the given colour

func C Uses

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

C creates a new colourable

func (Colored) String Uses

func (c Colored) String() string

String lets us provide a custom stringifier

func (*Colored) With Uses

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

With indicates that the C should Printf with given args

type Colorer Uses

type Colorer struct {
    // contains filtered or unexported fields

Colorer wraps fatih/color.Color

func NewColorer Uses

func NewColorer(traits ...ColorTraits) *Colorer

NewColorer instantiates a new Colorer

func (*Colorer) S Uses

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

S is a shortcut for Sprint

func (*Colorer) Sf Uses

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

Sf is a shortcut for Sprintf

Package out imports 7 packages (graph) and is imported by 13 packages. Updated 2021-01-28. Refresh now. Tools for package owners.