utils

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(s []string, e string) bool

Contains is a helper function to check if a string exists in a slice of strings.

func HumanizeDuration

func HumanizeDuration(d time.Duration) string

HumanizeDuration converts a time.Duration into something readable. Taken from: https://gist.github.com/harshavardhana/327e0577c4fed9211f65

Example:

HumanizeDuration(time.Duration())

func ParseChainHash

func ParseChainHash(hash string) (*chainhash.Hash, error)

func ParseRFC3339Timestamp

func ParseRFC3339Timestamp(timestamp string) (*int64, error)

ParseRFC3339Timestamp converts a timestamp in RFC3339 format to a UNIX timestamp in seconds.

It is the reverse of ParseUnixTimestamp

func ParseSatoshi

func ParseSatoshi(value float64) btcutil.Amount

ParseSatoshi converts a float64 bitcoin value to satoshis. Named after ParseInt function.

func ParseUnixTimestamp

func ParseUnixTimestamp(timestamp int64) string

ParseUnixTimestamp converts a UNIX timestamp in seconds, and returns a string representing of the timestamp in RFC3339 format.

func ToStringPointer

func ToStringPointer(value string) *string

Types

This section is empty.

Jump to

Keyboard shortcuts

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