registry

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2022 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package registry contains a registry of callbacks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

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

M is the map type.

func New

func New(cap int) Registry

New creates a new M instance.

func (*Registry) Add

func (r *Registry) Add(v, meta interface{}) *Value

Add adds the given interface and returns a new and unique box that identifies it.

func (*Registry) Each

func (r *Registry) Each(f func(interface{}, interface{}))

Each iterates over the map.

func (*Registry) EachValue

func (r *Registry) EachValue(f func(*Value, interface{}))

EachValue iterates over the map and gives the raw Value.

func (*Registry) IsEmpty

func (r *Registry) IsEmpty() bool

IsEmpty returns true if the Registry is empty.

type Value

type Value struct {
	V interface{}
	// contains filtered or unexported fields
}

Value is the boxed type.

func (*Value) Delete

func (v *Value) Delete()

Delete deletes the box itself from the containing map. The value is invalidated after the call finishes.

Jump to

Keyboard shortcuts

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