MCPcopy Create free account
hub / github.com/AdRoll/baker / Process

Method Process

filter/metadata_url.go:57–79  ·  view source on GitHub ↗
(l baker.Record, next func(baker.Record))

Source from the content-addressed store, hash-verified

55}
56
57func (f *MetadataUrl) Process(l baker.Record, next func(baker.Record)) {
58 v, ok := l.Meta(inpututils.MetadataURL)
59 if !ok {
60 l.Set(f.dst, nil)
61 next(l)
62 return
63 }
64
65 url := v.(*url.URL)
66 if url == nil {
67 l.Set(f.dst, nil)
68 next(l)
69 return
70 }
71
72 urlStr, ok := f.Load(url)
73 if !ok {
74 urlStr = url.String()
75 f.Store(url, urlStr)
76 }
77 l.Set(f.dst, []byte(urlStr.(string)))
78 next(l)
79}

Callers 2

TestMetadataUrlFunction · 0.95
TestMetadataUrlCopyFunction · 0.95

Calls 5

LoadMethod · 0.80
StoreMethod · 0.80
MetaMethod · 0.65
SetMethod · 0.65
StringMethod · 0.45

Tested by 2

TestMetadataUrlFunction · 0.76
TestMetadataUrlCopyFunction · 0.76