package
0.18.4-beta.rc2
Repository: https://github.com/lightningnetwork/lnd.git
Documentation: pkg.go.dev
# README
lnutils
This package provides fundamental types and utility functions that can be used by all other packages.
# Functions
ByteSlice takes a byte array, and returns a slice.
ErrorAs behaves the same as `errors.As` except there's no need to declare the target error as a variable first.
Map takes an input slice, and applies the function f to each element, yielding a new slice.
NewLogClosure returns a new closure over a function that returns a string which itself provides a Stringer interface so that it can be used with the logging system.
Ptr returns the pointer of the given value.
RecvOrTimeout attempts to recv over chan c, returning the value.
SpewLogClosure takes an interface and returns the string of it created from `spew.Sdump` in a LogClosure.
# Structs
SyncMap wraps a sync.Map with type parameters such that it's easier to access the items stored in the map since no type assertion is needed.
# Interfaces
ByteArray is a type constraint for type that reduces down to a fixed sized array.
# Type aliases
LogClosure is used to provide a closure over expensive logging operations so don't have to be performed when the logging level doesn't warrant it.