-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(bin): remove usless print * feat(source): Support toml source * build(go.mod): go get stretchr/testify
- Loading branch information
1 parent
8adc60b
commit 88757a5
Showing
9 changed files
with
55 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
url = "https://grafana.home/api/annotations" | ||
api_key = "glsa_secret_2b3226ac" | ||
cluster = "Sandbox" | ||
|
||
[spikes] | ||
dashboard = "84357279284502" | ||
panel = 23 | ||
|
||
[logs] | ||
dashboard = "84357279284503" | ||
panel = 24 | ||
|
||
[cpu] | ||
dashboard = "84357279284504" | ||
panel = 25 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package st2 | ||
|
||
import ( | ||
"github.com/pelletier/go-toml/v2" | ||
) | ||
|
||
type TomlUnmarshalTagFormat struct{} | ||
|
||
func (t TomlUnmarshalTagFormat) Unmarshal(data []byte, v any) error { | ||
return toml.Unmarshal(data, v) | ||
} | ||
|
||
func (t TomlUnmarshalTagFormat) TagFormat() string { | ||
return `toml:"%s"` | ||
} | ||
|
||
func NewTomlParser(ctx Context) *StructuredParser { | ||
return NewStructuredParser(ctx, &TomlUnmarshalTagFormat{}) | ||
} |