utils

package
v0.0.0-...-3d6c4c0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FileLogs *logs.BeeLogger

var ConsoleLogs *logs.BeeLogger

View Source
var Tail = &Command{
	UsageLine: `tail -f main.go -l 10 -n 5 -o tmp.txt`,
	Run:       tail,
	Short:     "从文件结尾或指定位置读取内容",
	Long: `从文件结尾或指定位置读取内容,可以按行读取,也可以按大小读取,-i 和 -l同时使用的话-i生效,-s 与 -n 
同时使用的话-s生效`,
}

Functions

func TestLog

func TestLog(t *testing.T)

Types

type Command

type Command struct {
	UsageLine string
	Run       func(*Command, []string) bool
	Short     string
	Long      string
}

type TailFile

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

func NewTail

func NewTail(File *os.File) *TailFile

func (*TailFile) Close

func (f *TailFile) Close() error

func (*TailFile) Read

func (f *TailFile) Read(offset, size, lines int64, w io.Writer) error

func (*TailFile) ReadLine

func (f *TailFile) ReadLine() ([]byte, error)

暂时用不到

func (*TailFile) TailLine

func (f *TailFile) TailLine(line, lines int, w io.Writer) (err error)

Jump to

Keyboard shortcuts

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