MCPcopy Index your code
hub / github.com/coder/coder / NewEncryptionCache

Function NewEncryptionCache

coderd/cryptokeys/cache.go:116–124  ·  view source on GitHub ↗
(ctx context.Context, logger slog.Logger, fetcher Fetcher,
	feature codersdk.CryptoKeyFeature, opts ...func(*cache),
)

Source from the content-addressed store, hash-verified

114}
115
116func NewEncryptionCache(ctx context.Context, logger slog.Logger, fetcher Fetcher,
117 feature codersdk.CryptoKeyFeature, opts ...func(*cache),
118) (EncryptionKeycache, error) {
119 if !isEncryptionKeyFeature(feature) {
120 return nil, xerrors.Errorf("invalid feature: %s", feature)
121 }
122 logger = logger.Named(fmt.Sprintf("%s_encryption_keycache", feature))
123 return newCache(ctx, logger, fetcher, feature, opts...), nil
124}
125
126func newCache(ctx context.Context, logger slog.Logger, fetcher Fetcher, feature codersdk.CryptoKeyFeature, opts ...func(*cache)) *cache {
127 cache := &cache{

Callers 4

NewFunction · 0.92
TestJWEFunction · 0.92
NewFunction · 0.92

Calls 4

isEncryptionKeyFeatureFunction · 0.85
newCacheFunction · 0.85
NamedMethod · 0.80
ErrorfMethod · 0.45

Tested by 2

TestJWEFunction · 0.74