2020-11-20 16:52:42 -05:00
2019-02-26 17:03:16 -05:00
2019-07-08 15:44:17 -04:00
2020-11-20 16:52:42 -05:00
2020-11-20 16:52:42 -05:00
2020-11-20 16:52:42 -05:00
2020-11-20 16:52:42 -05:00
2020-11-20 16:52:42 -05:00
2020-11-20 16:52:42 -05:00
2020-11-20 16:52:42 -05:00
2019-07-08 15:44:17 -04:00
2020-11-20 16:52:42 -05:00
2020-11-20 16:52:42 -05:00
2020-11-20 16:52:42 -05:00

libdetectcloud

http.Client timeout is set to 300ms. Sometimes hitting the metadata service to fast will return empty instead of the cloud provider detected.

package main

import (
	"fmt"
	"gitlab.com/taskfitio/lib/detectcloud"
)

func main() {

    // detectcloud.Detect() will return an empty string or
    // Amazon Web Services, Microsoft Azure, Digital Ocean
    // Google Compute Engine, OpenStack, SoftLayer, Vultr
    // K8S Container, Container

	fmt.Println(detectcloud.Detect())

}
S
Description
No description provided
Readme Apache-2.0 67 KiB
Languages
Go 95.9%
Makefile 4.1%