cache

package
v0.0.0-...-13e6371 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorNone           translationError = iota // Everything is fine
	ErrorMinor                                  // Connection timed out or something like that
	ErrorBadTranslation                         // Returned really bad translation
)
View Source
const (
	CleanupInterval = (24 * time.Hour) * 7
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Put(bucketName, text, translation string, cerr error) error
	Get(bucketName, text string) (string, bool, error)
	Close() error
}

func NewCache

func NewCache(conf *config.Config, translators []string) (Cache, error)

type Item

type Item struct {
	Translation string
	ErrorCode   translationError
	ErrorText   string
	Timestamp   int64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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