mirror of
https://github.com/netbirdio/libdetectcloud.git
synced 2026-05-22 17:09:55 -07:00
8eaf968a55c7b584dfbf18ddda592c41bbd0685e
detectcloud
http.Client timeout is set to 120ms. Sometimes hitting the metadata service to fast will return unknown instead of the cloud provider detected.
package main
import (
"fmt"
"gitlab.com/taskfitio/lib/detectcloud"
)
func main() {
// detectcloud.Detect() will return a string
// Amazon Web Services, Microsoft Azure, Digital Ocean
// Google Compute Engine, OpenStack, SoftLayer, Vultr
// unknown
fmt.Println(detectcloud.Detect())
}
Description
Languages
Go
95.9%
Makefile
4.1%