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 MapToNetworks(ctx context.Context, ipsOrCidrsOrHostnames ...string) ([]net.IPNet, error)
- func ParsePortRanges(raw []string) ([]akn.PortRange, error)
- func Resolve(ctx context.Context, hostnames ...string) ([]net.IP, error)
- func SanitizePowershellArg(arg string) string
- func SanitizePowershellArgs(args ...string) []string
- 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 MapToNetworks ¶
func SanitizePowershellArg ¶
func SanitizePowershellArgs ¶
Types ¶
type HostnameInput ¶
func (*HostnameInput) Resolve ¶
func (i *HostnameInput) Resolve(ctx context.Context) (*HostnameOutput, error)
type HostnameOutput ¶
type HostnameResolver ¶
type HostnameResolver struct {
}