Movatterモバイル変換


[0]ホーム

URL:


fips140cache

packagestandard library
go1.25.2Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2025 License:BSD-3-ClauseImports:3Imported by:0

Details

Repository

cs.opensource.google/go/go

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

func (c *Cache[K, V]) Get(k *K, new func() (*V,error), check func(*V)bool) (*V,error)

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.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp