misc

package
v0.0.0-...-97b9ebb Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package misc provides useful common functions that can be moved to separated projects later

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidAddr = errors.New("invalid address")

ErrInvalidAddr returned when multiaddr is invalid

Functions

func CloseWithLog

func CloseWithLog(res io.Closer)

CloseWithLog tries to close the resource and log on error it can be used as `defer misc.CloseWithLog(res)`

func MultiAddrToNet

func MultiAddrToNet(src ma.Multiaddr) (net.Addr, error)

MultiAddrToNet converts multiaddr to net.Addr

Types

This section is empty.

Jump to

Keyboard shortcuts

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