MCPcopy
hub / github.com/perkeep/perkeep / Attr

Method Attr

pkg/importer/importer.go:1428–1435  ·  view source on GitHub ↗

Attr returns the object's attribute value for the provided attr, or the empty string if unset. To distinguish between unset, an empty string, or multiple attribute values, use Attrs.

(attr string)

Source from the content-addressed store, hash-verified

1426// or the empty string if unset. To distinguish between unset,
1427// an empty string, or multiple attribute values, use Attrs.
1428func (o *Object) Attr(attr string) string {
1429 o.mu.RLock()
1430 defer o.mu.RUnlock()
1431 if v := o.attr[attr]; len(v) > 0 {
1432 return v[0]
1433 }
1434 return ""
1435}
1436
1437// Attrs returns the attribute values for the provided attr.
1438func (o *Object) Attrs(attr string) []string {

Callers 15

bestNodeMethod · 0.95
SetAttrMethod · 0.95
SetAttrs2Method · 0.95
ChildPathObjectOrFuncMethod · 0.95
IsAccountReadyMethod · 0.45
SummarizeAccountMethod · 0.45
maybeStartMethod · 0.45
StatusMethod · 0.45
credentialsMethod · 0.45
accountMethod · 0.45
toggleAutoMethod · 0.45
RefreshIntervalMethod · 0.45

Calls 2

RLockMethod · 0.65
RUnlockMethod · 0.65

Tested by 4

checkTweetsFunction · 0.36
TestIntegrationRunFunction · 0.36
TestIntegrationRunFunction · 0.36
TestIntegrationFunction · 0.36