Nexus: Index | Files

package network

import ""

Package network provides port allocation managers


Package Files

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


const (
    // Private denotes localhost
    Private = ""

    // Public denotes
    Public = ""

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.