editor

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2017 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Formattable

func Formattable(descriptor interface {
	Fd() uintptr
}) bool

Formattable judge whether a descriptor (like a os.Stdout, os.Stderr or *os.File...) is capable of colorization or not. The default behavior is to detect whether it is connected to a TTY, but may be overridden by setting the environment variable `RICHGO_FORCE_COLOR` to a non-empty value.

func Replaces

func Replaces(str string, rs ...RegexRepl) string

Replaces string with

func Stream

func Stream(base io.Writer, editor ...Editor) io.WriteCloser

Stream build io.WriteCloser that process lines with editor and write to base io.Writer

Types

type Editor

type Editor interface {
	Edit(line string) (string, error)
}

Editor is the line-processor interface

func Parrot

func Parrot() Editor

Parrot will not change input

type RegexRepl

type RegexRepl struct {
	Exp  *regexp.Regexp
	Repl string
	Func func(string) string
}

RegexRepl : replacer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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