53 lines
1.3 KiB
Go
53 lines
1.3 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.19.0
|
|
|
|
package ntpdb
|
|
|
|
import (
|
|
"database/sql/driver"
|
|
"fmt"
|
|
)
|
|
|
|
type ZoneServerCountsIpVersion string
|
|
|
|
const (
|
|
ZoneServerCountsIpVersionV4 ZoneServerCountsIpVersion = "v4"
|
|
ZoneServerCountsIpVersionV6 ZoneServerCountsIpVersion = "v6"
|
|
)
|
|
|
|
func (e *ZoneServerCountsIpVersion) Scan(src interface{}) error {
|
|
switch s := src.(type) {
|
|
case []byte:
|
|
*e = ZoneServerCountsIpVersion(s)
|
|
case string:
|
|
*e = ZoneServerCountsIpVersion(s)
|
|
default:
|
|
return fmt.Errorf("unsupported scan type for ZoneServerCountsIpVersion: %T", src)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type NullZoneServerCountsIpVersion struct {
|
|
ZoneServerCountsIpVersion ZoneServerCountsIpVersion `json:"zone_server_counts_ip_version"`
|
|
Valid bool `json:"valid"` // Valid is true if ZoneServerCountsIpVersion is not NULL
|
|
}
|
|
|
|
// Scan implements the Scanner interface.
|
|
func (ns *NullZoneServerCountsIpVersion) Scan(value interface{}) error {
|
|
if value == nil {
|
|
ns.ZoneServerCountsIpVersion, ns.Valid = "", false
|
|
return nil
|
|
}
|
|
ns.Valid = true
|
|
return ns.ZoneServerCountsIpVersion.Scan(value)
|
|
}
|
|
|
|
// Value implements the driver Valuer interface.
|
|
func (ns NullZoneServerCountsIpVersion) Value() (driver.Value, error) {
|
|
if !ns.Valid {
|
|
return nil, nil
|
|
}
|
|
return string(ns.ZoneServerCountsIpVersion), nil
|
|
}
|