...

Source file src/github.com/jackc/pgtype/generic_binary.go

Documentation: github.com/jackc/pgtype

     1  package pgtype
     2  
     3  import (
     4  	"database/sql/driver"
     5  )
     6  
     7  // GenericBinary is a placeholder for binary format values that no other type exists
     8  // to handle.
     9  type GenericBinary Bytea
    10  
    11  func (dst *GenericBinary) Set(src interface{}) error {
    12  	return (*Bytea)(dst).Set(src)
    13  }
    14  
    15  func (dst GenericBinary) Get() interface{} {
    16  	return (Bytea)(dst).Get()
    17  }
    18  
    19  func (src *GenericBinary) AssignTo(dst interface{}) error {
    20  	return (*Bytea)(src).AssignTo(dst)
    21  }
    22  
    23  func (dst *GenericBinary) DecodeBinary(ci *ConnInfo, src []byte) error {
    24  	return (*Bytea)(dst).DecodeBinary(ci, src)
    25  }
    26  
    27  func (src GenericBinary) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error) {
    28  	return (Bytea)(src).EncodeBinary(ci, buf)
    29  }
    30  
    31  // Scan implements the database/sql Scanner interface.
    32  func (dst *GenericBinary) Scan(src interface{}) error {
    33  	return (*Bytea)(dst).Scan(src)
    34  }
    35  
    36  // Value implements the database/sql/driver Valuer interface.
    37  func (src GenericBinary) Value() (driver.Value, error) {
    38  	return (Bytea)(src).Value()
    39  }
    40  

View as plain text