Commit Graph
16 Commits
Author SHA1 Message Date
Soam Vasani a93c17548c Add exports that make controller usable 2016-10-29 20:38:50 -07:00
Soam Vasani 012a8de1ec Add API version to URLs 2016-09-29 21:41:52 -07:00
Soam Vasani 9a65c8a6fb Undo changes to client function obj 2016-09-22 01:11:17 -07:00
Soam Vasani 79fb54820e Base64 encode the code in json objects.
This will make the API easier for clients.  Also add a ?raw=1 flag to
the function GET API, to get just the code of the function.
2016-09-22 01:07:34 -07:00
Soam Vasani 6b67bc0a61 API for environments
Environments for functions. For now this is just the image URL for the
function run container. In the future, Environments will also have
build container image URLs, and perhaps parameters to those
containers.

Create/read/update/delete/list. Versioning will be added later. For
now, only the latest update is stored.
2016-09-21 22:29:51 -07:00
Soam Vasani f7757bdcc1 Add HTTP trigger API and client
This implemenents create/read/update/delete/list for http triggers.
This isn't quite the final implementation: you can't look up old
versions by UUID since it only stores the latest update.  I'll get to
that later.
2016-09-21 15:56:29 -07:00
Soam Vasani fee2fb1d70 Helper func to connect to etcd 2016-09-20 21:58:53 -07:00
Soam Vasani 16a75c8887 Remove call to the validator function
(This will be better handled in a higher layer.)
2016-09-20 10:51:44 -07:00
Soam Vasani f02f58cd12 Controller API unit tests 2016-09-20 00:54:26 -07:00
Soam Vasani 72ff031624 Controller API client.
Just Functions so far.
2016-09-20 00:53:57 -07:00
Soam Vasani 14734f6435 HTTP API for Functions
So far, just Function create/read/update/delete/list.  FunctionApi
glues HTTP request/response to functionStore.
2016-09-20 00:45:13 -07:00
Soam Vasani be16c6a2aa Minor stuff: debug logs, unit test update 2016-09-20 00:44:19 -07:00
Soam Vasani a0cfadbd73 Fix deleteFile (missing deletes for etcd metadata)
Also move resource and serializer interfaces to types.go
2016-09-20 00:25:50 -07:00
Soam Vasani 7963d7527c Wrap resourceStore for Functions, HTTPTriggers and Environments
FunctionStore uses fileStore for function code and resourceStore for
the Function's metadata.  Environment- and HTTPTrigger- Store are just
thin wrappers on resourceStore.

There is probably a better way to organize this code, maybe with
reflection.
2016-09-20 00:12:21 -07:00
Soam Vasani 94899a88a7 Some sort of generic etcd-backed store
- A generic Resource interface, which is serializable and has
  a key() method to get an identifying key.

- A resourceStore, which has create, read, update, delete and list.
  This wraps etcd key operations and serialization/deserialization in
  a convenient service.  Serialization is provided to the
  resourceStore as a 'serialization' interface.  This can be JSON or
  anything else.

- The resourceStore also has file operations -- this has read, write
  and delete operations.  The general idea is to store metadata in
  etcd and data on the fileStore (which could also be an object store,
  we don't really use any file-specific properties).  Files are also
  versioned -- each writeFile writes to a new UUID and that UUID is
  stored in an etcd in-order list.  readFile can retrieve an arbitrary
  version by UUID, or just get the latest contents.
2016-09-10 01:01:27 -07:00
Soam Vasani 5c336043db Move /src/controller/ to /controller 2016-09-10 01:01:27 -07:00