decoration

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: Artistic-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(o *options)

Option for any writer in this package.

func WithAurora

func WithAurora(initialSeq int) Option

WithAurora writes with aurora.

func WithBold

func WithBold() Option

WithBold writes with bold.

func WithRainbow

func WithRainbow() Option

WithRainbow writes with rainbow.

type Writer

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

Writer is a writer to decorates.

func NewWriter

func NewWriter(w io.Writer, opts ...Option) *Writer

NewWriter creates a new writer.

func (*Writer) SetColorSeq

func (w *Writer) SetColorSeq(colorSeq int)

SetColorSeq sets current color sequence.

func (*Writer) Write

func (w *Writer) Write(b []byte) (nn int, err error)

Write writes bytes. which is implemented io.Writer.

If Bold is enabled in the options, the text will be written as Bold. If both Aurora and Rainbow are enabled in the options, Aurora will take precedence.

func (*Writer) WriteString

func (w *Writer) WriteString(s string) (n int, err error)

WriteString writes string. which is implemented io.StringWriter.

See also Write.

Jump to

Keyboard shortcuts

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