digitalocean

module
v0.0.0-...-ad31612 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2018 License: MIT

README

Jerryho DigitalOcean service

Go Report Card Go Doc Release

TODO: Description

ROE

PROTO naming

  1. Put all .proto files in proto/digitalocean
  2. Name .proto file after digitalocean/godo API structs, ex. Droplets => droplets.proto

Usage

Start a service

MICRO_REGISTRY=mdns go run main.go

Connect to the service

MICRO_REGISTRY=mdns micro call greeter Greeter.Hello '{"name": "John"}'

#EXAMPLES:

  1. List
MICRO_REGISTRY=mdns micro call digitalocean Droplets.List
  1. Create
MICRO_REGISTRY=mdns micro call digitalocean Droplets.Create '{"name":"Foo","image":"ubuntu-14-04-x64","region":"nyc3","size":"s-1vcpu-1gb"}'
  1. Get
MICRO_REGISTRY=mdns micro call digitalocean Droplets.Get '{"id":118550799}'
  1. Delete
MICRO_REGISTRY=mdns micro call digitalocean Droplets.Get '{"id":118550799}'

TODO

  1. Decide if proto directory is ok or not?

    https://github.com/golang-standards/project-layout/ has no proto directory. I assume we could copy Helm's layout which uses _proto for *.proto files and pkg/proto for compiled client code. I'm open for discussion. For now, leaving proto and pkg/proto as it's easier to script it this way.

  2. Decide if we should rename proto and service packages to be under the same main package

    Currently we have:

     ```
     proto "github.com/jerryhoio/digitalocean/pkg/proto/greeter"
     svc "github.com/jerryhoio/digitalocean/pkg/service/greeter"
     ```
    

    Maybe a better structure would be:

     ```
     proto "github.com/jerryhoio/digitalocean/pkg/greeter/proto"
     svc "github.com/jerryhoio/digitalocean/pkg/greeter/service"
     ```
    
  3. Logging - decide if and how to log events.

Directories

Path Synopsis
cmd
pkg
proto/digitalocean
Package droplets is a generated protocol buffer package.
Package droplets is a generated protocol buffer package.
proto/greeter
Package greeter is a generated protocol buffer package.
Package greeter is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL