mirror of
				https://github.com/TeaOSLab/EdgeAPI.git
				synced 2025-11-04 16:00:24 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			32 lines
		
	
	
		
			510 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			510 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package models
 | 
						|
 | 
						|
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
 | 
						|
}
 |