udp_proxy_manager

package
v0.0.0-...-e4664ba Latest Latest
Warning

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

Go to latest
Published: May 3, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPortRestrictedForManualConfig

func IsPortRestrictedForManualConfig(port int, restrictedPorts []int) bool

IsPortRestrictedForManualConfig

This function is used to check if a port is restricted or not for application. There are some ports that are restricted. because those port are pre-occupied by Swarm services or other required services. So, binding to those ports will cause errors. That's why we need to restrict those ports before apply the config.

Types

type AddProxyResponse

type AddProxyResponse struct {
	Success bool   `json:"success"`
	Error   string `json:"error"`
}

type ExistProxyResponse

type ExistProxyResponse struct {
	Exist bool `json:"exist"`
}

type Manager

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

func New

func New(connCreator func() (net.Conn, error)) Manager

New : Constructor for new instance of udp proxy manager

func (Manager) Add

func (m Manager) Add(proxy Proxy, restrictedPorts []int) error

func (Manager) Exist

func (m Manager) Exist(proxy Proxy) (bool, error)

func (Manager) List

func (m Manager) List() ([]Proxy, error)

func (Manager) Remove

func (m Manager) Remove(proxy Proxy) error

func (Manager) URI

func (m Manager) URI() string

URI Generate Base URI for HAProxy Server

type Proxy

type Proxy struct {
	Port       int    `json:"port"`
	TargetPort int    `json:"targetPort"`
	Service    string `json:"service"`
}

type RemoveProxyResponse

type RemoveProxyResponse struct {
	Success bool   `json:"success"`
	Error   string `json:"error"`
}

Jump to

Keyboard shortcuts

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