substrate

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StoreSubstrate = "store"
	BusSubstrate   = "message bus"
	KVSubstrate    = "key-value cache"
)
View Source
const (
	PostgresURLEnv = "CONTENOX_POSTGRES_URL"
	NATSURLEnv     = "CONTENOX_NATS_URL"
	ValkeyURLEnv   = "CONTENOX_VALKEY_URL"
)

Variables

This section is empty.

Functions

func AnyRemote

func AnyRemote(statuses []Status) bool

func Configured

func Configured() bool

func OpenBus

func OpenBus(ctx context.Context, exec libdb.Exec) (libbus.Messenger, error)

func OpenDB

func OpenDB(ctx context.Context, sqlitePath string, dbPathExplicit bool) (libdb.DBManager, error)

dbPathExplicit must be true only when sqlitePath was named by the caller rather than defaulted.

func OpenKV

func OpenKV(ctx context.Context, db libdb.DBManager) (libkvstore.KVManager, func(), error)

Types

type Selection

type Selection struct {
	PostgresDSN     string
	NATSURL         string
	ValkeyURL       string
	ValkeyAddr      string
	ValkeyUsername  string
	ValkeyPassword  string
	ValkeyDB        int
	ValkeyNamespace string
}

func Resolve

func Resolve() (Selection, error)

func (Selection) UsesNATS

func (s Selection) UsesNATS() bool

func (Selection) UsesPostgres

func (s Selection) UsesPostgres() bool

func (Selection) UsesValkey

func (s Selection) UsesValkey() bool

type Status

type Status struct {
	Substrate string
	Backend   string
	Setting   string
	Target    string
	Err       error
}

func Report

func Report(ctx context.Context, store libdb.Exec, sqlitePath string) ([]Status, error)

func (Status) Remote

func (s Status) Remote() bool

Jump to

Keyboard shortcuts

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