forked from evergreen-ci/evergreen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_splunk.go
31 lines (24 loc) · 849 Bytes
/
config_splunk.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package evergreen
import (
"context"
"github.com/mongodb/grip/send"
"github.com/pkg/errors"
"go.mongodb.org/mongo-driver/bson"
)
type SplunkConfig struct {
SplunkConnectionInfo send.SplunkConnectionInfo `bson:",inline" json:"splunk_connection_info" yaml:"splunk_connection_info"`
}
func (c *SplunkConfig) SectionId() string { return "splunk" }
func (c *SplunkConfig) Get(ctx context.Context) error {
return getConfigSection(ctx, c)
}
func (c *SplunkConfig) Set(ctx context.Context) error {
return errors.Wrapf(setConfigSection(ctx, c.SectionId(), bson.M{
"$set": bson.M{
"url": c.SplunkConnectionInfo.ServerURL,
"token": c.SplunkConnectionInfo.Token,
"channel": c.SplunkConnectionInfo.Channel,
}}), "updating config section '%s'", c.SectionId(),
)
}
func (c *SplunkConfig) ValidateAndDefault() error { return nil }