Now that all interaciton with the koji API happens in the workers we can drop koji configuration from composer itself. This means that composer no longer needs to be provisioned with kerberos credentials, and does not need to know about which koji servers the workers support.
31 lines
624 B
Go
31 lines
624 B
Go
package main
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/BurntSushi/toml"
|
|
)
|
|
|
|
type ComposerConfigFile struct {
|
|
Koji struct {
|
|
AllowedDomains []string `toml:"allowed_domains"`
|
|
CA string `toml:"ca"`
|
|
} `toml:"koji"`
|
|
Worker struct {
|
|
AllowedDomains []string `toml:"allowed_domains"`
|
|
CA string `toml:"ca"`
|
|
} `toml:"worker"`
|
|
}
|
|
|
|
func LoadConfig(name string) (*ComposerConfigFile, error) {
|
|
var c ComposerConfigFile
|
|
_, err := toml.DecodeFile(name, &c)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &c, nil
|
|
}
|
|
|
|
func DumpConfig(c *ComposerConfigFile, w io.Writer) error {
|
|
return toml.NewEncoder(w).Encode(c)
|
|
}
|