Documentation
¶
Overview ¶
Package network provides port allocation managers
Index ¶
Constants ¶
View Source
const ( // Private denotes localhost Private = "127.0.0.1" // Public denotes 0.0.0.0 Public = "0.0.0.0" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages host network usage
func NewRegistry ¶
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 ¶
AssignPort assigns an available port and returns it
Click to show internal directories.
Click to hide internal directories.