Documentation ¶
Index ¶
- func GetInode(stat os.FileInfo) uint64
- func TrimCRLFString(s string) string
- type LineBuffer
- func (buf *LineBuffer) Add(a []byte)
- func (buf *LineBuffer) AvailableLines() int
- func (buf *LineBuffer) Clear()
- func (buf *LineBuffer) Empty() bool
- func (buf *LineBuffer) IsBroken() bool
- func (buf *LineBuffer) LoadState(state *LineBufferStateObj)
- func (buf *LineBuffer) Next() ([]byte, bool)
- func (buf *LineBuffer) SaveState() *LineBufferStateObj
- type LineBufferStateObj
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TrimCRLFString ¶
Types ¶
type LineBuffer ¶
type LineBuffer struct {
// contains filtered or unexported fields
}
积累bytes的缓冲器, 可以扫描出多个行
func NewLineBuffer ¶
func NewLineBuffer(maxSize int) *LineBuffer
func (*LineBuffer) AvailableLines ¶
func (buf *LineBuffer) AvailableLines() int
数一下有多少行是可用的, 就是数一下\n的个数
func (*LineBuffer) Clear ¶
func (buf *LineBuffer) Clear()
func (*LineBuffer) Empty ¶
func (buf *LineBuffer) Empty() bool
func (*LineBuffer) IsBroken ¶
func (buf *LineBuffer) IsBroken() bool
func (*LineBuffer) LoadState ¶
func (buf *LineBuffer) LoadState(state *LineBufferStateObj)
func (*LineBuffer) Next ¶
func (buf *LineBuffer) Next() ([]byte, bool)
尝试解析出一行, 如果成功则返回 line, true 否则返回 "", false
func (*LineBuffer) SaveState ¶
func (buf *LineBuffer) SaveState() *LineBufferStateObj
type LineBufferStateObj ¶
Click to show internal directories.
Click to hide internal directories.