func (s DomainState) ToEntry() preloadlist.Entry {
	mode := preloadlist.ForceHTTPS
	if s.Status != StatusPreloaded {
		mode = ""
	}
	return preloadlist.Entry{Name: s.Name, Mode: mode, IncludeSubDomains: s.IncludeSubDomains}
}
ToEntry converts a DomainState to a preloadlist.Entry.

Only the name, preload status and include subdomains boolean is preserved during the conversion.
package database
import (
	"fmt"
	"github.com/chromium/hstspreload/chromium/preloadlist"
	"time"
)
type PreloadStatus string
const (
	StatusUnknown        = "unknown"
	StatusPending        = "pending"
	StatusPreloaded      = "preloaded"
	StatusRejected       = "rejected"
	StatusRemoved        = "removed"
	StatusPendingRemoval = "pending-removal"
)
type DomainState struct {
	Name string `datastore:"-" json:"name"`
	Status PreloadStatus `json:"status"`
	Message string `datastore:",noindex" json:"message,omitempty"`
	SubmissionDate time.Time `json:"-"`
	IncludeSubDomains bool `json:"-"`
}
func (s DomainState) MatchesWanted(wanted DomainState) bool {
	if wanted.Name != s.Name {
		return false
	}
	if wanted.Status != s.Status {
		return false
	}
	if wanted.Message != "" && wanted.Message != s.Message {
		return false
	}
	return true
}
func (s DomainState) Equal(s2 DomainState) bool {
	return s.Name == s2.Name && s.Status == s2.Status &&
		s.Message == s2.Message &&
		s.SubmissionDate.Equal(s2.SubmissionDate) &&
		s.IncludeSubDomains == s2.IncludeSubDomains
}