linecache

package module
v0.0.0-...-11eae03 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package linecache provides a writer that stores n lines of text at once, overwriting old content as it reaches its capacity. Its contents can be read from with a String() method.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LineCache

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

LineCache provides an io.Writer that stores a fixed number of lines of text.

func NewLineCache

func NewLineCache(n int) *LineCache

NewLineCache returns a new line cache of capacity (n) lines.

func (*LineCache) String

func (l *LineCache) String() string

String returns a string representation of the cache contents.

func (*LineCache) Write

func (l *LineCache) Write(p []byte) (n int, err error)

Write writes a given byte array to the cache.

Jump to

Keyboard shortcuts

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