MCPcopy Create free account
hub / github.com/goadesign/goa / ElemName

Method ElemName

expr/mapped_attribute.go:153–161  ·  view source on GitHub ↗

ElemName returns the transport element name of the given object key. It returns keyName if it's a key of the mapped attribute object type. It panics if there is no mapping and keyName is not a key.

(keyName string)

Source from the content-addressed store, hash-verified

151// returns keyName if it's a key of the mapped attribute object type. It panics
152// if there is no mapping and keyName is not a key.
153func (ma *MappedAttributeExpr) ElemName(keyName string) string {
154 if n, ok := ma.nameMap[keyName]; ok {
155 return n
156 }
157 if att := AsObject(ma.Type).Attribute(keyName); att != nil {
158 return keyName
159 }
160 panic("Key " + keyName + " is not defined") // bug
161}
162
163// KeyName returns the object key of the given transport element name. It
164// returns elemName if it's a key of the mapped attribute object type. It panics

Callers 8

AttributeMethod · 0.95
FindKeyMethod · 0.95
compatibleFunction · 0.95
WalkMappedAttrFunction · 0.80
transformObjectFunction · 0.80
transformObjectFunction · 0.80
WalkMappedAttrFunction · 0.80

Calls 2

AsObjectFunction · 0.85
AttributeMethod · 0.65

Tested by 1