sqlite

package
v1.4.3 Latest Latest
Warning

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

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

Documentation

Overview

Package sqlite provides a SQLite implementation of the Bastion composite store using grove ORM with programmatic migrations.

Index

Constants

This section is empty.

Variables

View Source
var Migrations = migrate.NewGroup("bastion")

Migrations is the grove migration group for the Bastion SQLite store.

Functions

This section is empty.

Types

type Store

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

Store is a SQLite implementation of the composite Bastion store.

func New

func New(db *grove.DB) *Store

New creates a new SQLite store.

func (*Store) Allow

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

func (*Store) Close

func (s *Store) Close() error

Close closes the database connection.

func (*Store) Delete

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

func (*Store) DeleteRoute

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

func (*Store) DeleteState

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

func (*Store) Get

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

func (*Store) GetHistory

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

func (*Store) GetLatestState

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

func (*Store) GetRoute

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

func (*Store) GetState

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

func (*Store) ListRoutes

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

func (*Store) ListStates

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

func (*Store) Migrate

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

Migrate runs programmatic migrations via the grove orchestrator.

func (*Store) Ping

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

Ping verifies the database connection.

func (*Store) RecordCheck

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

func (*Store) SaveRoute

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

func (*Store) SaveState

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

func (*Store) Set

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

func (*Store) Write

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

Jump to

Keyboard shortcuts

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