util

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: Apache-2.0, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NBitsForKeypairDefault = 2048
)

Variables

This section is empty.

Functions

func GenerateKey added in v1.5.0

func GenerateKey(importKey string, keyType string, seedPhrase string) (string, string, error)

func GeneratePrivKeyUsingBIP39 added in v1.5.0

func GeneratePrivKeyUsingBIP39(mnemonic string) (string, string, error)

func InsideGUI added in v1.5.0

func InsideGUI() bool

func ManageFdLimit

func ManageFdLimit() (changed bool, newLimit uint64, err error)

ManageFdLimit raise the current max file descriptor count of the process based on the IPFS_FD_MAX value

func SetupInterruptHandler

func SetupInterruptHandler(ctx context.Context) (io.Closer, context.Context)

Types

type IntrHandler

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

IntrHandler helps set up an interrupt handler that can be cleanly shut down through the io.Closer interface.

func NewIntrHandler

func NewIntrHandler() *IntrHandler

func (*IntrHandler) Close

func (ih *IntrHandler) Close() error

func (*IntrHandler) Handle

func (ih *IntrHandler) Handle(handler func(count int, ih *IntrHandler), sigs ...os.Signal)

Handle starts handling the given signals, and will call the handler callback function each time a signal is caught. The function is passed the number of times the handler has been triggered in total, as well as the handler itself, so that the handling logic can use the handler's wait group to ensure clean shutdown when Close() is called.

Jump to

Keyboard shortcuts

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