Commit b28ea0b4 by bergquist

dashboards as cfg: type

parent 2a18345e
......@@ -33,7 +33,7 @@ func (provider *DashboardProvisioner) Provision(ctx context.Context) error {
for _, cfg := range cfgs {
switch cfg.Type {
case "file":
fileReader, err := NewDashboardFilereader(cfg, provider.log.New("type", cfg.Type, "name", cfg.Name))
fileReader, err := NewDashboardFileReader(cfg, provider.log.New("type", cfg.Type, "name", cfg.Name))
if err != nil {
return err
}
......
......@@ -26,7 +26,7 @@ type fileReader struct {
cache *gocache.Cache
}
func NewDashboardFilereader(cfg *DashboardsAsConfig, log log.Logger) (*fileReader, error) {
func NewDashboardFileReader(cfg *DashboardsAsConfig, log log.Logger) (*fileReader, error) {
path, ok := cfg.Options["folder"].(string)
if !ok {
return nil, fmt.Errorf("Failed to load dashboards. folder param is not a string")
......
......@@ -41,7 +41,7 @@ func TestDashboardFileReader(t *testing.T) {
Convey("Can read default dashboard", func() {
cfg.Options["folder"] = defaultDashboards
reader, err := NewDashboardFilereader(cfg, logger)
reader, err := NewDashboardFileReader(cfg, logger)
So(err, ShouldBeNil)
err = reader.walkFolder()
......@@ -58,7 +58,7 @@ func TestDashboardFileReader(t *testing.T) {
Slug: "grafana",
})
reader, err := NewDashboardFilereader(cfg, logger)
reader, err := NewDashboardFileReader(cfg, logger)
So(err, ShouldBeNil)
err = reader.walkFolder()
......@@ -77,7 +77,7 @@ func TestDashboardFileReader(t *testing.T) {
Slug: "grafana",
})
reader, err := NewDashboardFilereader(cfg, logger)
reader, err := NewDashboardFileReader(cfg, logger)
So(err, ShouldBeNil)
err = reader.walkFolder()
......@@ -94,7 +94,7 @@ func TestDashboardFileReader(t *testing.T) {
Folder: "",
}
_, err := NewDashboardFilereader(cfg, logger)
_, err := NewDashboardFileReader(cfg, logger)
So(err, ShouldNotBeNil)
})
......@@ -109,7 +109,7 @@ func TestDashboardFileReader(t *testing.T) {
},
}
_, err := NewDashboardFilereader(cfg, logger)
_, err := NewDashboardFileReader(cfg, logger)
So(err, ShouldBeNil)
})
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment