Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registrar

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

    Registrar stores one-to-one name<->key mappings. Names and keys must be unique. Registrar is safe for concurrent access.

    func NewRegistrar

    func NewRegistrar() *Registrar

      NewRegistrar creates a new Registrar with the empty indexes.

      func (*Registrar) ReleaseByKey

      func (r *Registrar) ReleaseByKey(key string)

        ReleaseByKey release the reserved name<->key mapping by key.

        func (*Registrar) ReleaseByName

        func (r *Registrar) ReleaseByName(name string)

          ReleaseByName releases the reserved name<->key mapping by name. Once released, the name and the key can be reserved again.

          func (*Registrar) Reserve

          func (r *Registrar) Reserve(name, key string) error

            Reserve registers a name<->key mapping, name or key must not be empty. Reserve is idempotent. Attempting to reserve a conflict key<->name mapping results in an error. A name<->key reservation is globally unique.

            Source Files