fips140cache
packagestandard libraryThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package fips140cache provides a weak map that associates the lifetime ofvalues with the lifetime of keys.
It can be used to associate a precomputed value (such as an internal/fips140PrivateKey value, which in FIPS 140-3 mode may have required an expensivepairwise consistency test) with a type that doesn't have private fields (suchas an ed25519.PrivateKey), or that can't be safely modified because it may beconcurrently copied (such as an ecdsa.PrivateKey).
Index¶
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeCache¶
type Cache[K, Vany] struct {// contains filtered or unexported fields}
func (*Cache[K, V])Get¶
Get returns the result of new, for an associated key k.
If Get was called with k before and didn't return an error, Get may returnthe same value it returned from the previous call if check returns true onit. If check returns false, Get will call new again and return the result.
The cache is evicted some time after k becomes unreachable.