storage

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package storage provides a unified backend selector for all AILANG databases. It enables pluggable storage backends via the AILANG_STORAGE environment variable:

  • "local" (default): SQLite databases on local filesystem
  • "gcp": Firestore (coordinator + messaging) + BigQuery (observatory)
  • "hybrid": SQLite for coordinator/messaging, BigQuery for observatory

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backends

type Backends struct {
	Coordinator coordinator.Store
	Messaging   messaging.MessageStore
	Observatory observatory.Backend
}

Backends holds all three database backends used by AILANG services.

func NewBackends

func NewBackends(ctx context.Context) (*Backends, error)

NewBackends creates all three backends based on the AILANG_STORAGE environment variable.

func NewGCPBackends

func NewGCPBackends(ctx context.Context) (*Backends, error)

NewGCPBackends creates all three backends using GCP services (Firestore). Requires AILANG_CLOUD_PROJECT to be set.

func NewHybridBackends

func NewHybridBackends(ctx context.Context) (*Backends, error)

NewHybridBackends creates a hybrid setup: SQLite for coordinator/messaging, BigQuery for observatory (analytics scale).

func NewSQLiteBackends

func NewSQLiteBackends() (*Backends, error)

NewSQLiteBackends creates all three backends using local SQLite databases.

func (*Backends) Close

func (b *Backends) Close() error

Close closes all backends.

type Mode

type Mode string

Mode represents the storage backend mode.

const (
	ModeLocal  Mode = "local"
	ModeGCP    Mode = "gcp"
	ModeHybrid Mode = "hybrid"
)

func GetMode

func GetMode() Mode

GetMode reads the AILANG_STORAGE environment variable and returns the storage mode. Returns ModeLocal if unset or empty.

Directories

Path Synopsis
Package firestore provides Firestore-backed implementations of AILANG storage interfaces.
Package firestore provides Firestore-backed implementations of AILANG storage interfaces.
Package migrate provides tools for migrating AILANG data between storage backends.
Package migrate provides tools for migrating AILANG data between storage backends.

Jump to

Keyboard shortcuts

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