Jerryho DigitalOcean service
TODO: Description
ROE
PROTO naming
- Put all
.proto
files in proto/digitalocean
- 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:
- List
MICRO_REGISTRY=mdns micro call digitalocean Droplets.List
- Create
MICRO_REGISTRY=mdns micro call digitalocean Droplets.Create '{"name":"Foo","image":"ubuntu-14-04-x64","region":"nyc3","size":"s-1vcpu-1gb"}'
- Get
MICRO_REGISTRY=mdns micro call digitalocean Droplets.Get '{"id":118550799}'
- Delete
MICRO_REGISTRY=mdns micro call digitalocean Droplets.Get '{"id":118550799}'
TODO
-
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.
-
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"
```
-
Logging - decide if and how to log events.