Skip to content

Golang library to detect Cloud Service Provider or K8S

License

Notifications You must be signed in to change notification settings

netbirdio/libdetectcloud

 
 

Repository files navigation

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())

    }

About

Golang library to detect Cloud Service Provider or K8S

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 95.9%
  • Makefile 4.1%