util

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsString added in v0.4.0

func ContainsString(array []string, obj string) bool

func DifferenceStrings

func DifferenceStrings(strs []string, excludes []string) []string

func GenWorkers

func GenWorkers(num int) chan<- func()

func Must

func Must(e error)

Types

type LineScanner

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

func NewLineScanner

func NewLineScanner(reader io.Reader, bufferSize int, before int, after int) *LineScanner

func (*LineScanner) FindLine

func (l *LineScanner) FindLine(filter func(line string) bool) (int, string, bool)

func (*LineScanner) GetAfterSize

func (l *LineScanner) GetAfterSize() int

func (*LineScanner) GetBefore

func (l *LineScanner) GetBefore() []string

func (*LineScanner) GetBeforeSize

func (l *LineScanner) GetBeforeSize() int

func (*LineScanner) HasNext

func (l *LineScanner) HasNext() bool

func (*LineScanner) Peek

func (l *LineScanner) Peek() (b []byte, err error)

type TextPreview

type TextPreview struct {
	Offset int `json:"offset"`

	Preview string `json:"preview"`
	Hits    []int  `json:"hits"`
	// contains filtered or unexported fields
}

func FilterTextPreview

func FilterTextPreview(r io.Reader, filter func(line string) bool, before int, after int) []TextPreview

Jump to

Keyboard shortcuts

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