helpers

package
v0.12.15 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashCombine added in v0.11.19

func HashCombine(seed uint32, hash uint32) uint32

From: http://boost.sourceforge.net/doc/html/boost/hash_combine.html

func HashCombineString added in v0.11.19

func HashCombineString(seed uint32, text string) uint32

func IsInsideNodeModules added in v0.11.20

func IsInsideNodeModules(path string) bool

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 BitSet added in v0.11.5

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

func NewBitSet added in v0.11.5

func NewBitSet(bitCount uint) BitSet

func (BitSet) Equals added in v0.11.5

func (bs BitSet) Equals(other BitSet) bool

func (BitSet) HasBit added in v0.11.5

func (bs BitSet) HasBit(bit uint) bool

func (BitSet) SetBit added in v0.11.5

func (bs BitSet) SetBit(bit uint)

func (BitSet) String added in v0.11.5

func (bs BitSet) String() string

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) Contains added in v0.11.23

func (j *Joiner) Contains(s string, b []byte) bool

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

type Timer added in v0.11.13

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

func (*Timer) Begin added in v0.11.13

func (t *Timer) Begin(name string)

func (*Timer) End added in v0.11.13

func (t *Timer) End(name string)

func (*Timer) Fork added in v0.11.13

func (t *Timer) Fork() *Timer

func (*Timer) Join added in v0.11.13

func (t *Timer) Join(other *Timer)

func (*Timer) Log added in v0.11.13

func (t *Timer) Log(log logger.Log)

Jump to

Keyboard shortcuts

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