Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEventStorage ¶
func CreateEventStorage(eventURL, beefURL, pubsubURL string) (storage.EventDataStorage, error)
CreateEventStorage creates a fully configured event storage with BEEF storage and optional PubSub.
Parameters:
- eventURL: Event storage connection string (e.g., "redis://localhost:6379", "./overlay.db")
- beefURL: BEEF storage connection string(s) (can be hierarchical)
- pubsubURL: PubSub connection string (e.g., "redis://localhost:6379", "channels://")
The beefURL parameter can be:
- A single connection string: "redis://localhost:6379"
- A JSON array of connection strings: `["lru://100mb", "redis://localhost:6379", "junglebus://"]`
- A comma-separated list: "lru://100mb,redis://localhost:6379,junglebus://"
Note: If your connection strings contain commas, use the JSON array format.
Example configurations:
All Redis: CreateEventStorage("redis://localhost:6379", "redis://localhost:6379", "redis://localhost:6379")
MongoDB for events, hierarchical BEEF storage, Redis pubsub: CreateEventStorage("mongodb://localhost:27017/bsv21", `["lru://1gb", "redis://localhost:6379", "junglebus://"]`, "redis://localhost:6379")
SQLite for events, filesystem for BEEF, channel pubsub: CreateEventStorage("./overlay.db", "./beef_storage/", "channels://")
Default no-dependency setup: CreateEventStorage("", "", "") // Uses ~/.1sat/overlay.db, ~/.1sat/beef/, channels://
Types ¶
This section is empty.