-
Notifications
You must be signed in to change notification settings - Fork 11
/
configuration.go
44 lines (31 loc) · 1.73 KB
/
configuration.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
32
33
34
35
36
37
38
39
40
41
42
43
44
package internal
import (
s2hv1 "github.com/agoda-com/samsahai/api/v1"
)
type ConfigController interface {
// Get returns configuration from memory
Get(configName string) (*s2hv1.Config, error)
// GetComponents returns all components from `Configuration` that has valid `Source`
GetComponents(configName string) (map[string]*s2hv1.Component, error)
// GetParentComponents returns components that doesn't have parent (nil Parent)
GetParentComponents(configName string) (map[string]*s2hv1.Component, error)
// GetPullRequestComponents returns all pull request components of a given bundle name
// with or without dependencies from `Configuration` that has valid `Source`
GetPullRequestComponents(configName, prBundleName string, depIncluded bool) (map[string]*s2hv1.Component, error)
// GetBundles returns a group of components for each bundle
GetBundles(configName string) (s2hv1.ConfigBundles, error)
// GetPriorityQueues returns a list of priority queues which defined in Config
GetPriorityQueues(configName string) ([]string, error)
// GetStagingConfig returns a configuration of staging
GetStagingConfig(configName string) (*s2hv1.ConfigStaging, error)
// GetPullRequestConfig returns a configuration of pull request
GetPullRequestConfig(configName string) (*s2hv1.ConfigPullRequest, error)
// GetPullRequestBundleDependencies returns dependencies list of a pull request bundle from configuration
GetPullRequestBundleDependencies(configName, prBundleName string) ([]string, error)
// Update updates Config CRD
Update(config *s2hv1.Config) error
// Delete deletes Config CRD
Delete(configName string) error
//EnsureConfigTemplateChanged updates config if template changed
EnsureConfigTemplateChanged(config *s2hv1.Config) error
}