helpers

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MimeTypeByExtension added in v0.10.0

func MimeTypeByExtension(ext string) string

This is used instead of Go's built-in "mime.TypeByExtension" function because that function is broken on Windows: https://github.com/golang/go/issues/32350.

Types

type Joiner added in v0.9.4

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

This provides an efficient way to join lots of big string and byte slices together. It avoids the cost of repeatedly reallocating as the buffer grows by measuring exactly how big the buffer should be and then allocating once. This is a measurable speedup.

func (*Joiner) AddBytes added in v0.9.4

func (j *Joiner) AddBytes(data []byte)

func (*Joiner) AddString added in v0.9.4

func (j *Joiner) AddString(data string)

func (*Joiner) Done added in v0.9.4

func (j *Joiner) Done() []byte

func (*Joiner) EnsureNewlineAtEnd added in v0.9.4

func (j *Joiner) EnsureNewlineAtEnd()

func (*Joiner) LastByte added in v0.9.4

func (j *Joiner) LastByte() byte

func (*Joiner) Length added in v0.9.4

func (j *Joiner) Length() uint32

Jump to

Keyboard shortcuts

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