Documentation
¶
Index ¶
- func FindIP(input string) string
- func FindNodeByAddress(nodeRegistry *structs.NodeRegistry, workerPoolName, nodeAddress string) (ok bool)
- func FindNodeByRegistrationTime(nodeRegistry *structs.NodeRegistry, workerPoolName string) (node string, err error)
- func HasObjectChanged(objectA, objectB interface{}) (changed bool, err error)
- func Max(values ...float64) float64
- func Min(values ...float64) float64
- func ParseMetaConfig(meta map[string]string, reqKeys []string) (missing []string)
- func StringInSlice(a string, list []string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindIP ¶
FindIP will return the IP address from a string. This is used to deal with responses from the Nomad API that contain the port such as 127.0.0.1:4646.
func FindNodeByAddress ¶
func FindNodeByAddress(nodeRegistry *structs.NodeRegistry, workerPoolName, nodeAddress string) (ok bool)
FindNodeByAddress is a helper method that searches the node registry to determine if a node has been registered with a specific worker pool.
The method searches by node IP address and if no result is found, will continue polling the node registry for up to 5 minutes.
func FindNodeByRegistrationTime ¶
func FindNodeByRegistrationTime(nodeRegistry *structs.NodeRegistry, workerPoolName string) (node string, err error)
FindNodeByRegistrationTime is a helper method that watches a worker pool in the node registry for a newly launched node.
The method watches the node registration records which include the date and time the node was registered and looks for a node that was launched anytime within the last 60 seconds or later. If no result is found, the method will continue polling the node registry for up to 5 minutes.
func HasObjectChanged ¶ added in v1.0.0
HasObjectChanged compares two objects to determine if they have changed.
func ParseMetaConfig ¶ added in v1.0.0
ParseMetaConfig parses meta parameters from a Nomad agent or job configuration and validates required keys are present. If any required keys are found to be missing, these are returned. Otherwise, an empty slice is returned.
func StringInSlice ¶
StringInSlice checks if a given string is in a slice.
Types ¶
This section is empty.