fdmax

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: MIT Imports: 6 Imported by: 1

README

fdmax

Small Helper library that increases automatically the maximum number of file descriptors for the current go program. It can be simply imported as follows:

package main

import (
	"fmt"

	_ "github.com/boss-net/fdmax/autofdmax"
)

func main() {
	fmt.Println("test")
}

Documentation

Index

Constants

View Source
const (
	// UnixMax on unix systems
	UnixMax uint64 = 999999
	// OSXMax on darwin
	OSXMax uint64 = 24576
)

Variables

View Source
var (
	// ErrUnsupportedPlatform error if the platform doesn't support file descriptor increase via system api
	ErrUnsupportedPlatform = errors.New("unsupported platform")
)

Functions

func Set

func Set(maxLimit uint64) error

func SetWithUlimit

func SetWithUlimit(maxLimit uint64) error

Types

type Limits

type Limits struct {
	Current uint64
	Max     uint64
}

Limits contains the file system descriptor limits

func Get

func Get() (*Limits, error)

Get the current limits

func GetWithUlimit

func GetWithUlimit() (*Limits, error)

Directories

Path Synopsis
example
cmd

Jump to

Keyboard shortcuts

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