storage

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package storage provides an in-memory implementation of the inventory.Storage interface It is the only storage implementation currently available

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryStorage

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

MemoryStorage implements the Storage interface with an in-memory map

func NewMemoryStorage

func NewMemoryStorage() *MemoryStorage

NewMemoryStorage creates a new instance of MemoryStorage

func (*MemoryStorage) GetAllReports

func (ms *MemoryStorage) GetAllReports() []inventory.Report

GetAllReports returns all stored reports

func (*MemoryStorage) GetReport

func (ms *MemoryStorage) GetReport(hostname string) (inventory.Report, bool)

GetReport retrieves a report by hostname

func (*MemoryStorage) StoreReport

func (ms *MemoryStorage) StoreReport(report inventory.Report) error

StoreReport stores a report in memory, keyed by hostname

Jump to

Keyboard shortcuts

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