util

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPanicRecovered = errors.New("recovered from panic")
)

Functions

func CloseWithReason

func CloseWithReason(c io.Closer, reason string) error

func Ifelse

func Ifelse(expr bool, then interface{}, or interface{}) interface{}

func IsConnectionFailed

func IsConnectionFailed(err error) bool

func PanicRecovery

func PanicRecovery(from string, err *error)

Types

type Closer

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

func (*Closer) Close

func (c *Closer) Close()

func (*Closer) Init

func (c *Closer) Init()

func (*Closer) IsClosed

func (c *Closer) IsClosed() bool

func (*Closer) Wait

func (c *Closer) Wait()

type Hasher

type Hasher struct {
}

func (*Hasher) Sum64

func (h *Hasher) Sum64(data []byte) uint64

type Int

type Int int

func (*Int) Add

func (i *Int) Add(j int) int

func (*Int) Add1

func (i *Int) Add1() int

func (*Int) Int

func (i *Int) Int() int

func (*Int) Sub

func (i *Int) Sub(j int) int

func (*Int) Sub1

func (i *Int) Sub1() int

type VerboseCloser

type VerboseCloser interface {
	CloseWithReason(reason string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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