cache

package
v0.0.0-...-28742d7 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package cache provides an interface and some implementations for caching translations

Index

Constants

This section is empty.

Variables

View Source
var (
	Memory memoryCache
)

Functions

This section is empty.

Types

type Cache

type Cache interface {
	// Put makes a translation available for subsequent calls to other methods of this cache
	Put(sourcePhrase string, targetLang language.Tag, targetPhrase string) (err error)

	// Has returns true if there is a translation matching the parameters
	Has(sourcePhrase string, targetLang language.Tag) bool

	// Get returns the translation matching the parameters, or an error, if it could not be retrieved,
	// or is not present in cache.
	Get(sourcePhrase string, targetLang language.Tag) (targetPhrase string, err error)
}

Cache is the interface describing a translation cache.

Jump to

Keyboard shortcuts

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