MCPcopy Create free account
hub / github.com/devfile/devworkspace-operator / GetInto

Method GetInto

apis/controller/v1alpha1/attributes.go:206–214  ·  view source on GitHub ↗

GetInto allows decoding the attribute with the given key into a given interface. The provided interface should be a pointer to a struct, to an array, or to any simple type. An error is returned if the provided interface type is not compatible with the attribute content

(key string, into interface{})

Source from the content-addressed store, hash-verified

204// An error is returned if the provided interface type is not compatible
205// with the attribute content
206func (attributes Attributes) GetInto(key string, into interface{}) error {
207 var err error
208 if attribute, exists := attributes[key]; exists {
209 err = json.Unmarshal(attribute.Raw, into)
210 } else {
211 err = &KeyNotFoundError{Key: key}
212 }
213 return err
214}
215
216// Strings allows returning only the attributes whose content
217// is a JSON string.

Callers 4

getPodOverridesFunction · 0.80
ApplyContainerOverridesFunction · 0.80
collectWorkspaceEnvFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected