ogettest

package
v0.0.0-...-752690e Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultWebContent stores "Hello World!" text content.
	DefaultWebContent = "Hello World!"
)

Variables

This section is empty.

Functions

func NewRangeServer

func NewRangeServer(content io.ReadSeeker) *httptest.Server

NewRangeServer creates a simple httptest.Server with an io.Reader for writing content.

func NewServer

func NewServer(contentReader io.Reader) *httptest.Server

NewServer creates a simple httptest.Server with an io.Reader for writing content.

func NewSimpleRangeServer

func NewSimpleRangeServer() *httptest.Server

NewSimpleRangeServer creates a simple httptest.Server serving 'Hello World!' content.

func NewSimpleServer

func NewSimpleServer() *httptest.Server

NewSimpleServer create a simple httptest.Server serving 'Hello World!' content

Types

type RangeBuffer

type RangeBuffer struct {
	Data  []byte
	Index int64
}

RangeBuffer is an alternative for bytes.Buffer but implements io.Seeker and some other interface for range testing.

func (*RangeBuffer) Grow

func (b *RangeBuffer) Grow(size int)

func (*RangeBuffer) Len

func (b *RangeBuffer) Len() int

func (*RangeBuffer) Read

func (b *RangeBuffer) Read(p []byte) (n int, err error)

func (*RangeBuffer) ReadAt

func (b *RangeBuffer) ReadAt(p []byte, off int64) (n int, err error)

func (*RangeBuffer) Seek

func (b *RangeBuffer) Seek(offset int64, whence int) (ret int64, err error)

func (*RangeBuffer) String

func (b *RangeBuffer) String() string

func (*RangeBuffer) WriteAt

func (b *RangeBuffer) WriteAt(p []byte, off int64) (n int, err error)

Jump to

Keyboard shortcuts

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