custom

package
v0.27.8 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const MaxInt = int64(int(^uint(0) >> 1))

MaxInt is the maximum value an int can contain.

Variables

View Source
var ZeroIsAlmostZero bool

Functions

func AsFloat64

func AsFloat64(v interface{}) float64

func AsInt32

func AsInt32(v interface{}) int32

func AsInt64

func AsInt64(v interface{}) int64

func AsString

func AsString(v interface{}) string

func AsTime

func AsTime(v interface{}) time.Time

func AsTimestamp added in v0.20.0

func AsTimestamp(v interface{}) *timestamppb.Timestamp

func AsUint64 added in v0.20.1

func AsUint64(v interface{}) uint64

func Mmap added in v0.18.0

func Mmap(f *os.File) ([]byte, error)

Mmap the file for read, return the bytes and the error. Will read the data directly if Mmap fails.

func MmapFile added in v0.18.0

func MmapFile(fn string) ([]byte, error)

MmapFile returns the mmap of the given path.

func NumbersFromStrings

func NumbersFromStrings(s *[]string) *[]godror.Number

func ParseTime added in v0.5.1

func ParseTime(t *time.Time, s string) error

func ReadAll added in v0.18.0

func ReadAll(r io.Reader, threshold int) ([]byte, error)

ReadAll reads the reader and returns the byte slice.

If the read length is below the threshold, then the bytes are read into memory; otherwise, a temp file is created, and mmap-ed.

func ReadAllString added in v0.18.0

func ReadAllString(r io.Reader, threshold int) (string, error)

ReadAllString is like ReadAll, but returns a string.

Types

type DateTime added in v0.6.0

type DateTime struct {
	time.Time
}

func AsDate

func AsDate(v interface{}) *DateTime

func (*DateTime) AppendFormat added in v0.19.3

func (dt *DateTime) AppendFormat(b []byte, layout string) []byte

func (*DateTime) Format added in v0.19.3

func (dt *DateTime) Format(layout string) string

func (*DateTime) IsZero added in v0.15.7

func (dt *DateTime) IsZero() (zero bool)

func (*DateTime) Marshal added in v0.6.0

func (dt *DateTime) Marshal() (dAtA []byte, err error)

func (*DateTime) MarshalJSON added in v0.7.3

func (dt *DateTime) MarshalJSON() ([]byte, error)

nosemgrep: dgryski.semgrep-go.marshaljson.marshal-json-pointer-receiver

func (*DateTime) MarshalText added in v0.7.3

func (dt *DateTime) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface. The time is formatted in RFC 3339 format, with sub-second precision added if present.

func (*DateTime) MarshalTo added in v0.6.0

func (dt *DateTime) MarshalTo(dAtA []byte) (int, error)

func (*DateTime) MarshalXML added in v0.6.0

func (dt *DateTime) MarshalXML(enc *xml.Encoder, start xml.StartElement) error

func (*DateTime) ProtoMessage added in v0.6.0

func (dt *DateTime) ProtoMessage()

func (*DateTime) ProtoReflect added in v0.20.0

func (dt *DateTime) ProtoReflect() protoreflect.Message

func (*DateTime) ProtoSize added in v0.6.0

func (dt *DateTime) ProtoSize() (n int)

func (*DateTime) Reset added in v0.6.0

func (dt *DateTime) Reset()

func (*DateTime) Scan added in v0.19.4

func (dt *DateTime) Scan(src interface{}) error

func (*DateTime) Size added in v0.6.0

func (dt *DateTime) Size() (n int)

func (*DateTime) String added in v0.6.0

func (dt *DateTime) String() string

func (*DateTime) Timestamp added in v0.6.0

func (dt *DateTime) Timestamp() *timestamppb.Timestamp

func (*DateTime) Unmarshal added in v0.6.0

func (dt *DateTime) Unmarshal(dAtA []byte) error

func (*DateTime) UnmarshalJSON added in v0.7.3

func (dt *DateTime) UnmarshalJSON(data []byte) error

func (*DateTime) UnmarshalText added in v0.7.3

func (dt *DateTime) UnmarshalText(data []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface. The time is expected to be in RFC 3339 format.

func (*DateTime) UnmarshalXML added in v0.6.0

func (dt *DateTime) UnmarshalXML(dec *xml.Decoder, st xml.StartElement) error

func (*DateTime) Value added in v0.19.4

func (dt *DateTime) Value() (driver.Value, error)

type Lob

type Lob struct {
	*godror.Lob
	// contains filtered or unexported fields
}

func (*Lob) Marshal

func (L *Lob) Marshal() ([]byte, error)

func (*Lob) MarshalTo

func (L *Lob) MarshalTo(p []byte) (int, error)

func (*Lob) Scan

func (L *Lob) Scan(src interface{}) error

Scan assigns a value from a database driver.

func (*Lob) Size

func (L *Lob) Size() int

func (*Lob) Unmarshal

func (L *Lob) Unmarshal(p []byte) error

func (*Lob) Value

func (L *Lob) Value() (driver.Value, error)

Value returns a driver Value.

type Number

type Number godror.Number

func (Number) Get

func (n Number) Get() godror.Number

func (*Number) Scan

func (n *Number) Scan(src interface{}) error

Scan assigns a value from a database driver.

func (*Number) Set

func (n *Number) Set(num godror.Number)

func (Number) Value

func (n Number) Value() (driver.Value, error)

Value returns a driver Value.

type SQLExecer added in v0.14.1

type SQLExecer interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
}

Jump to

Keyboard shortcuts

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