Method
Process
(l baker.Record, next func(baker.Record))
Source from the content-addressed store, hash-verified
| 55 | } |
| 56 | |
| 57 | func (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 | } |