GoCloud work summary

Ali-cloud, Vultr, modular, builder pattern, parsing response

odd cn
gocloud
2 min readAug 7, 2018

--

In GSoC 2018, I implemented Ali-cloud and Vultr support for GoCloud. And other works: GoCloud modular, builder pattern for inputting, parsing response.

Ali-cloud and Vultr support

Ali-cloud modules implemented:

  • ECS Compute
  • ECS Storage
  • Alibaba Cloud DNS
  • Server Load Balancer
  • Container Service

Vultr modules implemented:

  • Server
  • Bare Metal
  • Block Storage
  • DNS

For every implementation of modules and functions, contains unit tests, API documentations, example documentations and getting start tutorial video.

Ali-cloud tutorial video list

Vultr tutorial video list

GoCloud modular

Achieved three goals:

  • way to call: GoCloud.<ServiceType>.<Functionality>
  • development scalable
  • ensure the API is uniform like before

Implemented the way to call like this

More information about GoCloud modular

Builder pattern for inputting parameters

Achieved four goals:

  • Prevent user from inputting wrong parameter name
  • Throw an error when user miss input required parameters
  • Let user add parameters in different places
  • Let user have higher freedom, clearer code

Code of using builder pattern for inputting parameters:

Ali-cloud and Vultr are support builder pattern input now.

More information about Builder pattern for inputting parameters

Parsing response

Achieved two goals:

  • users get the response struct directly
  • put HTTP/HTTPS status code into response struct

Code of parsing response of AttachNodeWithLoadBalancer():

For Ali-cloud, functions implemented:

  • ParseCreateNodeResp()
  • ParseCreateClusterResp()
  • ParseListDnsResp()
  • ParseCreateDiskResp()
  • ParseCreateLoadBalancerResp()
  • ParseAttachLoadBalancerResp()
  • ParseDetachLoadBalancerResp()

For Vultr, functions implemented:

  • ParseListDnsResp()
  • ParseCreateDiskResp()
  • ParseCreateNodeResp()
  • ParseCreateBareMetalResp()
  • ParseListBareMetalResp()

--

--