-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.go
30 lines (25 loc) · 859 Bytes
/
config.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
package source
import (
"github.com/alexfalkowski/konfig/source/configurator/folder"
"github.com/alexfalkowski/konfig/source/configurator/git"
"github.com/alexfalkowski/konfig/source/configurator/s3"
)
// Config for source.
type Config struct {
Git *git.Config `yaml:"git,omitempty" json:"git,omitempty" toml:"git,omitempty"`
Folder *folder.Config `yaml:"folder,omitempty" json:"folder,omitempty" toml:"folder,omitempty"`
S3 *s3.Config `yaml:"s3,omitempty" json:"s3,omitempty" toml:"s3,omitempty"`
Kind string `yaml:"kind,omitempty" json:"kind,omitempty" toml:"kind,omitempty"`
}
// IsGit configured.
func (c *Config) IsGit() bool {
return c.Kind == "git"
}
// IsFolder configured.
func (c *Config) IsFolder() bool {
return c.Kind == "folder"
}
// IsS3 configured.
func (c *Config) IsS3() bool {
return c.Kind == "s3"
}