port

package
v0.0.0-...-3388463 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DefaultMaxNotVerifiedPortAge = 300
)

Variables

This section is empty.

Functions

func AllocatePort

func AllocatePort(namespacedCount map[string]int) (map[string][]int32, error)

func ChoosePortByIteration

func ChoosePortByIteration(segmentList *SegmentList, checkPortValid FuncCheckPortValid, basePort int, basePortIdx int) (int, int, bool)

func ChoosePortByRandom

func ChoosePortByRandom(segmentList *SegmentList, checkPortValid FuncCheckPortValid, retryCount int) (int, int, bool)

func ScanPortProviders

func ScanPortProviders()

Types

type BaseInfo

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

type FuncCheckPortValid

type FuncCheckPortValid func(port int) bool

type Provider

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

func GetPortProvider

func GetPortProvider(namespace string) *Provider

func (*Provider) AddIndeed

func (pp *Provider) AddIndeed(owner string, ports []int)

func (*Provider) Allocate

func (pp *Provider) Allocate(count int) ([]int32, error)

func (*Provider) CheckNotVerified

func (pp *Provider) CheckNotVerified()

func (*Provider) DeleteIndeed

func (pp *Provider) DeleteIndeed(owner string, ports []int)

func (*Provider) PortCount

func (pp *Provider) PortCount() int

func (*Provider) PortToVerifyCount

func (pp *Provider) PortToVerifyCount() int

type ProviderManager

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

type Segment

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

func NewSegment

func NewSegment(min, max int) Segment

type SegmentList

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

func NewSegmentList

func NewSegmentList(segments []Segment) *SegmentList

func (*SegmentList) Count

func (sl *SegmentList) Count() int

type VerifyInfo

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

Jump to

Keyboard shortcuts

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