This commit is contained in:
@@ -142,6 +142,49 @@ func (ns NullMonitorsType) Value() (driver.Value, error) {
|
||||
return string(ns.MonitorsType), nil
|
||||
}
|
||||
|
||||
type ServerScoresStatus string
|
||||
|
||||
const (
|
||||
ServerScoresStatusNew ServerScoresStatus = "new"
|
||||
ServerScoresStatusTesting ServerScoresStatus = "testing"
|
||||
ServerScoresStatusActive ServerScoresStatus = "active"
|
||||
)
|
||||
|
||||
func (e *ServerScoresStatus) Scan(src interface{}) error {
|
||||
switch s := src.(type) {
|
||||
case []byte:
|
||||
*e = ServerScoresStatus(s)
|
||||
case string:
|
||||
*e = ServerScoresStatus(s)
|
||||
default:
|
||||
return fmt.Errorf("unsupported scan type for ServerScoresStatus: %T", src)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type NullServerScoresStatus struct {
|
||||
ServerScoresStatus ServerScoresStatus `json:"server_scores_status"`
|
||||
Valid bool `json:"valid"` // Valid is true if ServerScoresStatus is not NULL
|
||||
}
|
||||
|
||||
// Scan implements the Scanner interface.
|
||||
func (ns *NullServerScoresStatus) Scan(value interface{}) error {
|
||||
if value == nil {
|
||||
ns.ServerScoresStatus, ns.Valid = "", false
|
||||
return nil
|
||||
}
|
||||
ns.Valid = true
|
||||
return ns.ServerScoresStatus.Scan(value)
|
||||
}
|
||||
|
||||
// Value implements the driver Valuer interface.
|
||||
func (ns NullServerScoresStatus) Value() (driver.Value, error) {
|
||||
if !ns.Valid {
|
||||
return nil, nil
|
||||
}
|
||||
return string(ns.ServerScoresStatus), nil
|
||||
}
|
||||
|
||||
type ServersIpVersion string
|
||||
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user