diff options
author | Aleksander Mistewicz <a.mistewicz@samsung.com> | 2017-10-12 14:54:33 +0200 |
---|---|---|
committer | Maciej Wereski <m.wereski@partner.samsung.com> | 2018-03-05 18:29:20 +0100 |
commit | 5211b87e795e8d24b86e3cb6db1839c94f947160 (patch) | |
tree | 249e9bb4790ad3706901f007d776cbeee3cd1903 /dryad/conf | |
parent | a7b61bbdcda0de7d2b434f1834d205341c9c05ea (diff) | |
download | boruta-5211b87e795e8d24b86e3cb6db1839c94f947160.tar.gz boruta-5211b87e795e8d24b86e3cb6db1839c94f947160.tar.bz2 boruta-5211b87e795e8d24b86e3cb6db1839c94f947160.zip |
Add Caps to dryad configuration
In the future Capabilities will be read from MuxPi's hardware.
Currently write to and read from it is not supported therefore
it has been added to configuration.
Change-Id: Idedc71205bc4eea0fa489fa595daf6c367a1082c
Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
Reviewed-on: https://mcdsrvbld02.digital.local/review/49596
Reviewed-by: Maciej Wereski <m.wereski@partner.samsung.com>
Tested-by: Maciej Wereski <m.wereski@partner.samsung.com>
Diffstat (limited to 'dryad/conf')
-rw-r--r-- | dryad/conf/conf.go | 8 | ||||
-rw-r--r-- | dryad/conf/conf_test.go | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/dryad/conf/conf.go b/dryad/conf/conf.go index c12a226..42675ba 100644 --- a/dryad/conf/conf.go +++ b/dryad/conf/conf.go @@ -23,6 +23,8 @@ import ( "io/ioutil" "github.com/BurntSushi/toml" + + . "git.tizen.org/tools/boruta" ) // DefaultRPCPort is a port that should be used as default parameter @@ -33,6 +35,7 @@ const DefaultRPCPort = 7175 func NewConf() *General { return &General{ Address: fmt.Sprintf(":%d", DefaultRPCPort), + Caps: Capabilities(map[string]string{}), User: &User{ Name: "boruta-user", Groups: []string{}, @@ -56,6 +59,11 @@ type General struct { Address string `toml:"listen_address"` // BorutaAddress is used to connect to Boruta server. BorutaAddress string `toml:"boruta_address"` + // Caps are necessary information to register in Boruta. + // + // TODO(amistewicz): This field should be removed when + // it will be possible to read it from hardware. + Caps Capabilities `toml:"caps"` // User refers information necessary to create the user. User *User `toml:"user"` // SDcard is a base path to block device of sdcard. diff --git a/dryad/conf/conf_test.go b/dryad/conf/conf_test.go index c0b2142..f1f7177 100644 --- a/dryad/conf/conf_test.go +++ b/dryad/conf/conf_test.go @@ -20,6 +20,7 @@ import ( "bytes" "strings" + "git.tizen.org/tools/boruta" . "git.tizen.org/tools/boruta/dryad/conf" . "github.com/onsi/ginkgo" @@ -31,12 +32,15 @@ var _ = Describe("Conf", func() { boruta_address = "" sdcard = "/dev/sdX" +[caps] + [user] name = "boruta-user" groups = [] ` unmarshaled := &General{ Address: ":7175", + Caps: boruta.Capabilities(map[string]string{}), User: &User{ Name: "boruta-user", Groups: []string{}, |