Nexus: github.com/RTradeLtd/Nexus/network Index | Files

package network

import "github.com/RTradeLtd/Nexus/network"

Package network provides port allocation managers

Index

Package Files

cache.go doc.go parse.go ports.go util.go

Constants

const (
    // Private denotes localhost
    Private = "127.0.0.1"

    // Public denotes 0.0.0.0
    Public = "0.0.0.0"
)

type Registry Uses

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

Registry manages host network usage

func NewRegistry Uses

func NewRegistry(logger *zap.SugaredLogger, host string, portRanges []string) *Registry

NewRegistry creates a new registry with given host address and available port ranges. Elements of portRanges can be "<PORT>" or "<LOWER>-<UPPER>"

func (*Registry) AssignPort Uses

func (reg *Registry) AssignPort() (string, error)

AssignPort assigns an available port and returns it

func (*Registry) Close Uses

func (reg *Registry) Close()

Close stops the registry cache cleanup

Package network imports 8 packages (graph) and is imported by 6 packages. Updated 2019-01-18. Refresh now. Tools for package owners.