Documentation
¶
Index ¶
- func BuildSystemCommandFor(cmd string) []string
- func CondenseNetWithPortRange(nwps []akn.NetWithPortRange, limit int) []akn.NetWithPortRange
- func ExecutePowershellCommand(ctx context.Context, cmds []string, shell Shell) (string, error)
- func GetAvailableDriveLetters() ([]string, error)
- func GetDriveSpace(driveLetter string, kind DriveSpace) (uint64, error)
- func IsExecutableOperational(executableName string, args ...string) error
- func IsProcessRunning(processName string) (bool, error)
- func MapToNetworks(ctx context.Context, ipsOrCidrsOrHostnames ...string) ([]net.IPNet, error)
- func ParsePortRanges(raw []string) ([]akn.PortRange, error)
- func PowershellCommand(args ...string) *exec.Cmd
- func Resolve(ctx context.Context, hostnames ...string) ([]net.IP, error)
- func SanitizePowershellArg(arg string) string
- func SanitizePowershellArgs(args ...string) []string
- func StopProcess(processName string) error
- type DriveSpace
- type HostnameInput
- type HostnameOutput
- type HostnameResolver
- type Shell
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildSystemCommandFor ¶
BuildSystemCommandFor builds up the commands to wrap the given one into a scheduled task executed in SYSTEM scope.
func CondenseNetWithPortRange ¶
func CondenseNetWithPortRange(nwps []akn.NetWithPortRange, limit int) []akn.NetWithPortRange
CondenseNetWithPortRange condenses a list of NetWithPortRange The way this algorithm works: 1. Sort the nwp list ascending by BaseIP and port 2. For each nwp in the list create a new nwp with the next neighbor if port-ranges are compatible 3. From the new list choose the nwp with the longest prefix length, remove all nwp witch are included in the chosen and add the chosen nwp to the result list 4. Repeat 3. until either the list is shorter than limit or no more compatible nwp are found
func ExecutePowershellCommand ¶
ExecutePowershellCommand runs the given commands in a powershell session. Callers must make sure that passed in commands are properly sanitizes.
func GetAvailableDriveLetters ¶ added in v0.2.0
func GetDriveSpace ¶ added in v0.2.0
func GetDriveSpace(driveLetter string, kind DriveSpace) (uint64, error)
func IsExecutableOperational ¶ added in v0.2.0
func IsProcessRunning ¶ added in v0.2.0
func MapToNetworks ¶
func PowershellCommand ¶ added in v0.2.0
func SanitizePowershellArg ¶
func SanitizePowershellArgs ¶
func StopProcess ¶ added in v0.2.0
Types ¶
type DriveSpace ¶ added in v0.2.0
type DriveSpace string
const ( Available DriveSpace = "SizeRemaining" Total DriveSpace = "Size" )
type HostnameInput ¶
func (*HostnameInput) Resolve ¶
func (i *HostnameInput) Resolve(ctx context.Context) (*HostnameOutput, error)
type HostnameOutput ¶
type HostnameResolver ¶
type HostnameResolver struct {
}