MCPcopy Create free account
hub / github.com/akash-network/provider / PersistentConfigReaderFromCtx

Function PersistentConfigReaderFromCtx

tools/fromctx/context.go:241–253  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

239}
240
241func PersistentConfigReaderFromCtx(ctx context.Context) (pconfig.StorageR, error) {
242 val := ctx.Value(CtxKeyPersistentConfig)
243 if val == nil {
244 return nil, fmt.Errorf("%w: context does not have persistent config reader set", ErrNotFound)
245 }
246
247 res, valid := val.(pconfig.Storage)
248 if !valid {
249 return nil, ErrValueInvalidType
250 }
251
252 return res, nil
253}
254
255func PersistentConfigWriterFromCtx(ctx context.Context) (pconfig.StorageW, error) {
256 val := ctx.Value(CtxKeyPersistentConfig)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected