utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAddr

func GetAddr(port int) string

func GetConfigPath

func GetConfigPath(envVar, defaultValue string) string

func ReadOffset

func ReadOffset(r FileStorage) (uint64, error)

func ReadRsa

func ReadRsa(base64Rsa string) (*rsa.PrivateKey, error)

func ReadWIF

func ReadWIF(filename string) string

func Retry

func Retry(f func() error, n int, retryDelay time.Duration) error

func RetryWithTimeout

func RetryWithTimeout(f func() error, n int, timeout time.Duration, retryDelay time.Duration) error

func RsaSign

func RsaSign(digest eos.Checksum256, key *rsa.PrivateKey) (string, error)

func WithTimeout

func WithTimeout(f func() error, timeout time.Duration) error

func WriteOffset

func WriteOffset(w FileStorage, offset uint64) error

Types

type FileStorage

type FileStorage interface {
	Read(p []byte) (n int, err error)
	Write(b []byte) (n int, err error)
	Truncate(size int64) error
	Seek(offset int64, whence int) (ret int64, err error)
}

Jump to

Keyboard shortcuts

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