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

Function PersistentConfigWriterFromCtx

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

Source from the content-addressed store, hash-verified

253}
254
255func PersistentConfigWriterFromCtx(ctx context.Context) (pconfig.StorageW, error) {
256 val := ctx.Value(CtxKeyPersistentConfig)
257 if val == nil {
258 return nil, fmt.Errorf("%w: context does not have persistent config writer set", ErrNotFound)
259 }
260
261 res, valid := val.(pconfig.Storage)
262 if !valid {
263 return nil, ErrValueInvalidType
264 }
265
266 return res, nil
267}
268
269func PersistentConfigFromCtx(ctx context.Context) (pconfig.Storage, error) {
270 val := ctx.Value(CtxKeyPersistentConfig)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected