Code Monkey home page Code Monkey logo

gocloud's Introduction

GoCloud Logo

Codacy Badge Build Status Gitter docs

gocloud: Cloud services library.

GoCloud is a golang library which hides the difference between different APIs provided by varied cloud providers (AWS, GCP, OpenStack etc.) and allows you to manage different cloud resources through a unified and easy to use API.

GoCloud Architecture

Service Types

Compute -- Allows you to manage cloud and virtual servers.

Compute Storage -- Allows you to manage Compute storage.

Container -- Allows users to install and deploy containers onto container based virtualization platforms.

Load balancer -- Allows you to manager Load Balancer service.

DNS -- Allows you to manage DNS service.

Service Providers

AWS

Google

DigitalOcean

Ali-cloud

Vultr

Currently, implementations for other cloud providers are being worked on.

Installation instructions for Linux (Ubuntu)

  1. Install golang.

    $ sudo apt-get update -y
    $ sudo apt-get install golang -y
    
  2. Set GOPATH environment variable. Run gedit ~/.bashrc.
    Copy the following in your .bashrc file:

export GOPATH=$HOME/gopath
export GOBIN=$HOME/gopath/bin
  1. Test your installation by copying the following piece of code in a file. Save the file as gotest.go. Run the file using the command go run gotest.go. If that command returns “Hello World!”, then Go is successfully installed and functional.
package main
import "fmt"
func main() {
    fmt.Printf("Hello World!\n")
}
  1. Now we need to fetch the gocloud repository and other necessary packages. Run the following commands in order:
$ go get github.com/cloudlibz/gocloud
$ go get golang.org/x/oauth2
$ go get cloud.google.com/go/compute/metadata
  1. Create a directory called .gocloud in your HOME directory. Download your AWS, Google and DigitalOcean access credentials and store them in a file in your .gocloud folder.

    AWS:

    Save your AWS credentials in a file named amazoncloudconfig.json.

    {
      "AWSAccessKeyID": "xxxxxxxxxxxx",
      "AWSSecretKey": "xxxxxxxxxxxx"
    }

    Google Cloud Services:

    Save your Google Cloud credentials in a file named googlecloudconfig.json. The file is downloaded in the required format.

    DigitalOcean:

    Save your DigitalOcean credentials in a file named digioceancloudconfig.json.

    {
      "DigiOceanAccessToken": "xxxxxxxxxxxx"
    }

    Ali-cloud:

    Save your Ali-cloud credentials in a file named alicloudconfig.json.

    {
      "AliAccessKeyID":"xxxxxxxxxxxx",
      "AliAccessKeySecret":"xxxxxxxxxxxx"
    }

    Vultr:

    Save your Vultr credentials in a file named vultrconfig.json.

    {
      "VultrAPIKey":"xxxxxxxxxxxx"
    }
    

    You can also set your credentials as environment variables.

    AWS:

    export AWSAccessKeyID =  "xxxxxxxxxxxx"
    export AWSSecretKey = "xxxxxxxxxxxx"
    

    Google Cloud Services:

    export PrivateKey =  "xxxxxxxxxxxx"
    export Type =  "xxxxxxxxxxxx"
    export ProjectID = "xxxxxxxxxxxx"
    export PrivateKeyID = "xxxxxxxxxxxx"
    export ClientEmail = "xxxxxxxxxxxx"
    export ClientID = "xxxxxxxxxxxx"
    export AuthURI = "xxxxxxxxxxxx"
    export TokenURI = "xxxxxxxxxxxx"
    export AuthProviderX509CertURL = "xxxxxxxxxxxx"
    export ClientX509CertURL =  "xxxxxxxxxxxx"
    

    DigitalOcean:

    export DigiOceanAccessToken =  "xxxxxxxxxxxx"
    

    Ali-cloud:

    export AliAccessKeyID =  "xxxxxxxxxxxx"
    export AliAccessKeySecret =  "xxxxxxxxxxxx"
    

    Vultr:

    export VultrAPIKey =  "xxxxxxxxxxxx"
    
  2. You are all set to use gocloud! Check out the following YouTube videos for more information and usage examples: https://youtu.be/4LxsAeoonlY?list=PLOdfztY25UNnxK_0KRRHSngJIyVLDKZxq&t=3

Development setup

$ git clone https://github.com/cloudlibz/gocloud
$ cd gocloud

Unit tests

$ cd gocloud
$ go test -v ./...

Please make sure to delete all your instances, storage blocks, load balancers, containers, and DNS settings once you run the tests by visiting the respective web portals of the cloud providers.

gocloud's People

Contributors

adhyandhull avatar charithccmc avatar iammosespaulr avatar keshav1002 avatar oddcn avatar pengnam avatar pratikdhanave avatar rehrumesh avatar shlokgilda avatar shlokj avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.