common

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// MinDiskSizeGB specifies the minimum attached disk size
	MinDiskSizeGB = 1
	// MaxDiskSizeGB specifies the maximum attached disk size
	MaxDiskSizeGB = 1023
)

Variables

This section is empty.

Functions

func CidrFirstIP

func CidrFirstIP(cidr net.IP) net.IP

CidrFirstIP returns the first IP of the provided subnet.

func CidrStringFirstIP

func CidrStringFirstIP(ip string) (net.IP, error)

CidrStringFirstIP returns the first IP of the provided subnet string. Returns an error if the string cannot be parsed.

func GetLatestPatchVersion

func GetLatestPatchVersion(majorMinor string, versionsList []string) (version string)

GetLatestPatchVersion gets the most recent patch version from a list of semver versions given a major.minor string

func GetMaxVersion

func GetMaxVersion(versions []string, preRelease bool) string

GetMaxVersion gets the highest semver version preRelease=true means accept a pre-release version as a max value

func GetVersionsBetween

func GetVersionsBetween(versions []string, versionMin, versionMax string, inclusive, preReleases bool) []string

GetVersionsBetween returns a list of versions between a min and max inclusive=true means that we test for equality on both bounds preReleases=true means that we include pre-release versions in the list

func GetVersionsGt

func GetVersionsGt(versions []string, version string, inclusive, preReleases bool) []string

GetVersionsGt returns a list of versions greater than a semver string given a list of versions inclusive=true means that we test for equality as well preReleases=true means that we include pre-release versions in the list

func GetVersionsLt

func GetVersionsLt(versions []string, version string, inclusive, preReleases bool) []string

GetVersionsLt returns a list of versions less than than a semver string given a list of versions inclusive=true means that we test for equality as well preReleases=true means that we include pre-release versions in the list

func HandleValidationErrors

func HandleValidationErrors(e validator.ValidationErrors) error

HandleValidationErrors is the helper function to catch validator.ValidationError based on Namespace of the error, and return customized error message.

func IP4BroadcastAddress

func IP4BroadcastAddress(n *net.IPNet) net.IP

IP4BroadcastAddress returns the broadcast address for the given IP subnet.

Types

This section is empty.

Jump to

Keyboard shortcuts

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