memory

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package memory provides an in-memory implementation of the Bastion composite store. This is the default fallback when no persistent backend is configured.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is an in-memory implementation of the composite Bastion store.

func New

func New() *Store

New creates a new in-memory store.

func (*Store) Allow

func (s *Store) Allow(_ context.Context, key string, limit float64, burst int, _ time.Duration) (bool, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) Delete

func (s *Store) Delete(_ context.Context, key string) error

func (*Store) DeleteRoute

func (s *Store) DeleteRoute(_ context.Context, routeID string) error

func (*Store) DeleteState

func (s *Store) DeleteState(_ context.Context, targetID string) error

func (*Store) Get

func (s *Store) Get(_ context.Context, key string) ([]byte, error)

func (*Store) GetHistory

func (s *Store) GetHistory(_ context.Context, targetID string, limit int) ([]bastion.HealthCheckResult, error)

func (*Store) GetLatestState

func (s *Store) GetLatestState(_ context.Context, targetID string) (*bastion.HealthCheckResult, error)

func (*Store) GetRoute

func (s *Store) GetRoute(_ context.Context, routeID string) (*bastion.Route, error)

func (*Store) GetState

func (s *Store) GetState(_ context.Context, targetID string) (*bastion.CircuitBreakerSnapshot, error)

func (*Store) ListRoutes

func (s *Store) ListRoutes(_ context.Context) ([]*bastion.Route, error)

func (*Store) ListStates

func (s *Store) ListStates(_ context.Context) ([]*bastion.CircuitBreakerSnapshot, error)

func (*Store) Migrate

func (s *Store) Migrate(_ context.Context) error

func (*Store) Ping

func (s *Store) Ping(_ context.Context) error

func (*Store) RecordCheck

func (s *Store) RecordCheck(_ context.Context, result *bastion.HealthCheckResult) error

func (*Store) SaveRoute

func (s *Store) SaveRoute(_ context.Context, route *bastion.Route) error

func (*Store) SaveState

func (s *Store) SaveState(_ context.Context, snap *bastion.CircuitBreakerSnapshot) error

func (*Store) Set

func (s *Store) Set(_ context.Context, key string, value []byte, ttl time.Duration) error

func (*Store) Write

func (s *Store) Write(_ context.Context, event *bastion.AuditEvent) error

Jump to

Keyboard shortcuts

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