basefm

package
v0.0.0-...-4f10b81 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(newCacheFn func(key string, cacheSize int) Cache) fetchmgr.FetchManager

Types

type Cache

type Cache interface {
	OpenCounter() *int
	Key() string
	Fetch(fetcher *Fetcher, gtRevision uint64) (list fetchmgr.ResourceItemList, seq uint64)
	Fill(fetcher *Fetcher, db *gorm.DB, gtRevision uint64, seq uint64) (fetchmgr.ResourceList, error)
}

type CacheBasedFetchManager

type CacheBasedFetchManager struct {
	// contains filtered or unexported fields
}

One of these exists off of the top-level API object.

func (*CacheBasedFetchManager) Open

func (manager *CacheBasedFetchManager) Open(key string, cacheSize int, fetchFn fetchmgr.FetchFn) fetchmgr.Fetcher

type Fetcher

type Fetcher struct {
	FetchFn            func(db *gorm.DB, gtRevision uint64) (fetchmgr.ResourceList, error)
	FetchFromTailCache bool
	ReadPos            uint64
	// contains filtered or unexported fields
}

Created by CacheBasedFetchManager.Open() The same Cache key can be opened multiple times. Each client that uses the same cache has its own instance of Fetcher, and they all point to the same Cache.

func (*Fetcher) Close

func (f *Fetcher) Close()

func (*Fetcher) Fetch

func (f *Fetcher) Fetch(db *gorm.DB, gtRevision uint64) (fetchmgr.ResourceList, error)

Jump to

Keyboard shortcuts

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