internal

package
v10.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2024 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Overview

internal is a private internal package.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRows    = Errorf("pg: no rows in result set")
	ErrMultiRows = Errorf("pg: multiple rows in result set")
)
View Source
var Deprecated = log.New(os.Stderr, "DEPRECATED: pg: ", log.LstdFlags)
View Source
var Warn = log.New(os.Stderr, "WARN: pg: ", log.LstdFlags)

Functions

func AssertOneRow

func AssertOneRow(l int) error

func Atoi

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

func BytesToString

func BytesToString(b []byte) string

BytesToString converts byte slice to string.

func CamelCased

func CamelCased(s string) string

func IsLower

func IsLower(c byte) bool

func IsUpper

func IsUpper(c byte) bool

func MakeSliceNextElemFunc

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

func ParseFloat

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

func ParseInt

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

func ParseUint

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

func RetryBackoff

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

func Sleep

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

func StringToBytes

func StringToBytes(s string) []byte

StringToBytes converts string to byte slice.

func ToExported

func ToExported(s string) string

func ToLower

func ToLower(c byte) byte

func ToUpper

func ToUpper(c byte) byte

func Underscore

func Underscore(s string) string

Underscore converts "CamelCasedString" to "camel_cased_string".

func Unwrap

func Unwrap(err error) error

func UpperString

func UpperString(s string) string

func WithSpan

func WithSpan(
	ctx context.Context,
	name string,
	fn func(context.Context, trace.Span) error,
) error

Types

type Error

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

func Errorf

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

func (Error) Error

func (err Error) Error() string

type Logging

type Logging interface {
	Printf(ctx context.Context, format string, v ...interface{})
}
var Logger Logging = &logger{
	log: log.New(os.Stderr, "redis: ", log.LstdFlags|log.Lshortfile),
}

type PGError

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

func NewPGError

func NewPGError(m map[byte]string) PGError

func (PGError) Error

func (err PGError) Error() string

func (PGError) Field

func (err PGError) Field(k byte) string

func (PGError) IntegrityViolation

func (err PGError) IntegrityViolation() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL