Documentation ¶
Index ¶
- Variables
- func AssertOneRow(l int) error
- func Atoi(b []byte) (int, error)
- func BytesToString(b []byte) string
- func CamelCased(s string) string
- func IsLower(c byte) bool
- func IsUpper(c byte) bool
- func Logf(s string, args ...interface{})
- func MakeSliceNextElemFunc(v reflect.Value) func() reflect.Value
- func ParseFloat(b []byte, bitSize int) (float64, error)
- func ParseInt(b []byte, base int, bitSize int) (int64, error)
- func ParseUint(b []byte, base int, bitSize int) (uint64, error)
- func QuoteTableName(s string) string
- func RetryBackoff(retry int, minBackoff, maxBackoff time.Duration) time.Duration
- func StringToBytes(s string) []byte
- func ToExported(s string) string
- func ToLower(c byte) byte
- func ToUpper(c byte) byte
- func Underscore(s string) string
- func UpperString(s string) string
- type BufReader
- func (b *BufReader) Available() int
- func (b *BufReader) Buffered() int
- func (b *BufReader) Bytes() []byte
- func (b *BufReader) BytesReader(n int) *BytesReader
- func (b *BufReader) Discard(n int) (discarded int, err error)
- func (b *BufReader) Read(p []byte) (n int, err error)
- func (b *BufReader) ReadByte() (byte, error)
- func (b *BufReader) ReadBytes(fn func(byte) bool) (line []byte, err error)
- func (b *BufReader) ReadFull() ([]byte, error)
- func (b *BufReader) ReadFullTemp() ([]byte, error)
- func (b *BufReader) ReadN(n int) (line []byte, err error)
- func (b *BufReader) ReadSlice(delim byte) (line []byte, err error)
- func (b *BufReader) Reset(rd io.Reader)
- func (b *BufReader) SetAvailable(n int)
- func (b *BufReader) UnreadByte() error
- type BytesReader
- func (r *BytesReader) Buffered() int
- func (r *BytesReader) Bytes() []byte
- func (r *BytesReader) Discard(n int) (int, error)
- func (r *BytesReader) Read(b []byte) (n int, err error)
- func (r *BytesReader) ReadByte() (byte, error)
- func (r *BytesReader) ReadBytes(fn func(byte) bool) ([]byte, error)
- func (r *BytesReader) ReadFull() ([]byte, error)
- func (r *BytesReader) ReadFullTemp() ([]byte, error)
- func (r *BytesReader) ReadN(n int) ([]byte, error)
- func (r *BytesReader) ReadSlice(delim byte) ([]byte, error)
- func (r *BytesReader) Reset(b []byte)
- func (r *BytesReader) UnreadByte() error
- type Error
- type PGError
- type Reader
Constants ¶
This section is empty.
Variables ¶
var ErrMultiRows = Errorf("pg: multiple rows in result set")
var ErrNoRows = Errorf("pg: no rows in result set")
var Logger *log.Logger
Functions ¶
func AssertOneRow ¶
func BytesToString ¶
BytesToString converts byte slice to string.
func CamelCased ¶
func QuoteTableName ¶
func RetryBackoff ¶
Retry backoff with jitter sleep to prevent overloaded conditions during intervals https://www.awsarchitectureblog.com/2015/03/backoff.html
func StringToBytes ¶
StringToBytes converts string to byte slice.
func ToExported ¶
func Underscore ¶
Underscore converts "CamelCasedString" to "camel_cased_string".
func UpperString ¶
Types ¶
type BufReader ¶
type BufReader struct { Columns [][]byte // contains filtered or unexported fields }
func NewBufReader ¶
func (*BufReader) Buffered ¶
Buffered returns the number of bytes that can be read from the current buffer.
func (*BufReader) BytesReader ¶
func (b *BufReader) BytesReader(n int) *BytesReader
func (*BufReader) Discard ¶
Discard skips the next n bytes, returning the number of bytes discarded.
If Discard skips fewer than n bytes, it also returns an error. If 0 <= n <= b.Buffered(), Discard is guaranteed to succeed without reading from the underlying io.BufReader.
func (*BufReader) ReadFullTemp ¶
func (*BufReader) ReadSlice ¶
ReadSlice reads until the first occurrence of delim in the input, returning a slice pointing at the bytes in the buffer. The bytes stop being valid at the next read. If ReadSlice encounters an error before finding a delimiter, it returns all the data in the buffer and the error itself (often io.EOF). ReadSlice fails with error ErrBufferFull if the buffer fills without a delim. Because the data returned from ReadSlice will be overwritten by the next I/O operation, most clients should use ReadBytes or ReadString instead. ReadSlice returns err != nil if and only if line does not end in delim.
func (*BufReader) SetAvailable ¶
func (*BufReader) UnreadByte ¶
type BytesReader ¶
type BytesReader struct {
// contains filtered or unexported fields
}
func NewBytesReader ¶
func NewBytesReader(b []byte) *BytesReader
func (*BytesReader) Buffered ¶
func (r *BytesReader) Buffered() int
func (*BytesReader) Bytes ¶
func (r *BytesReader) Bytes() []byte
func (*BytesReader) ReadByte ¶
func (r *BytesReader) ReadByte() (byte, error)
func (*BytesReader) ReadFull ¶
func (r *BytesReader) ReadFull() ([]byte, error)
func (*BytesReader) ReadFullTemp ¶
func (r *BytesReader) ReadFullTemp() ([]byte, error)
func (*BytesReader) Reset ¶
func (r *BytesReader) Reset(b []byte)
func (*BytesReader) UnreadByte ¶
func (r *BytesReader) UnreadByte() error
type PGError ¶
type PGError struct {
// contains filtered or unexported fields
}
func NewPGError ¶
func (PGError) IntegrityViolation ¶
type Reader ¶
type Reader interface { Buffered() int Bytes() []byte Read([]byte) (int, error) ReadByte() (byte, error) UnreadByte() error ReadSlice(byte) ([]byte, error) Discard(int) (int, error) //ReadBytes(fn func(byte) bool) ([]byte, error) //ReadN(int) ([]byte, error) ReadFull() ([]byte, error) ReadFullTemp() ([]byte, error) }