Documentation
¶
Index ¶
- func EnvColorDisabled() bool
- func EnvColorForced() bool
- func Is256ColorSupported() bool
- func NewContext(ctx context.Context, io *IOStreams) context.Context
- type ColorScheme
- func (c *ColorScheme) Blue(t string) string
- func (c *ColorScheme) Bold(t string) string
- func (c *ColorScheme) ColorFromString(s string) func(string) string
- func (c *ColorScheme) Cyan(t string) string
- func (c *ColorScheme) CyanBold(t string) string
- func (c *ColorScheme) FailureIcon() string
- func (c *ColorScheme) Gray(t string) string
- func (c *ColorScheme) Green(t string) string
- func (c *ColorScheme) Magenta(t string) string
- func (c *ColorScheme) Red(t string) string
- func (c *ColorScheme) SuccessIcon() string
- func (c *ColorScheme) SuccessIconWithColor(colo func(string) string) string
- func (c *ColorScheme) WarningIcon() string
- func (c *ColorScheme) Yellow(t string) string
- type IOStreams
- func (s *IOStreams) CanPrompt() bool
- func (s *IOStreams) ChangeProgressIndicatorMsg(msg string)
- func (s *IOStreams) ColorEnabled() bool
- func (s *IOStreams) ColorScheme() *ColorScheme
- func (s *IOStreams) ColorSupport256() bool
- func (s *IOStreams) DetectTerminalTheme() string
- func (s *IOStreams) IsInteractive() bool
- func (s *IOStreams) IsStderrTTY() bool
- func (s *IOStreams) IsStdinTTY() bool
- func (s *IOStreams) IsStdoutTTY() bool
- func (s *IOStreams) ReadUserFile(fn string) ([]byte, error)
- func (s *IOStreams) SetNeverPrompt(v bool)
- func (s *IOStreams) SetPager(cmd string)
- func (s *IOStreams) SetStderrTTY(isTTY bool)
- func (s *IOStreams) SetStdinTTY(isTTY bool)
- func (s *IOStreams) SetStdoutTTY(isTTY bool)
- func (s *IOStreams) StartPager() error
- func (s *IOStreams) StartProgressIndicator()
- func (s *IOStreams) StartProgressIndicatorMsg(msg string)
- func (s *IOStreams) StderrFd() uintptr
- func (s *IOStreams) StdoutFd() uintptr
- func (s *IOStreams) StopPager()
- func (s *IOStreams) StopProgressIndicator()
- func (s *IOStreams) StopProgressIndicatorMsg(msg string)
- func (s *IOStreams) TempFile(dir, pattern string) (*os.File, error)
- func (s *IOStreams) TerminalTheme() string
- func (s *IOStreams) TerminalWidth() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnvColorDisabled ¶
func EnvColorDisabled() bool
func EnvColorForced ¶
func EnvColorForced() bool
func Is256ColorSupported ¶
func Is256ColorSupported() bool
func NewContext ¶ added in v0.0.251
func NewContext(ctx context.Context, io *IOStreams) context.Context
NewContext derives a context that carries io from ctx.
Types ¶
type ColorScheme ¶
type ColorScheme struct {
// contains filtered or unexported fields
}
func NewColorScheme ¶
func NewColorScheme(enabled, is256enabled bool) *ColorScheme
func (*ColorScheme) ColorFromString ¶
func (c *ColorScheme) ColorFromString(s string) func(string) string
func (*ColorScheme) FailureIcon ¶
func (c *ColorScheme) FailureIcon() string
func (*ColorScheme) SuccessIcon ¶
func (c *ColorScheme) SuccessIcon() string
func (*ColorScheme) SuccessIconWithColor ¶
func (c *ColorScheme) SuccessIconWithColor(colo func(string) string) string
func (*ColorScheme) WarningIcon ¶
func (c *ColorScheme) WarningIcon() string
type IOStreams ¶
type IOStreams struct {
In io.ReadCloser
Out io.Writer
ErrOut io.Writer
TempFileOverride *os.File
// contains filtered or unexported fields
}
func FromContext ¶ added in v0.0.251
func FromContext(ctx context.Context) *IOStreams
FromContext returns the IOStreams ctx carries. It panics in case ctx carries no IOStreams.
func (*IOStreams) ChangeProgressIndicatorMsg ¶ added in v0.0.191
func (s *IOStreams) ChangeProgressIndicatorMsg(msg string)
func (*IOStreams) ColorEnabled ¶
func (s *IOStreams) ColorEnabled() bool
func (*IOStreams) ColorScheme ¶
func (s *IOStreams) ColorScheme() *ColorScheme
func (*IOStreams) ColorSupport256 ¶
func (s *IOStreams) ColorSupport256() bool
func (*IOStreams) DetectTerminalTheme ¶
func (s *IOStreams) DetectTerminalTheme() string
func (*IOStreams) IsInteractive ¶
func (s *IOStreams) IsInteractive() bool
func (*IOStreams) IsStderrTTY ¶
func (s *IOStreams) IsStderrTTY() bool
func (*IOStreams) IsStdinTTY ¶
func (s *IOStreams) IsStdinTTY() bool
func (*IOStreams) IsStdoutTTY ¶
func (s *IOStreams) IsStdoutTTY() bool
func (*IOStreams) ReadUserFile ¶
func (s *IOStreams) ReadUserFile(fn string) ([]byte, error)
func (*IOStreams) SetNeverPrompt ¶
func (s *IOStreams) SetNeverPrompt(v bool)
func (*IOStreams) SetStderrTTY ¶
func (s *IOStreams) SetStderrTTY(isTTY bool)
func (*IOStreams) SetStdinTTY ¶
func (s *IOStreams) SetStdinTTY(isTTY bool)
func (*IOStreams) SetStdoutTTY ¶
func (s *IOStreams) SetStdoutTTY(isTTY bool)
func (*IOStreams) StartPager ¶
func (s *IOStreams) StartPager() error
func (*IOStreams) StartProgressIndicator ¶
func (s *IOStreams) StartProgressIndicator()
func (*IOStreams) StartProgressIndicatorMsg ¶
func (s *IOStreams) StartProgressIndicatorMsg(msg string)
func (*IOStreams) StopProgressIndicator ¶
func (s *IOStreams) StopProgressIndicator()
func (*IOStreams) StopProgressIndicatorMsg ¶
func (s *IOStreams) StopProgressIndicatorMsg(msg string)
func (*IOStreams) TerminalTheme ¶
func (s *IOStreams) TerminalTheme() string
func (*IOStreams) TerminalWidth ¶
func (s *IOStreams) TerminalWidth() int
Click to show internal directories.
Click to hide internal directories.