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

Add stores the passed in HTTP listener

func (*Repository) Exists

func (r *Repository) Exists(name string) bool

Exists determines if the HTTP 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) (http.Listener, error)

ListenerByID finds and returns the listener object by its ID (UUIDv4)

func (*Repository) ListenerByName

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

ListenerByName finds and returns the listener object by its name (string)

func (*Repository) Listeners

func (r *Repository) Listeners() []http.Listener

Listeners returns a list of all stored 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 updates the listener's configurable options value passed in

Jump to

Keyboard shortcuts

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