Define base Compose resources supported by envoy

* ComposeNamespace,
* ComposeModule (+ fields),
* ComposeRecord (+ values),
* RBAC permissions.
This commit is contained in:
Tomaž Jerman
2020-11-27 11:19:15 +01:00
parent e7d1dbb357
commit d076dbd70f
9 changed files with 485 additions and 1 deletions
+15 -1
View File
@@ -4,8 +4,9 @@ import (
"database/sql/driver"
"encoding/json"
"fmt"
"github.com/pkg/errors"
"strconv"
"github.com/pkg/errors"
)
type (
@@ -91,6 +92,19 @@ func (opt ModuleFieldOptions) Strings(key string) []string {
return nil
}
// String returns option value for key as single string
//
// Invalid, non-existing are returned as empty string ("")
func (opt ModuleFieldOptions) String(key string) string {
if _, has := opt[key]; has {
if v, ok := opt[key].(string); ok {
return v
}
}
return ""
}
// IsUnique - should value in this field be unique across records?
func (opt ModuleFieldOptions) IsUnique() bool {
return opt.Bool(moduleFieldOptionIsUnique)