summaryrefslogtreecommitdiff
path: root/internal/types/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/types/server.go')
-rw-r--r--internal/types/server.go28
1 files changed, 13 insertions, 15 deletions
diff --git a/internal/types/server.go b/internal/types/server.go
index a9c46b2..33a6e9c 100644
--- a/internal/types/server.go
+++ b/internal/types/server.go
@@ -17,12 +17,10 @@ type DiscoveryOrganizations struct {
}
type DiscoveryOrganization struct {
- DisplayName map[string]string `json:"display_name"`
- OrgId string `json:"org_id"`
- SecureInternetHome string `json:"secure_internet_home"`
- KeywordList struct {
- En string `json:"en"`
- } `json:"keyword_list"`
+ DisplayName DiscoMapOrString `json:"display_name"`
+ OrgId string `json:"org_id"`
+ SecureInternetHome string `json:"secure_internet_home"`
+ KeywordList DiscoMapOrString `json:"keyword_list"`
}
// Structs that define the json format for
@@ -34,11 +32,11 @@ type DiscoveryServers struct {
RawString string `json:"go_raw_string"`
}
-type DNMapOrString map[string]string
+type DiscoMapOrString map[string]string
// The display name can either be a map or a string in the server list
// Unmarshal it by first trying a string and then the map
-func (DN *DNMapOrString) UnmarshalJSON(data []byte) error {
+func (DN *DiscoMapOrString) UnmarshalJSON(data []byte) error {
var displayNameString string
err := json.Unmarshal(data, &displayNameString)
@@ -60,11 +58,11 @@ func (DN *DNMapOrString) UnmarshalJSON(data []byte) error {
}
type DiscoveryServer struct {
- AuthenticationURLTemplate string `json:"authentication_url_template"`
- BaseURL string `json:"base_url"`
- CountryCode string `json:"country_code"`
- DisplayName DNMapOrString `json:"display_name,omitempty"`
- PublicKeyList []string `json:"public_key_list"`
- Type string `json:"server_type"`
- SupportContact []string `json:"support_contact"`
+ AuthenticationURLTemplate string `json:"authentication_url_template"`
+ BaseURL string `json:"base_url"`
+ CountryCode string `json:"country_code"`
+ DisplayName DiscoMapOrString `json:"display_name,omitempty"`
+ PublicKeyList []string `json:"public_key_list"`
+ Type string `json:"server_type"`
+ SupportContact []string `json:"support_contact"`
}