fileCache

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Map2File

func Map2File(db *FcDb) (err error)

func Map2FileConsumer

func Map2FileConsumer(db *FcDb)

func Map2FileProducer

func Map2FileProducer(db *FcDb)

Types

type FCInterface

type FCInterface interface {
	Put(key string, value string, millisecondTTL int64, dbName string) error
	Get(key string, dbName string) (string, error)
	Del(key string, dbName string) error
}

type FcDb

type FcDb struct {
	DbRwLock       sync.RWMutex
	DbData         map[string]string
	ExpireData     map[string]int64
	DbName         string
	DbFilePath     string
	ExpireFilePath string
	// contains filtered or unexported fields
}

func Init

func Init(dirPath string, dbName string) (*FcDb, error)

func (*FcDb) Del

func (_this *FcDb) Del(key string)

func (*FcDb) Get

func (_this *FcDb) Get(key string) (value string, exist bool)

func (*FcDb) Put

func (_this *FcDb) Put(key string, value string, milliSecond int64)

Jump to

Keyboard shortcuts

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