Certificate Authority work

This commit is contained in:
Jamie Curnow
2021-07-29 17:45:14 +10:00
parent ae00ab09e4
commit 339ee13346
35 changed files with 737 additions and 136 deletions

View File

@@ -56,3 +56,16 @@ func (j *JSONB) UnmarshalJSON(data []byte) error {
func (j JSONB) MarshalJSON() ([]byte, error) {
return json.Marshal(j.Decoded)
}
// AsStringArray will attempt to return as []string
func (j JSONB) AsStringArray() ([]string, error) {
var strs []string
// Encode then Decode onto this type
b, _ := j.MarshalJSON()
if err := json.Unmarshal(b, &strs); err != nil {
return strs, err
}
return strs, nil
}