Documentation ¶
Overview ¶
Package registrar provides name registration. It reserves a name to a given key.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNameReserved is an error which is returned when a name is requested to be reserved that already is reserved ErrNameReserved = errors.New("name is reserved") // ErrNameNotReserved is an error which is returned when trying to find a name that is not reserved ErrNameNotReserved = errors.New("name is not reserved") // ErrNoSuchKey is returned when trying to find the names for a key which is not known ErrNoSuchKey = errors.New("provided key does not exist") )
Functions ¶
This section is empty.
Types ¶
type Registrar ¶
type Registrar struct {
// contains filtered or unexported fields
}
Registrar stores indexes a list of keys and their registered names as well as indexes names and the key that they are registered to Names must be unique. Registrar is safe for concurrent access.
func NewRegistrar ¶
func NewRegistrar() *Registrar
NewRegistrar creates a new Registrar with the an empty index
func (*Registrar) Delete ¶
Delete removes all reservations for the passed in key. All names reserved to this key are released.
Click to show internal directories.
Click to hide internal directories.