Documentation
ΒΆ
Index ΒΆ
- Constants
- Variables
- func CRC(input string) string
- func ConvertHistoryObjectToString(obj *HistoryObject) string
- func GetShardConfig(mode int) (numDBs, tablesPerDB int, description string)
- func IsPow2(n int) bool
- func LOCKfunc(achan chan struct{}, src string) bool
- func LeftPad(input *string, length int)
- func NullPad(input *string, length int)
- func PrintMemoryStats()
- func PrintMemoryStatsEvery(interval time.Duration)
- func RemoveNullPad(input string) string
- func UNLOCKfunc(achan chan struct{}, src string)
- func UnixTimeMicroSec() int64
- func UnixTimeMilliSec() int64
- func UnixTimeNanoSec() int64
- func UnixTimeSec() int64
- type AccessControlList
- type CCC
- type DBconn
- type DBopts
- type HISTORY
- func (his *HISTORY) AddHistory(hobj *HistoryObject, useL1Cache bool) int
- func (his *HISTORY) BatchTicker(char string, ticker chan struct{})
- func (his *HISTORY) BootHistory(history_dir string, keylen int)
- func (his *HISTORY) BootHistoryClient(historyServer string)
- func (his *HISTORY) CLOSE_HISTORY()
- func (his *HISTORY) DoCacheEvict(char string, hash string, offset int64, key string)
- func (his *HISTORY) FseekHistoryHeader(output *[]byte) (int, error)
- func (his *HISTORY) FseekHistoryLine(offset int64) (string, error)
- func (his *HISTORY) FseekHistoryMessageHash(file *os.File, offset int64, char string, rethash *string) error
- func (his *HISTORY) GetCounter(k string) uint64
- func (his *HISTORY) GetSQLite3Pool() *SQLite3DB
- func (his *HISTORY) GetShardedDB() (*SQLite3ShardedDB, bool)
- func (his *HISTORY) GetShardingInfo() (mode, numDBs, tablesPerDB int, description string)
- func (his *HISTORY) IndexQuery(hash string, indexRetChan chan int, offset int64) (int, error)
- func (his *HISTORY) InitSQLite3() error
- func (his *HISTORY) InitSQLite3WithSharding(shardMode int) error
- func (his *HISTORY) Initialize128DB32Tables() error
- func (his *HISTORY) Initialize16DB256Tables() error
- func (his *HISTORY) Initialize512DB8Tables() error
- func (his *HISTORY) Initialize64DB64Tables() error
- func (his *HISTORY) InitializeDatabase(useMySQL bool) error
- func (his *HISTORY) InitializeDatabaseWithSharding(useMySQL bool, shardMode int) error
- func (his *HISTORY) InitializeFullSplit() error
- func (his *HISTORY) InitializeSingleDB() error
- func (his *HISTORY) NewRConn(historyServer string) *RemoteConn
- func (his *HISTORY) PrintCacheStats()
- func (his *HISTORY) SET_DEBUG(debug int)
- func (his *HISTORY) Sync_upcounter(k string)
- func (his *HISTORY) Sync_upcounterN(k string, v uint64)
- func (his *HISTORY) UsingSQLite3() bool
- func (his *HISTORY) WatchDB()
- type HistoryIndex
- type HistoryObject
- type HistorySettings
- type L1CACHE
- func (l1 *L1CACHE) BootL1Cache(his *HISTORY)
- func (l1 *L1CACHE) L1Stats(statskey string) (retval uint64, retmap map[string]uint64)
- func (l1 *L1CACHE) LockL1Cache(hash string, value int, his *HISTORY) (retcase int)
- func (l1 *L1CACHE) Set(hash string, char string, value int, flagexpires bool, his *HISTORY)
- type L1CACHEMAP
- type L1ECH
- type L1ITEM
- type L1MUXER
- type L1PQ
- type L1PQItem
- type L1pqQ
- type L2CACHE
- func (l2 *L2CACHE) BootL2Cache(his *HISTORY)
- func (l2 *L2CACHE) GetHashFromOffset(offset int64, rethash *string)
- func (l2 *L2CACHE) L2Stats(statskey string) (retval uint64, retmap map[string]uint64)
- func (l2 *L2CACHE) OffsetToChar(offset int64) (retval string)
- func (l2 *L2CACHE) SetOffsetHash(offset int64, hash string, flagexpires bool)
- type L2CACHEMAP
- type L2ECH
- type L2ITEM
- type L2MUXER
- type L2PQ
- type L2PQItem
- type L2pqQ
- type L3CACHE
- func (l3 *L3CACHE) BootL3Cache(his *HISTORY)
- func (l3 *L3CACHE) GetOffsets(key string, char string, offsets *[]int64, his *HISTORY) int
- func (l3 *L3CACHE) L3Stats(statskey string) (retval uint64, retmap map[string]uint64)
- func (l3 *L3CACHE) SetOffsets(key string, char string, offsets []int64, flagexpires bool, src string, ...)
- type L3CACHEMAP
- type L3ECH
- type L3ITEM
- type L3MUXER
- type L3PQ
- type L3PQItem
- type L3pqQ
- type OffsetData
- type Offsets
- type RemoteConn
- type SQL
- func (s *SQL) CloseDB(db *sql.DB)
- func (s *SQL) ClosePool()
- func (s *SQL) GetDB(wait bool) (db *sql.DB, err error)
- func (s *SQL) GetDSN() string
- func (s *SQL) GetIsOpen() int
- func (s *SQL) GetOffsets(key string, db *sql.DB) ([]int64, error)
- func (s *SQL) InsertOffset(key string, offset int64, db *sql.DB) error
- func (s *SQL) NewConn() (*sql.DB, error)
- func (s *SQL) ReturnDB(db *sql.DB)
- func (s *SQL) SetMaxOpen(maxopen int)
- func (s *SQL) ShortHashDB_CreateTables() error
- type SQLite3Conn
- type SQLite3DB
- func (s *SQLite3DB) CloseDB(db *sql.DB)
- func (s *SQLite3DB) ClosePool()
- func (s *SQLite3DB) CreateTables() error
- func (s *SQLite3DB) GetDB(wait bool) (db *sql.DB, err error)
- func (s *SQLite3DB) GetOffsets(key string, db *sql.DB) ([]int64, error)
- func (s *SQLite3DB) InsertOffset(key string, offset int64, db *sql.DB) error
- func (s *SQLite3DB) NewConn() (*sql.DB, error)
- func (s *SQLite3DB) OptimizeDB()
- func (s *SQLite3DB) ReturnDB(db *sql.DB)
- func (s *SQLite3DB) StartOptimizer()
- type SQLite3Opts
- type SQLite3ShardedDB
- func (s *SQLite3ShardedDB) Close() error
- func (s *SQLite3ShardedDB) CreateAllTables() error
- func (s *SQLite3ShardedDB) GetDBAndTable(hash string) (*sql.DB, string, int, error)
- func (s *SQLite3ShardedDB) GetMemoryInfo() map[string]interface{}
- func (s *SQLite3ShardedDB) GetStats() map[string]interface{}
- func (s *SQLite3ShardedDB) ReturnDB(db *sql.DB, dbIndex int)
- type SQLiteData
- type ShardConfig
Constants ΒΆ
const ( // never change this FlagExpires bool = true FlagNeverExpires bool = false )
const ( CR = "\r" LF = "\n" CRLF = CR + LF DefaultSocketPath = "./history.socket" // default launches a tcp port with a telnet interface @ localhost:49119 DefaultServerTCPAddr = "[::]:49119" )
const ( SHARD_SINGLE_DB = 0 // 1 DB with 4096 tables (current default) SHARD_FULL_SPLIT = 1 // 4096 separate DBs SHARD_16_256 = 2 // 16 DBs with 256 tables each SHARD_64_64 = 3 // 64 DBs with 64 tables each SHARD_128_32 = 4 // 128 DBs with 32 tables each SHARD_512_8 = 5 // 512 DBs with 8 tables each )
Sharding configuration constants
const ( HashShort = 0x0B // 11 //KeyIndex = 0 KeyLen = 7 // Fixed key length for MySQL 3-level hex structure (7 chars after 3-char table prefix) NumCacheDBs = 4096 // Changed from 16 to 4096 for 3-level hex (16^3 = 4096) ALWAYS = true // DefExpiresStr use 10 digits as spare so we can update it later without breaking offsets DefExpiresStr string = "----------" // never expires CaseLock = 0xFF // internal cache state. reply with CaseRetry while CaseLock CasePass = 0xF1 // is a reply to L1Lock and IndexQuery CaseDupes = 0x1C // is a reply and cache state CaseRetry = 0x2C // is a reply to if CaseLock or CaseWrite or if history.dat returns EOF CaseAdded = 0x3C // is a reply to WriterChan:responseChan CaseWrite = 0x4C // internal cache state. is not a reply. reply with CaseRetry while CaseWrite is happening CaseError = 0xE1 // some things drop this error ZEROPADLEN = 0xFFF // zeropads the header )
const (
FlagSearch = -1
)
const (
MinRetryWaiter = 100
)
Variables ΒΆ
var ( DBG_CGS bool // DEBUG_CACHE_GROW_SHRINK DefaultCacheExpires int64 = 5 // gets x2 BatchFlushEvery x2 DefaultCacheExtend int64 = 5 // extends cached items after writes DefaultCachePurge int64 = 1 // checks ttl every N seconds. affects CacheExpires/Extend max to + Purge DefaultEvictsCapacity = 16 // his.cEvCap (size of Extend chan) is normally fine as is. ClearEveryN = 16 )
var ( BootHisCli bool DefaultHistoryServer = "[::1]:49119" // localhost:49119 // set only once before boot TCPchanQ = 128 DefaultDialTimeout = 5 // seconds DefaultRetryWaiter = 500 // milliseconds DefaultDialRetries = -1 // try N times and fail or <= 0 enables infinite retry )
var ( DEBUGL1 bool = true L1 bool = true // better not disable L1 cache... L1CacheExpires int64 = DefaultCacheExpires L1ExtendExpires int64 = DefaultCacheExtend L1Purge int64 = DefaultCachePurge L1InitSize int = 128 // L1LockDelay: delays L1 locking by N milliseconds // L1 locking is most likely done per client-connection // settings this greater 0 limits the amount of articles a client can lock&send // 1ms is a max of 1000 messages/sec per conn // 100ms is a max of 10 messages/sec per conn // 250ms is a max of 4 messages/sec per conn // 1000ms is a max of 1 message /sec per conn // text peers mostly dont need more than 4 msg per sec L1LockDelay int = 0 )
var ( DEBUGL2 bool = false L2 bool = true L2CacheExpires int64 = DefaultCacheExpires L2ExtendExpires int64 = DefaultCacheExtend L2Purge int64 = DefaultCachePurge L2InitSize int = 64 * 1024 )
L2Cache: offset => hash less requests to hisDat
var ( DEBUGL3 bool = false L3 bool = true // do not disable! L3CacheExpires int64 = DefaultCacheExpires L3ExtendExpires int64 = DefaultCacheExtend L3Purge int64 = DefaultCachePurge L3InitSize int = 64 * 1024 )
* * L3Cache: key => offsets * less requests to hashDB * * disabling L3 is not a good idea!! * queues hold offsets which DB does not know about! * cache keeps track of duplicate writes * duplicate keys will get an empty_offsets * and the latest will overwrite the past write maybe still in queue *
var ( IndexParallel int = NumCacheDBs NumQueueWriteChan int = NumCacheDBs HisDatWriteBuffer int = 4 * 1024 )
var ( ForcedReplay bool NoReplayHisDat bool UseHashDB bool = true // controls whether to use hash database for duplicate detection BatchFlushEvery int64 = 5120 // milliseconds HISTORY_INDEX_LOCK = make(chan struct{}, 1) // main lock HISTORY_INDEX_LOCK16 = make(chan struct{}, NumCacheDBs) // sub locks BootVerbose = true //TESTHASH0 = "0f05e27ca579892a63a256dacd657f5615fab04bf81e85f53ee52103e3a4fae8" //TESTHASH1 = "f0d784ae13ce7cf1f3ab076027a6265861eb003ad80069cdfb1549dd1b8032e8" //TESTHASH2 = "f0d784ae1747092974d02bd3359f044a91ed4fd0a39dc9a1feffe646e6c7ce09" TESTHASH = "" //TESTCACKEY = "f0d784ae1" //TESTKEY = "784ae1" //TESTBUK = "0d" //TESTDB = "f" //TESTOFFSET = 123456 ROOTDBS []string //ROOTBUCKETS []string //SUBBUCKETS []string BUFLINES = 10 BUFIOBUFFER = 102 * BUFLINES // a history line with sha256 is 102 bytes long including LF or 38 bytes of payload + hashLen History HISTORY DEBUG bool = true DEBUG0 bool = false DEBUG1 bool = false DEBUG2 bool = false DEBUG9 bool = false LOCKHISTORY = make(chan struct{}, 1) HEXCHARS = []string{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"} )
var (
CPUProfile bool // set before boot
)
var ( // set HEX true: converts offset into hex strings to store in hashdb // dont change later once db is initialized! HEX bool = true )
Functions ΒΆ
func ConvertHistoryObjectToString ΒΆ
func ConvertHistoryObjectToString(obj *HistoryObject) string
func GetShardConfig ΒΆ
GetShardConfig returns the configuration for a given shard mode
func PrintMemoryStats ΒΆ
func PrintMemoryStats()
func PrintMemoryStatsEvery ΒΆ
func RemoveNullPad ΒΆ
func UNLOCKfunc ΒΆ
func UNLOCKfunc(achan chan struct{}, src string)
func UnixTimeMicroSec ΒΆ
func UnixTimeMicroSec() int64
func UnixTimeMilliSec ΒΆ
func UnixTimeMilliSec() int64
func UnixTimeNanoSec ΒΆ
func UnixTimeNanoSec() int64
func UnixTimeSec ΒΆ
func UnixTimeSec() int64
Types ΒΆ
type AccessControlList ΒΆ
type AccessControlList struct {
// contains filtered or unexported fields
}
var ( ACL AccessControlList DefaultACL map[string]bool // can be set before booting )
func (*AccessControlList) IsAllowed ΒΆ
func (a *AccessControlList) IsAllowed(ip string) bool
func (*AccessControlList) SetACL ΒΆ
func (a *AccessControlList) SetACL(ip string, val bool)
func (*AccessControlList) SetupACL ΒΆ
func (a *AccessControlList) SetupACL()
type HISTORY ΒΆ
type HISTORY struct { /* it is mostly NOT safe to change any values or read maps from outside! * * set, change, update values only inside (his *HISTORY) functions and * don't forget mutex where needed or run into race conditions. */ DIR string // path to folder: history/ Offset int64 // the actual offset for history.dat WriterChan chan *HistoryObject // history.dat writer channel IndexChan chan *HistoryIndex // main index query channel CutCharRO int Counter map[string]uint64 WBR bool // WatchDBRunning CPUfile *os.File // ptr to file for cpu profiling MEMfile *os.File // ptr to file for mem profiling // TCPchan: used to send hobj via handleRConn to a remote historyServer TCPchan chan *HistoryObject // MySQL RocksDB connection pool MySQLPool *SQL // SQLite3 RocksDB-optimized connection pool (interface{} to avoid import issues) SQLite3Pool interface{} // SQLite3 sharding configuration ShardMode int // 0=1DB/4096tables, 1=4096DBs, 2=16DB/256tables, 3=64DB/64tables, 4=128DB/32tables, 5=512DB/8tables ShardDBs int // number of database files ShardTables int // number of tables per database // L1 cache for lightweight duplicate detection when hash DB is disabled L1 L1CACHE // contains filtered or unexported fields }
func (*HISTORY) AddHistory ΒΆ
func (his *HISTORY) AddHistory(hobj *HistoryObject, useL1Cache bool) int
func (*HISTORY) BatchTicker ΒΆ
func (*HISTORY) BootHistory ΒΆ
BootHistory initializes the history component, configuring its settings and preparing it for operation. It sets up the necessary directories for history and hash databases, and opens the history data file. The function also manages the communication channels for reading and writing historical data. If the `useHashDB` parameter is set to true, it initializes the history database (HashDB) and starts worker routines. Parameters:
- history_dir: The directory where history data will be stored.
- keylen: The length of the hash values used for indexing.
func (*HISTORY) BootHistoryClient ΒΆ
func (*HISTORY) CLOSE_HISTORY ΒΆ
func (his *HISTORY) CLOSE_HISTORY()
func (*HISTORY) DoCacheEvict ΒΆ
DoCacheEvict - stub function (cache layers removed)
func (*HISTORY) FseekHistoryHeader ΒΆ
func (*HISTORY) FseekHistoryLine ΒΆ
func (*HISTORY) FseekHistoryMessageHash ΒΆ
func (his *HISTORY) FseekHistoryMessageHash(file *os.File, offset int64, char string, rethash *string) error
FseekHistoryMessageHash seeks to a specified offset in the history file and extracts a message-ID hash. It reads characters from the file until a tab character ('\t') is encountered, extracting the hash enclosed in curly braces. If a valid hash is found, it returns the hash as a string without curly braces. If the end of the file (EOF) is reached, it returns a special EOF marker.
func (*HISTORY) GetCounter ΒΆ
func (*HISTORY) GetSQLite3Pool ΒΆ
GetSQLite3Pool returns the SQLite3 pool if available
func (*HISTORY) GetShardedDB ΒΆ
func (his *HISTORY) GetShardedDB() (*SQLite3ShardedDB, bool)
GetShardedDB returns the underlying SQLite3ShardedDB if available
func (*HISTORY) GetShardingInfo ΒΆ
GetShardingInfo returns current sharding configuration
func (*HISTORY) IndexQuery ΒΆ
func (*HISTORY) InitSQLite3 ΒΆ
Initialize SQLite3 for history system
func (*HISTORY) InitSQLite3WithSharding ΒΆ
Initialize SQLite3 with specific sharding mode
func (*HISTORY) Initialize128DB32Tables ΒΆ
Initialize128DB32Tables initializes with 128 databases, 32 tables each
func (*HISTORY) Initialize16DB256Tables ΒΆ
Initialize16DB256Tables initializes with 16 databases, 256 tables each
func (*HISTORY) Initialize512DB8Tables ΒΆ
Initialize512DB8Tables initializes with 512 databases, 8 tables each
func (*HISTORY) Initialize64DB64Tables ΒΆ
Initialize64DB64Tables initializes with 64 databases, 64 tables each
func (*HISTORY) InitializeDatabase ΒΆ
InitializeDatabase initializes either MySQL or SQLite3 database backend
func (*HISTORY) InitializeDatabaseWithSharding ΒΆ
InitializeDatabaseWithSharding initializes database backend with specific sharding mode
func (*HISTORY) InitializeFullSplit ΒΆ
InitializeFullSplit initializes with 4096 separate databases
func (*HISTORY) InitializeSingleDB ΒΆ
InitializeSingleDB initializes with 1 database and 4096 tables
func (*HISTORY) NewRConn ΒΆ
func (his *HISTORY) NewRConn(historyServer string) *RemoteConn
func (*HISTORY) PrintCacheStats ΒΆ
func (his *HISTORY) PrintCacheStats()
func (*HISTORY) Sync_upcounter ΒΆ
func (*HISTORY) Sync_upcounterN ΒΆ
func (*HISTORY) UsingSQLite3 ΒΆ
UsingSQLite3 returns true if SQLite3 backend is being used
type HistoryIndex ΒΆ
type HistoryIndex struct { Hash string Char string // first N chars of hash Offset int64 // used to search: -1 or add: > 0 a hash IndexRetChan chan int // receives a 0,1,2 :: pass|duplicate|retrylater }
used to query the index
type HistoryObject ΒΆ
type HistoryObject struct { MessageIDHash string StorageToken string // "F" = flatstorage | "M" = mongodb | "X" = deleted Char string Arrival int64 Expires int64 Date int64 ResponseChan chan int // receives a 0,1,2 :: pass|duplicate|retrylater }
func ConvertStringToHistoryObject ΒΆ
func ConvertStringToHistoryObject(parts []string) (*HistoryObject, error)
type HistorySettings ΒΆ
type HistorySettings struct { // constant values once DBs are initalized Ka int // keyalgo Kl int // keylen }
builds the history.dat header
type L1CACHE ΒΆ
type L1CACHE struct { Caches map[string]*L1CACHEMAP Extend map[string]*L1ECH Muxers map[string]*L1MUXER Counter map[string]*CCC // contains filtered or unexported fields }
func (*L1CACHE) BootL1Cache ΒΆ
The BootL1Cache method initializes the cache system. It creates cache maps, initializes them with initial sizes, and starts goroutines to periodically purge expired entries.
func (*L1CACHE) LockL1Cache ΒΆ
The LockL1Cache method is used to LOCK a `MessageIDHash` for processing. If the value is not in the cache or has expired, it locks the cache, updates the cache with a new value, and returns the value. Possible return values:
CaseLock == already in processing CaseWrite == already in processing CaseDupes == is a duplicate CasePass == not a duplicate == locked article for processing
type L1CACHEMAP ΒΆ
type L1CACHEMAP struct {
// contains filtered or unexported fields
}
type L2CACHE ΒΆ
type L2CACHE struct { Caches map[string]*L2CACHEMAP Extend map[string]*L2ECH Muxers map[string]*L2MUXER Counter map[string]*CCC // contains filtered or unexported fields }
func (*L2CACHE) BootL2Cache ΒΆ
The BootL2Cache method initializes the L2 cache. It creates cache maps, initializes them with initial sizes, and starts goroutines to periodically clean up expired entries.
func (*L2CACHE) GetHashFromOffset ΒΆ
The GetHashFromOffset method retrieves a hash from the L2 cache using an offset as the key.
func (*L2CACHE) OffsetToChar ΒΆ
type L2CACHEMAP ΒΆ
type L2CACHEMAP struct {
// contains filtered or unexported fields
}
type L3CACHE ΒΆ
type L3CACHE struct { Caches map[string]*L3CACHEMAP Extend map[string]*L3ECH Muxers map[string]*L3MUXER Counter map[string]*CCC // contains filtered or unexported fields }
func (*L3CACHE) BootL3Cache ΒΆ
The BootL3Cache method initializes the L3 cache. It creates cache maps, initializes them with initial sizes, and starts goroutines to periodically clean up expired entries.
func (*L3CACHE) GetOffsets ΒΆ
The GetOffsets method retrieves a slice of offsets from the L3 cache using a key and a char.
func (*L3CACHE) SetOffsets ΒΆ
func (l3 *L3CACHE) SetOffsets(key string, char string, offsets []int64, flagexpires bool, src string, his *HISTORY)
The SetOffsets method sets a cache item in the L3 cache using a key, char and a slice of offsets as the value. It also dynamically grows the cache when necessary.
type L3CACHEMAP ΒΆ
type L3CACHEMAP struct {
// contains filtered or unexported fields
}
type OffsetData ΒΆ
type RemoteConn ΒΆ
type RemoteConn struct {
// contains filtered or unexported fields
}
holds connection to historyServer
type SQL ΒΆ
type SQL struct { DBs chan *DBconn // contains filtered or unexported fields } // end func SQLhandler
func NewSQLpool ΒΆ
createTables := true
shortHashDBpool, err := history.NewSQLpool(&history.DBopts{ username: "xxx", password: "xxx", hostname: "xxx", dbname: "xxx", maxopen: "128", initopen: "16", tcpmode: "tcp4", timeout: 55, }, createTables)
func (*SQL) SetMaxOpen ΒΆ
func (*SQL) ShortHashDB_CreateTables ΒΆ
type SQLite3Conn ΒΆ
type SQLite3Conn struct {
// contains filtered or unexported fields
}
type SQLite3DB ΒΆ
type SQLite3DB struct { DBs chan *SQLite3Conn // contains filtered or unexported fields }
func NewSQLite3Pool ΒΆ
func NewSQLite3Pool(opts *SQLite3Opts, createTables bool) (*SQLite3DB, error)
func (*SQLite3DB) CreateTables ΒΆ
func (*SQLite3DB) GetOffsets ΒΆ
func (*SQLite3DB) InsertOffset ΒΆ
func (*SQLite3DB) OptimizeDB ΒΆ
func (s *SQLite3DB) OptimizeDB()
Optimize SQLite3 database periodically
func (*SQLite3DB) StartOptimizer ΒΆ
func (s *SQLite3DB) StartOptimizer()
Start periodic optimization
type SQLite3Opts ΒΆ
type SQLite3Opts struct {
// contains filtered or unexported fields
}
type SQLite3ShardedDB ΒΆ
type SQLite3ShardedDB struct { DBPools []*SQLite3DB // Array of database pools // contains filtered or unexported fields }
SQLite3ShardedDB manages multiple SQLite databases for sharding
func NewSQLite3ShardedDB ΒΆ
func NewSQLite3ShardedDB(config *ShardConfig, createTables bool) (*SQLite3ShardedDB, error)
NewSQLite3ShardedDB creates a new sharded SQLite3 database system
func (*SQLite3ShardedDB) Close ΒΆ
func (s *SQLite3ShardedDB) Close() error
Close closes all database connections
func (*SQLite3ShardedDB) CreateAllTables ΒΆ
func (s *SQLite3ShardedDB) CreateAllTables() error
CreateAllTables creates all required tables across all databases
func (*SQLite3ShardedDB) GetDBAndTable ΒΆ
GetDBAndTable returns the appropriate database connection and table name for a hash
func (*SQLite3ShardedDB) GetMemoryInfo ΒΆ
func (s *SQLite3ShardedDB) GetMemoryInfo() map[string]interface{}
GetMemoryInfo returns memory usage information for the current sharding configuration
func (*SQLite3ShardedDB) GetStats ΒΆ
func (s *SQLite3ShardedDB) GetStats() map[string]interface{}
GetStats returns statistics for all databases
type SQLiteData ΒΆ
type SQLiteData struct {
// contains filtered or unexported fields
}