go-ipfs: github.com/ipfs/go-ipfs/cmd/ipfs/util Index | Files

package util

import "github.com/ipfs/go-ipfs/cmd/ipfs/util"

Index

Package Files

signal.go ulimit.go ulimit_unix.go

func ManageFdLimit Uses

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 Uses

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

type IntrHandler Uses

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 Uses

func NewIntrHandler() *IntrHandler

func (*IntrHandler) Close Uses

func (ih *IntrHandler) Close() error

func (*IntrHandler) Handle Uses

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.

Package util imports 10 packages (graph) and is imported by 4 packages. Updated 2019-06-07. Refresh now. Tools for package owners.