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 servers

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 to store & manage Server objects

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(server http.Server) error

Add stores the passed in Server object

func (*Repository) Remove

func (r *Repository) Remove(id uuid.UUID)

Remove deletes the Server object from the database

func (*Repository) Server

func (r *Repository) Server(id uuid.UUID) (http.Server, error)

Server returns a Server object for the passed in unique identifier

func (*Repository) Servers

func (r *Repository) Servers() []http.Server

Servers returns a list of all the stored Server objects

func (*Repository) SetOption

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

SetOption updates the http.Server's configurable option with the provided value

func (*Repository) Update

func (r *Repository) Update(server http.Server) error

Jump to

Keyboard shortcuts

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