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: 0

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