Documentation
¶
Index ¶
- func PruneRegistry(file string) (pruned []string, err error)
- func StopAll(file string) error
- func WorkloadPort(name string) int
- type RunningProxy
- func GetRunningProxy(file, targetName string) (*RunningProxy, error)
- func ListRunningProxies(file string) ([]*RunningProxy, error)
- func NewRunningProxy(targetName, localPort string, pid int, pid2 int, file string) *RunningProxy
- func Preflight(file string, targetName string, localPort string) (existingRunningProxy *RunningProxy, active bool, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PruneRegistry ¶
PruneRegistry removes entries whose processes are no longer running. Returns the list of pruned target names.
func WorkloadPort ¶
WorkloadPort returns a deterministic port in the range [10000, 19999] for the given workload name, derived via FNV-32a.
Types ¶
type RunningProxy ¶
type RunningProxy struct {
TargetName string `json:"target_name"`
LocalPort string `json:"local_port"`
Pid int `json:"pid"`
Pid2 int `json:"pid2,omitempty"` // Optional second PID for azure proxy sessions
StartTime time.Time `json:"start_time"`
File string `json:"-"` // Registry file path so Store/DeleteFile know where to write
}
func GetRunningProxy ¶
func GetRunningProxy(file, targetName string) (*RunningProxy, error)
GetRunningProxy loads the registry at file and returns the entry for targetName. Returns an empty RunningProxy (not an error) when no entry exists.
func ListRunningProxies ¶
func ListRunningProxies(file string) ([]*RunningProxy, error)
ListRunningProxies returns all entries currently in the registry.
func NewRunningProxy ¶
func NewRunningProxy(targetName, localPort string, pid int, pid2 int, file string) *RunningProxy
NewRunningProxy creates a new RunningProxy instance and initializes its fields.
func (*RunningProxy) DeleteFile ¶
func (r *RunningProxy) DeleteFile() error
DeleteFile removes this proxy's entry from the registry.
func (*RunningProxy) IsRunning ¶
func (r *RunningProxy) IsRunning() bool
func (*RunningProxy) KillProcess ¶
func (r *RunningProxy) KillProcess() error
func (*RunningProxy) Stop ¶
func (r *RunningProxy) Stop() error
func (*RunningProxy) Store ¶
func (r *RunningProxy) Store() error
Store upserts this RunningProxy into the registry file.
func (*RunningProxy) WaitForPortOpen ¶
func (r *RunningProxy) WaitForPortOpen(seconds int) bool
Click to show internal directories.
Click to hide internal directories.