common

package
v2.0.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2020 License: Apache-2.0 Imports: 2 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComparePartitionPaths

func ComparePartitionPaths(a, b string) bool

ComparePartitionPaths is a utility function that compares the disk portion of two partition paths. It returns true if the disk portion of a and b match.

func ContainsString

func ContainsString(slice []string, s string) bool

ContainsString is a utility function that determines whether a string is included in the list of elements of a slice.

func IsIPv4

func IsIPv4(address string) bool

Determines if an address is an IPv4 address

func IsIPv6

func IsIPv6(address string) bool

Determines if an address is an IPv6 address

func ListChanged

func ListChanged(a, b []string) bool

ListChanged is a utility function which determines if a list of names provided in a spec is equivalent to the list of names return by the system API. Since the spec accepts nil as a list that wasn't specified we consider the nil case as an empty list when comparing against the system API.

func ListDelta

func ListDelta(a, b []string) (added []string, removed []string, same []string)

ListDelta is a utility function which calculates the difference between two lists. If elements in 'b' are not present in 'a' then they will appear in the 'added' list. If elements in a are not present in b then they will appear in the 'removed' list.

func ListIntersect

func ListIntersect(a []string, b []string) ([]string, bool)

ListIntersect is a utility function which determines if there is any commonality between two lists of strings.

func RemoveString

func RemoveString(slice []string, s string) (result []string)

RemoveString is a utility function that removes a string from the list of elements of a slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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