Private
Public Access
1
0
Files
data-api/ntpdb/models.go
Ask Bjørn Hansen 27c8bc4776
All checks were successful
continuous-integration/drone/push Build is passing
Calculate netspeed points, too
2023-07-16 02:40:50 -07:00

53 lines
1.3 KiB
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.19.1
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
}