MCPcopy Create free account
hub / github.com/DoNewsCode/core / WithAccessor

Function WithAccessor

config/config.go:342–347  ·  view source on GitHub ↗

WithAccessor upgrade contract.ConfigUnmarshaler to contract.ConfigAccessor by wrapping the original unmarshaler.

(unmarshaler contract.ConfigUnmarshaler)

Source from the content-addressed store, hash-verified

340// WithAccessor upgrade contract.ConfigUnmarshaler to contract.ConfigAccessor by
341// wrapping the original unmarshaler.
342func WithAccessor(unmarshaler contract.ConfigUnmarshaler) contract.ConfigAccessor {
343 if accessor, ok := unmarshaler.(contract.ConfigAccessor); ok {
344 return accessor
345 }
346 return wrappedConfigAccessor{unmarshaler: unmarshaler}
347}

Callers 3

NewFunction · 0.92
TestUpgradeFunction · 0.85
TestNewAppNameFromConfFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestUpgradeFunction · 0.68
TestNewAppNameFromConfFunction · 0.68