pg: github.com/go-pg/pg/internal Index | Files | Directories

package internal

import "github.com/go-pg/pg/internal"

Index

Package Files

buf_reader.go bytes_reader.go error.go internal.go log.go reader.go strconv.go underscore.go unsafe.go util.go

Variables

var ErrMultiRows = Errorf("pg: multiple rows in result set")
var ErrNoRows = Errorf("pg: no rows in result set")
var Logger = log.New(os.Stderr, "pg: ", log.LstdFlags|log.Lshortfile)

func AssertOneRow Uses

func AssertOneRow(l int) error

func Atoi Uses

func Atoi(b []byte) (int, error)

func BytesToString Uses

func BytesToString(b []byte) string

BytesToString converts byte slice to string.

func CamelCased Uses

func CamelCased(s string) string

func IsLower Uses

func IsLower(c byte) bool

func IsUpper Uses

func IsUpper(c byte) bool

func MakeSliceNextElemFunc Uses

func MakeSliceNextElemFunc(v reflect.Value) func() reflect.Value

func ParseFloat Uses

func ParseFloat(b []byte, bitSize int) (float64, error)

func ParseInt Uses

func ParseInt(b []byte, base int, bitSize int) (int64, error)

func ParseUint Uses

func ParseUint(b []byte, base int, bitSize int) (uint64, error)

func QuoteTableName Uses

func QuoteTableName(s string) string

func RetryBackoff Uses

func RetryBackoff(retry int, minBackoff, maxBackoff time.Duration) time.Duration

Retry backoff with jitter sleep to prevent overloaded conditions during intervals https://www.awsarchitectureblog.com/2015/03/backoff.html

func Sleep Uses

func Sleep(ctx context.Context, dur time.Duration) error

func StringToBytes Uses

func StringToBytes(s string) []byte

StringToBytes converts string to byte slice.

func ToExported Uses

func ToExported(s string) string

func ToLower Uses

func ToLower(c byte) byte

func ToUpper Uses

func ToUpper(c byte) byte

func Underscore Uses

func Underscore(s string) string

Underscore converts "CamelCasedString" to "camel_cased_string".

func Unwrap Uses

func Unwrap(err error) error

func UpperString Uses

func UpperString(s string) string

type BufReader Uses

type BufReader struct {
    Columns [][]byte
    // contains filtered or unexported fields
}

func NewBufReader Uses

func NewBufReader(rd io.Reader) *BufReader

func (*BufReader) Available Uses

func (b *BufReader) Available() int

func (*BufReader) Buffered Uses

func (b *BufReader) Buffered() int

Buffered returns the number of bytes that can be read from the current buffer.

func (*BufReader) Bytes Uses

func (b *BufReader) Bytes() []byte

func (*BufReader) BytesReader Uses

func (b *BufReader) BytesReader(n int) *BytesReader

func (*BufReader) Discard Uses

func (b *BufReader) Discard(n int) (discarded int, err error)

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) Read Uses

func (b *BufReader) Read(p []byte) (n int, err error)

func (*BufReader) ReadByte Uses

func (b *BufReader) ReadByte() (byte, error)

func (*BufReader) ReadBytes Uses

func (b *BufReader) ReadBytes(fn func(byte) bool) (line []byte, err error)

func (*BufReader) ReadFull Uses

func (b *BufReader) ReadFull() ([]byte, error)

func (*BufReader) ReadFullTemp Uses

func (b *BufReader) ReadFullTemp() ([]byte, error)

func (*BufReader) ReadN Uses

func (b *BufReader) ReadN(n int) (line []byte, err error)

func (*BufReader) ReadSlice Uses

func (b *BufReader) ReadSlice(delim byte) (line []byte, err error)

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) Reset Uses

func (b *BufReader) Reset(rd io.Reader)

func (*BufReader) SetAvailable Uses

func (b *BufReader) SetAvailable(n int)

func (*BufReader) UnreadByte Uses

func (b *BufReader) UnreadByte() error

type BytesReader Uses

type BytesReader struct {
    // contains filtered or unexported fields
}

func NewBytesReader Uses

func NewBytesReader(b []byte) *BytesReader

func (*BytesReader) Buffered Uses

func (r *BytesReader) Buffered() int

func (*BytesReader) Bytes Uses

func (r *BytesReader) Bytes() []byte

func (*BytesReader) Discard Uses

func (r *BytesReader) Discard(n int) (int, error)

func (*BytesReader) Read Uses

func (r *BytesReader) Read(b []byte) (n int, err error)

func (*BytesReader) ReadByte Uses

func (r *BytesReader) ReadByte() (byte, error)

func (*BytesReader) ReadBytes Uses

func (r *BytesReader) ReadBytes(fn func(byte) bool) ([]byte, error)

func (*BytesReader) ReadFull Uses

func (r *BytesReader) ReadFull() ([]byte, error)

func (*BytesReader) ReadFullTemp Uses

func (r *BytesReader) ReadFullTemp() ([]byte, error)

func (*BytesReader) ReadN Uses

func (r *BytesReader) ReadN(n int) ([]byte, error)

func (*BytesReader) ReadSlice Uses

func (r *BytesReader) ReadSlice(delim byte) ([]byte, error)

func (*BytesReader) Reset Uses

func (r *BytesReader) Reset(b []byte)

func (*BytesReader) UnreadByte Uses

func (r *BytesReader) UnreadByte() error

type Error Uses

type Error struct {
    // contains filtered or unexported fields
}

func Errorf Uses

func Errorf(s string, args ...interface{}) Error

func (Error) Error Uses

func (err Error) Error() string

type PGError Uses

type PGError struct {
    // contains filtered or unexported fields
}

func NewPGError Uses

func NewPGError(m map[byte]string) PGError

func (PGError) Error Uses

func (err PGError) Error() string

func (PGError) Field Uses

func (err PGError) Field(k byte) string

func (PGError) IntegrityViolation Uses

func (err PGError) IntegrityViolation() bool

type Reader Uses

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)
}

Directories

PathSynopsis
iszero
parser
pool
structfilter

Package internal imports 14 packages (graph) and is imported by 54 packages. Updated 2019-09-23. Refresh now. Tools for package owners.