memdb

package
v0.0.0-...-7c66ffc Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package memdb contains a write-through cached storage. It will cache everything relevant in memory (either all data in the storage or parts of it) and serve read requests from memory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MoveData

func MoveData(table string, source, destination *sql.DB, clause string) error

MoveData moves data from one database to another. Tables must exist in both source and destination. This is not thread safe and should not be performed on a live destination database. Use the clause string to limit the selection. The clause is concatenated at the end of the SELECT so it's a prime candidate for SQL injection. DO NOT USE THIS in external APIs. Ever.

func NewCacheLookup

func NewCacheLookup(store storage.DataStore) sqlstore.InternalLookups

NewCacheLookup creates an internal lookup implementation that uses the local cached database rather than an external one. This creates dummy transactions for the local *sql.DB instance and calls the internal utility lookups directly. It's a bit convoluted and

func PrimeAPNCache

func PrimeAPNCache(source storage.APNStore) (storage.APNStore, error)

PrimeAPNCache primes the APN cached storage

func PrimeMemoryCache

func PrimeMemoryCache(source storage.DataStore) (storage.DataStore, error)

PrimeMemoryCache primes the data store with data from a backend store. All data is read into memory and a memDB implementation is returned. The existing data that is created during schema creation must be removed before it is transplanted across.

Types

This section is empty.

Jump to

Keyboard shortcuts

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