memorystore

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryStore

type MemoryStore struct {
	TTL     time.Duration
	Logger  *zap.Logger
	Results map[string]*healthcheck.Result
	Tick    *time.Ticker
	// contains filtered or unexported fields
}

MemoryStore A store containing the latest healthchecks results

func NewMemoryStore

func NewMemoryStore(logger *zap.Logger) *MemoryStore

NewMemoryStore creates a new memory store

func (*MemoryStore) Add

func (m *MemoryStore) Add(result *healthcheck.Result)

Add a new Result to the store

func (*MemoryStore) Get

func (m *MemoryStore) Get(name string) (healthcheck.Result, error)

Get returns the current value for a healthcheck

func (*MemoryStore) List

func (m *MemoryStore) List() []healthcheck.Result

List returns the current value of the results

func (*MemoryStore) Purge

func (m *MemoryStore) Purge()

Purge the expired results

func (*MemoryStore) Start

func (m *MemoryStore) Start()

Start starts the memory store

func (*MemoryStore) Stop

func (m *MemoryStore) Stop() error

Stop stops the memory store

Jump to

Keyboard shortcuts

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