linkedlist

package
v2.3.5 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

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

Buffer is a linked list of node.

func (*Buffer) Buffered

func (llb *Buffer) Buffered() int

Buffered returns the number of bytes that can be read from the current buffer.

func (*Buffer) Discard

func (llb *Buffer) Discard(n int) (discarded int, err error)

Discard removes some nodes based on n bytes.

func (*Buffer) IsEmpty

func (llb *Buffer) IsEmpty() bool

IsEmpty reports whether l is empty.

func (*Buffer) Len

func (llb *Buffer) Len() int

Len returns the length of the list.

func (*Buffer) Peek

func (llb *Buffer) Peek(maxBytes int) [][]byte

Peek assembles the up to maxBytes of [][]byte based on the list of node, it won't remove these nodes from l until Discard() is called.

func (*Buffer) PeekWithBytes

func (llb *Buffer) PeekWithBytes(maxBytes int, bs ...[]byte) [][]byte

PeekWithBytes is like Peek but accepts [][]byte and puts them onto head.

func (*Buffer) PushBack

func (llb *Buffer) PushBack(p []byte)

PushBack is a wrapper of pushBack, which accepts []byte as its argument.

func (*Buffer) PushFront

func (llb *Buffer) PushFront(p []byte)

PushFront is a wrapper of pushFront, which accepts []byte as its argument.

func (*Buffer) Read

func (llb *Buffer) Read(p []byte) (n int, err error)

Read reads data from the Buffer.

func (*Buffer) ReadFrom

func (llb *Buffer) ReadFrom(r io.Reader) (n int64, err error)

ReadFrom implements io.ReaderFrom.

func (*Buffer) Reset

func (llb *Buffer) Reset()

Reset removes all elements from this list.

func (*Buffer) WriteTo

func (llb *Buffer) WriteTo(w io.Writer) (n int64, err error)

WriteTo implements io.WriterTo.

Jump to

Keyboard shortcuts

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