container

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFatalAddress = errors.New("fatal address")
View Source
var ErrIndexOutOfRange = errors.New("index out of range")
View Source
var Logger = log.NewWithHandle("container::log", log.DiscardHandler())
View Source
var TypeByte = reflect.TypeOf(byte(0))
View Source
var TypeFloat32 = reflect.TypeOf(float32(0))
View Source
var TypeFloat64 = reflect.TypeOf(float64(0))
View Source
var TypeInt = reflect.TypeOf(int(0))
View Source
var TypeInt16 = reflect.TypeOf(int16(0))
View Source
var TypeInt32 = reflect.TypeOf(int32(0))
View Source
var TypeInt64 = reflect.TypeOf(int64(0))
View Source
var TypeInt8 = reflect.TypeOf(int8(0))
View Source
var TypeRune = reflect.TypeOf(rune(0))
View Source
var TypeString = reflect.TypeOf(string(""))
View Source
var TypeTime = reflect.TypeOf(time.Time{})
View Source
var TypeUInt = reflect.TypeOf(uint(0))
View Source
var TypeUInt16 = reflect.TypeOf(uint16(0))
View Source
var TypeUInt64 = reflect.TypeOf(uint64(0))
View Source
var TypeUInt8 = reflect.TypeOf(uint8(0))

Functions

func ByteComparator

func ByteComparator(a, b interface{}) int

ByteComparator provides a basic comparison on byte

func Float32Comparator

func Float32Comparator(a, b interface{}) int

Float32Comparator provides a basic comparison on float32

func Float64Comparator

func Float64Comparator(a, b interface{}) int

Float64Comparator provides a basic comparison on float64

func Hash

func Hash(p interface{}) uintptr

func Int16Comparator

func Int16Comparator(a, b interface{}) int

Int16Comparator provides a basic comparison on int16

func Int32Comparator

func Int32Comparator(a, b interface{}) int

Int32Comparator provides a basic comparison on int32

func Int64Comparator

func Int64Comparator(a, b interface{}) int

Int64Comparator provides a basic comparison on int64

func Int8Comparator

func Int8Comparator(a, b interface{}) int

Int8Comparator provides a basic comparison on int8

func IntComparator

func IntComparator(aAsserted, bAsserted int) int

IntComparator provides a basic comparison on int

func RuneComparator

func RuneComparator(a, b interface{}) int

RuneComparator provides a basic comparison on rune

func StringComparator

func StringComparator(s1, s2 string) int

StringComparator provides a fast comparison on strings

func TimeComparator

func TimeComparator(a, b interface{}) int

TimeComparator provides a basic comparison on time.Time

func UInt16Comparator

func UInt16Comparator(a, b interface{}) int

UInt16Comparator provides a basic comparison on uint16

func UInt32Comparator

func UInt32Comparator(aAsserted, bAsserted uint32) int

UInt32Comparator provides a basic comparison on uint32

func UInt64Comparator

func UInt64Comparator(a, b interface{}) int

UInt64Comparator provides a basic comparison on uint64

func UInt8Comparator

func UInt8Comparator(a, b interface{}) int

UInt8Comparator provides a basic comparison on uint8

func UIntComparator

func UIntComparator(a, b interface{}) int

UIntComparator provides a basic comparison on uint

Types

type Comparator

type Comparator func(a, b interface{}) int

Comparator will make type assertion (see IntComparator for example), which will panic if a or b are not of the asserted type.

Should return a number:

negative , if a < b
zero     , if a == b
positive , if a > b

type Container

type Container interface {
	Empty() bool
	Size() int
	Clear()

	Serializer
}

type Hashable

type Hashable interface {
	Hashcode() uintptr
}

type Map

type Map interface {
	Container
}

type Serializer

type Serializer interface {
	MarshalJSON() ([]byte, error)
	UnmarshalJSON([]byte) error
}

type Set

type Set interface {
	Container
}

type UInt32Slice

type UInt32Slice []uint32

func (UInt32Slice) Len

func (p UInt32Slice) Len() int

func (UInt32Slice) Less

func (p UInt32Slice) Less(i, j int) bool

func (UInt32Slice) Swap

func (p UInt32Slice) Swap(i, j int)

Directories

Path Synopsis
Package redblacktree implements a red-black tree.
Package redblacktree implements a red-black tree.
Package treemap implements a map backed by red-black Tree.
Package treemap implements a map backed by red-black Tree.
Package treeset implements a Tree backed by a red-black Tree.
Package treeset implements a Tree backed by a red-black Tree.

Jump to

Keyboard shortcuts

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