memory

package
v2.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package memory is an in-memory database used to store and retrieve TCP listeners

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	sync.Mutex
	// contains filtered or unexported fields
}

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 tcp.Listener) error

Add stores the passed in TCP 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

func (r *Repository) ListenerByID(id uuid.UUID) (tcp.Listener, error)

ListenerByID finds and returns a pointer to an instantiated listener object by its ID (UUIDv4)

func (*Repository) ListenerByName

func (r *Repository) ListenerByName(name string) (tcp.Listener, error)

ListenerByName finds and returns a pointer to an instantiated listener object by its name (string)

func (*Repository) Listeners

func (r *Repository) Listeners() []tcp.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

func (*Repository) SetOption

func (r *Repository) SetOption(id uuid.UUID, option, value string) error

SetOption replaces the listener's configurable options the provided value

Jump to

Keyboard shortcuts

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