forked from evergreen-ci/evergreen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig_fws.go
More file actions
36 lines (28 loc) · 782 Bytes
/
config_fws.go
File metadata and controls
36 lines (28 loc) · 782 Bytes
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
32
33
34
35
36
package evergreen
import (
"context"
"github.com/mongodb/anser/bsonutil"
"github.com/pkg/errors"
"go.mongodb.org/mongo-driver/bson"
)
// FWSConfig represents the configuration of the foliage web service client.
type FWSConfig struct {
URL string `bson:"url" json:"url" yaml:"url"`
}
var (
fwsURLKey = bsonutil.MustHaveTag(FWSConfig{}, "URL")
)
func (c *FWSConfig) SectionId() string { return "fws" }
func (c *FWSConfig) Get(ctx context.Context) error {
return getConfigSection(ctx, c)
}
func (c *FWSConfig) Set(ctx context.Context) error {
return errors.Wrapf(setConfigSection(ctx, c.SectionId(), bson.M{
"$set": bson.M{
fwsURLKey: c.URL,
}}), "updating config section '%s'", c.SectionId(),
)
}
func (c *FWSConfig) ValidateAndDefault() error {
return nil
}