examples: add an example catalog to demonstrate capabilities

This commit is contained in:
Mya 2022-05-23 21:54:12 -05:00
parent 50d86b26e4
commit 8e11da51d5
No known key found for this signature in database
GPG Key ID: C3ECFA648DAD27FA
2 changed files with 94 additions and 0 deletions

94
examples/catalog.go Normal file
View File

@ -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", "#"),
),
),
)
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 KiB

After

Width:  |  Height:  |  Size: 383 KiB