key

package
v0.0.0-...-f3d8a94 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2018 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hasher

type Hasher interface {
	Hashcode() uint64
	Equals(m Hasher) bool
}

Hasher represents a value that can be used as a map key.

type Key

type Key interface{}

Key represents a comparable value.

type Mapping

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

Mapping holds a set of unique keys corresponding to Hasher values.

func NewMapping

func NewMapping() *Mapping

NewMapping creates a new Mapping object

func (*Mapping) Key

func (m *Mapping) Key(mkey Hasher) Key

Key returns a comparable Key value corresponding to mkey. If the same mkey is passed twice to the same Mapping, the same Key will be returned.

func (*Mapping) Original

func (m *Mapping) Original(k Key) Hasher

Original returns the original key value for a given Key, if it was created with the Key function; otherwise it returns nil.

Jump to

Keyboard shortcuts

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