Method
Lookup
(ctx context.Context, key string)
Source from the content-addressed store, hash-verified
| 55 | } |
| 56 | |
| 57 | func (s *EmailLocalpart) Lookup(ctx context.Context, key string) (string, bool, error) { |
| 58 | mbox, _, err := address.Split(key) |
| 59 | if err != nil { |
| 60 | if s.allowNonEmail { |
| 61 | return key, true, nil |
| 62 | } |
| 63 | // Invalid email, no local part mapping. |
| 64 | return "", false, nil |
| 65 | } |
| 66 | return mbox, true, nil |
| 67 | } |
| 68 | |
| 69 | func init() { |
| 70 | modules.Register("table.email_localpart", NewEmailLocalpart) |
Callers
nothing calls this directly
Tested by
no test coverage detected