Documentation ¶
Overview ¶
Package memory is an in-memory database used to store and retrieve UDP listeners
Index ¶
- type Repository
- func (r *Repository) Add(listener udp.Listener) error
- func (r *Repository) Exists(name string) bool
- func (r *Repository) List() func(string) []string
- func (r *Repository) ListenerByID(id uuid.UUID) (udp.Listener, error)
- func (r *Repository) ListenerByName(name string) (udp.Listener, error)
- func (r *Repository) Listeners() []udp.Listener
- func (r *Repository) RemoveByID(id uuid.UUID) error
- func (r *Repository) SetOption(id uuid.UUID, option, value string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
Repository is a structure that implements the Repository interface
func NewRepository ¶
func NewRepository() *Repository
NewRepository is a factory to create and return a repository object to store and manage listeners
func (*Repository) Add ¶
func (r *Repository) Add(listener udp.Listener) error
Add stores the passed in UDP listener
func (*Repository) Exists ¶
func (r *Repository) Exists(name string) bool
Exists determines if the Listener has already been instantiated
func (*Repository) List ¶
func (r *Repository) List() func(string) []string
List returns a list of Listeners that exist and is used for command line tab completion
func (*Repository) ListenerByID ¶
ListenerByID finds and returns a pointer to an instantiated listener object by its ID (UUIDv4)
func (*Repository) ListenerByName ¶
func (r *Repository) ListenerByName(name string) (udp.Listener, error)
ListenerByName finds and returns a pointer to an instantiated listener object by its name (string)
func (*Repository) Listeners ¶
func (r *Repository) Listeners() []udp.Listener
Listeners returns a list of Listener objects to be consumed by a client application
func (*Repository) RemoveByID ¶
func (r *Repository) RemoveByID(id uuid.UUID) error
RemoveByID deletes a Listener from the global list of Listeners by the input UUID