ports

package
v0.74.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PortConfigKey = "Port"
)

Variables

This section is empty.

Functions

func ExtractPorts

func ExtractPorts(m map[string]interface{}) map[int64]string

ExtractPorts extracts all ports definitions into a map of ports to port name. Example map: { 2002: "API.Rest", 2003: "API.GRPC" }

func ExtractPortsFromConfig

func ExtractPortsFromConfig(configPath string) (map[int64]string, error)

ExtractPortsFromConfig read TOML config from disc and extracts all ports definitions into a map of ports to port name

func OpenPortsPerJob

func OpenPortsPerJob(
	ctx context.Context,
	nomadExposedPortsPerJob map[string][]int64,
	genServices genServiceGetter,
) (map[JobWithTask][]PortWithName, error)

func ScanNetworkProcessesPorts

func ScanNetworkProcessesPorts() (map[int64]string, error)

ScanNetworkProcessesPorts returns map of ports to process name for Capsule own processes.

Types

type JobWithTask

type JobWithTask struct {
	Name     string
	TaskName string
}

type PortWithName

type PortWithName struct {
	Name string
	Port int64
}

Jump to

Keyboard shortcuts

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