Files
EdgeAPI/internal/db/models/ssl_cert_model_ext.go

32 lines
510 B
Go
Raw Normal View History

2020-09-30 17:46:43 +08:00
package models
2022-03-11 20:27:53 +08:00
import "encoding/json"
func (this *SSLCert) DecodeDNSNames() []string {
if len(this.DnsNames) == 0 {
return nil
}
var result = []string{}
var err = json.Unmarshal([]byte(this.DnsNames), &result)
if err != nil {
return nil
}
return result
}
func (this *SSLCert) DecodeCommonNames() []string {
if len(this.CommonNames) == 0 {
return nil
}
var result = []string{}
var err = json.Unmarshal([]byte(this.CommonNames), &result)
if err != nil {
return nil
}
return result
}