utils

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress

func Compress(src io.Reader, dst io.Writer) error

func Decompress

func Decompress(src io.Reader, dst io.Writer) error

func Elapsed

func Elapsed(now time.Time, logger logger.Logger, msg string)

func Hash

func Hash(s string) uint64

func LCP

func LCP(a, b string) int

LCP length of Longest Common Prefix

func Magic

func Magic(input string) uint64

func Pow

func Pow(x, n int) int

func TMarshal

func TMarshal(data thrift.TStruct) ([]byte, error)

func TUnmarshal

func TUnmarshal(data []byte, v thrift.TStruct) error

Types

type ErrorReader

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

func NewErrorReader

func NewErrorReader(r io.Reader) *ErrorReader

func (*ErrorReader) Error

func (r *ErrorReader) Error() error

func (*ErrorReader) Read

func (r *ErrorReader) Read(order binary.ByteOrder, data any)

type ErrorWriter

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

func NewErrorWriter

func NewErrorWriter(buf *bytes.Buffer) *ErrorWriter

func (*ErrorWriter) Error

func (w *ErrorWriter) Error() error

func (*ErrorWriter) Write

func (w *ErrorWriter) Write(order binary.ByteOrder, data any)

Jump to

Keyboard shortcuts

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