Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor refactor of backend metadata and metric rendering #920

Merged
merged 1 commit into from
Feb 8, 2016

Conversation

paulbellamy
Copy link
Contributor

fixes #835

@tomwilkie
Copy link
Contributor

I'm not sure I like the reuse of MetadataRow here. I think it would be better to make an interface like this:

type MetadataRowRenderer interface {
  Render(report.Node) []MetadataRow
}

type Latest struct {
  ID string
}

func (l Latest) Render(report.Node) []MetadataRow {
...
}

type Metric struct {
 ID string
}

func (m Metric) Render(report.Node) []MetadataRow {
...
}
...

You could then see these renderers being included in the report such that plugins can add stuff to the details panel. Make sense?

Also, this would allow you to add a field to Latest called Length, and solve #930 in a nicer way.

@tomwilkie
Copy link
Contributor

Could call MetadataRowRenderer "RowTemplate"

@tomwilkie tomwilkie assigned paulbellamy and unassigned tomwilkie Feb 5, 2016
@paulbellamy paulbellamy force-pushed the refactor-detailed-metadata branch from 8e9983d to a2bab45 Compare February 8, 2016 10:39
@paulbellamy paulbellamy force-pushed the refactor-detailed-metadata branch from a2bab45 to e33838f Compare February 8, 2016 14:01
@paulbellamy
Copy link
Contributor Author

Applied tom's feedback verbatim, so merging.

paulbellamy added a commit that referenced this pull request Feb 8, 2016
minor refactor of backend metadata and metric rendering
@paulbellamy paulbellamy merged commit 30dd97b into master Feb 8, 2016
@paulbellamy paulbellamy deleted the refactor-detailed-metadata branch February 8, 2016 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor render/detailed/metadata.go
2 participants