MCPcopy Index your code
hub / github.com/netdata/netdata / resolveChartType

Function resolveChartType

src/go/plugin/framework/chartengine/compiler.go:310–327  ·  view source on GitHub ↗
(raw string)

Source from the content-addressed store, hash-verified

308}
309
310func resolveChartType(raw string) (program.ChartType, error) {
311 normalized := strings.TrimSpace(raw)
312 if normalized == "" {
313 return program.ChartTypeLine, nil
314 }
315 switch normalized {
316 case string(program.ChartTypeLine):
317 return program.ChartTypeLine, nil
318 case string(program.ChartTypeArea):
319 return program.ChartTypeArea, nil
320 case string(program.ChartTypeStacked):
321 return program.ChartTypeStacked, nil
322 case string(program.ChartTypeHeatmap):
323 return program.ChartTypeHeatmap, nil
324 default:
325 return "", fmt.Errorf("invalid chart type %q", raw)
326 }
327}
328
329func compileLifecycle(in *charttpl.Lifecycle) program.LifecyclePolicy {
330 out := defaultChartLifecyclePolicyCopy()

Callers 1

compileChartMethod · 0.85

Calls 1

ErrorfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…