NewSigningCache instantiates a cache. Close should be called to release resources associated with its internal timer.
(ctx context.Context, logger slog.Logger, fetcher Fetcher, feature codersdk.CryptoKeyFeature, opts ...func(*cache), )
| 104 | // NewSigningCache instantiates a cache. Close should be called to release resources |
| 105 | // associated with its internal timer. |
| 106 | func NewSigningCache(ctx context.Context, logger slog.Logger, fetcher Fetcher, |
| 107 | feature codersdk.CryptoKeyFeature, opts ...func(*cache), |
| 108 | ) (SigningKeycache, error) { |
| 109 | if !isSigningKeyFeature(feature) { |
| 110 | return nil, xerrors.Errorf("invalid feature: %s", feature) |
| 111 | } |
| 112 | logger = logger.Named(fmt.Sprintf("%s_signing_keycache", feature)) |
| 113 | return newCache(ctx, logger, fetcher, feature, opts...), nil |
| 114 | } |
| 115 | |
| 116 | func NewEncryptionCache(ctx context.Context, logger slog.Logger, fetcher Fetcher, |
| 117 | feature codersdk.CryptoKeyFeature, opts ...func(*cache), |