celestiaorg / celestiaorg/celestia-node
feat(share/Getter): extend Getter interface with Name()
- Dominant language
- Go
- Stars
- 996
- Forks
- 1.1k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 34
Description
### Implementation ideas
Currently Getter interface doesn't have any way to reference underlying implementation, besides reflection (ughh). High level Getter could see great benefit of having access to `Name()` method of underlying getters. It could be used for:
- logging errors, will allow to specify which Getter produced an error
- tracing, add attribute to observe specific Getter behaviour
- metrics
Having getters anonymous could become a problem at some point, if we need to debug high level getter.
I suggest simply adding `Name() string` method to Getter, but other approaches could be taken. For example extended interface:
```
type NamedGetter interface{
Name() string
Getter
}
```
Contributor guide
Assessment
This issue has not been assessed yet.