mirror of
https://github.com/jackc/pgx.git
synced 2025-05-17 13:01:05 +00:00
Because reading a record type requires the decoder to be able to look up oid to type mapping and types such as hstore have types that are not fixed between different PostgreSQL servers it was necessary to restructure the pgtype system so all encoders and decodes take a *ConnInfo that includes oid/name/type information.
36 lines
726 B
Go
36 lines
726 B
Go
package pgtype
|
|
|
|
import (
|
|
"io"
|
|
)
|
|
|
|
type Cidr Inet
|
|
|
|
func (dst *Cidr) Set(src interface{}) error {
|
|
return (*Inet)(dst).Set(src)
|
|
}
|
|
|
|
func (dst *Cidr) Get() interface{} {
|
|
return (*Inet)(dst).Get()
|
|
}
|
|
|
|
func (src *Cidr) AssignTo(dst interface{}) error {
|
|
return (*Inet)(src).AssignTo(dst)
|
|
}
|
|
|
|
func (dst *Cidr) DecodeText(ci *ConnInfo, src []byte) error {
|
|
return (*Inet)(dst).DecodeText(ci, src)
|
|
}
|
|
|
|
func (dst *Cidr) DecodeBinary(ci *ConnInfo, src []byte) error {
|
|
return (*Inet)(dst).DecodeBinary(ci, src)
|
|
}
|
|
|
|
func (src Cidr) EncodeText(ci *ConnInfo, w io.Writer) (bool, error) {
|
|
return (Inet)(src).EncodeText(ci, w)
|
|
}
|
|
|
|
func (src Cidr) EncodeBinary(ci *ConnInfo, w io.Writer) (bool, error) {
|
|
return (Inet)(src).EncodeBinary(ci, w)
|
|
}
|