Skip to content

Commit

Permalink
export CallsFile
Browse files Browse the repository at this point in the history
Signed-off-by: Thibault Mange <22740367+thibaultmg@users.noreply.github.com>
  • Loading branch information
thibaultmg committed Dec 20, 2023
1 parent 5bd3c16 commit 15fe258
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/up/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ const (
labelError = "error"
)

type callsFile struct {
// CallsFile is a struct that represents the YAML file format for queries.
// It is exported for other third party packages to use when generating their queries.
type CallsFile struct {
Queries []options.QuerySpec `yaml:"queries"`
Labels []options.LabelSpec `yaml:"labels"`
Series []options.SeriesSpec `yaml:"series"`
Expand Down Expand Up @@ -544,7 +546,7 @@ func parseQueriesFileName(opts *options.Options, l log.Logger, queriesFileName s
return fmt.Errorf("--queries-file is invalid: %w", err)
}

qf := callsFile{}
qf := CallsFile{}
err = yaml.Unmarshal(b, &qf)

if err != nil {
Expand Down

0 comments on commit 15fe258

Please sign in to comment.