diff --git a/examples/catalog.go b/examples/catalog.go new file mode 100644 index 0000000..dfa279d --- /dev/null +++ b/examples/catalog.go @@ -0,0 +1,94 @@ +package main + +import ( + "github.com/mjpitz/emc/catalog" + "github.com/mjpitz/emc/catalog/linkgroup" + "github.com/mjpitz/emc/catalog/service" +) + +func main() { + catalog.Serve( + catalog.Service( + "CI/CD", + service.LogoURL("https://th.bing.com/th/id/OIP.wd0WnO0MF56eQ23LR8XzRAAAAA?pid=ImgDet&rs=1"), + service.URL("https://deploy.example.com"), + service.Description("Continuous integration and delivery platform."), + service.Metadata( + "Key1", "Key1Value1", + "Key1", "Key1Value2", + "Key2", "Key2Value1", + ), + service.LinkGroup( + "Dashboards", + linkgroup.Link("System", "#"), + linkgroup.Link("Queue", "#"), + ), + service.LinkGroup( + "Documentation", + linkgroup.Link("Developing", "#"), + linkgroup.Link("Releasing", "#"), + linkgroup.Link("Contributing", "#"), + ), + ), + catalog.Service( + "Version Control", + service.LogoURL(""), + service.URL("https://code.example.com"), + service.Description("System source code."), + service.Metadata( + "Key1", "Key1Value1", + "Key1", "Key1Value2", + "Key2", "Key2Value1", + ), + service.LinkGroup( + "Dashboards", + linkgroup.Link("System", "#"), + linkgroup.Link("Database", "#"), + linkgroup.Link("Queue", "#"), + ), + service.LinkGroup( + "Documentation", + linkgroup.Link("Developing", "#"), + linkgroup.Link("Releasing", "#"), + ), + ), + catalog.Service( + "Monitoring", + service.Metadata( + "Key1", "Key1Value1", + "Key1", "Key1Value2", + "Key2", "Key2Value1", + ), + service.LinkGroup( + "Dashboards", + linkgroup.Link("System", "#"), + linkgroup.Link("Database", "#"), + linkgroup.Link("Queue", "#"), + ), + service.LinkGroup( + "Documentation", + linkgroup.Link("Developing", "#"), + linkgroup.Link("Releasing", "#"), + ), + ), + catalog.Service( + "Alerting", + service.Metadata( + "Key1", "Key1Value1", + "Key1", "Key1Value2", + "Key2", "Key2Value1", + ), + service.LinkGroup( + "Dashboards", + linkgroup.Link("System", "#"), + linkgroup.Link("Database", "#"), + linkgroup.Link("Queue", "#"), + ), + service.LinkGroup( + "Documentation", + linkgroup.Link("Developing", "#"), + linkgroup.Link("Releasing", "#"), + ), + ), + ) +} diff --git a/screenshot.png b/screenshot.png index 2209650..a34d471 100644 Binary files a/screenshot.png and b/screenshot.png differ