godotto

package module
v0.0.0-...-cad3fbd Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

README

godotto

Exposes digitalocean/godo in a robertkrimen/otto javascript VM.

repl

A DigitalOcean repl!

> cloud.droplets.list();
[]
> cloud.droplets.create({"name":"lol","image":{"slug":"debian-8-x64"},"region":"nyc3","size":"1gb"});
{
  "created_at": "2016-04-11T05:39:19Z",
  "disk": 30,
  "id": 13190234,
  "name": "lol",
  ...
}
> var d = cloud.droplets.get(droplets[0].id);
> d.status;
"active"
> cloud.droplets.delete(d);
> cloud.droplets.list();
[]

Or use the REPL as a runtime:

#!/usr/bin/env dorepl

var acc = cloud.accounts.get();

console.log("hello I am " + acc.email);

var keys = cloud.keys.list();

_.each(keys, function(k) {
  console.log("i have key! "+ k.name)
});

var regions = cloud.regions.list();

console.log("this cloud has " + regions.length + " regions!");
_.each(regions, function(r) {
  console.log("droplets in "+ r.name)
});

installation

Automated CI status:

  • Linux: Build Status
  • Windows: Build status
linux

On debian and children:

wget https://github.com/aybabtme/godotto/releases/download/0.5.1/dorepl_Linux_x86_64.deb
sudo dpkg -i dorepl_Linux_x86_64.deb

Or pull the binary directly:

wget -qO- https://github.com/aybabtme/godotto/releases/download/0.5.1/dorepl_Linux_x86_64.tar.gz | tar xvz
darwin
brew tap aybabtme/homebrew-tap
brew install dorepl
windows (not tested, ymmv)

unzip this file somewhere, i guess!

https://github.com/aybabtme/godotto/releases/download/0.5.1/dorepl_Windows_x86_64.zip

not implemented

  • Droplet: everything is missing except the CRUD
  • Droplet Actions
  • Image Actions
  • Floating IP Actions
  • Tags

license

Apache 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(ctx context.Context, vm *otto.Otto, client cloud.Client) (otto.Value, error)

Types

This section is empty.

Directories

Path Synopsis
cmd
pkg
extra/do/mockcloud
Package mockcloud allows mocking a cloud.Client.
Package mockcloud allows mocking a cloud.Client.
extra/ottoutil/jsvendor/corejs
Package corejs adds core-js functionalities to an otto VM.
Package corejs adds core-js functionalities to an otto VM.
extra/repl
Package repl implements a REPL (read-eval-print loop) for otto.
Package repl implements a REPL (read-eval-print loop) for otto.

Jump to

Keyboard shortcuts

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