Commit Graph

22 Commits

Author SHA1 Message Date
Guillaume Tardif b9d6c2e701 Add volume as a new served API, use `one of` in proto for context specific parameters, proxy volume creation
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
2020-09-28 14:56:32 +02:00
Chris Crone d154c41586 Update copyright
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-09-22 12:13:00 +02:00
Chris Crone 4c6280b0e9 Rename docker/api -> docker/compose-cli
Signed-off-by: Chris Crone <christopher.crone@docker.com>
2020-08-21 17:28:39 +02:00
Djordje Lukic ad72c866cc Add license headers 2020-06-18 16:48:03 +02:00
Djordje Lukic 8400795caf Add the store to the gRPC context
The contexts service needs it
2020-06-09 12:11:59 +02:00
Djordje Lukic bb69de1db3 Add context endpoint to set the current context 2020-06-08 16:01:43 +02:00
Djordje Lukic c34d016fdb Unify protos with client interfaces
* change function names in containers.proto
* add streams proto
2020-06-08 09:43:19 +02:00
Djordje Lukic cb14c05e74 Move the context server into own package
It had notthing to do in the cli package
2020-05-26 10:31:14 +02:00
Djordje Lukic b8658b3f54 Rename cli protos to contexts 2020-05-26 10:20:13 +02:00
Djordje Lukic 129e675932 Put all protos inside the `protos` package 2020-05-25 15:04:28 +02:00
Djordje Lukic 11339761ca Change the way a context is stored
Initially we stored the context data in the `Metadata` of the context
but in hindsight this data would be better of in the `Endpoints` because
that's what it is used for.

Before:
```json
{
  "Name": "aci",
  "Metadata": {
    "Type": "aci",
    "Data": {
      "key": "value"
    }
  },
  "Endpoints": {
      "docker": {}
  }
}
```

After:
```json
{
  "Name": "aci",
  "Type": "aci",
  "Metadata": {},
  "Endpoints": {
      "aci": {
          "key": "value"
      },
      "docker": {}
  }
}
```

With this change the contexts that we create are more in line with the contexts the docker cli creates.

It also makes the code less complicated since we don't need to marsal twice any more. The API is nicer too:

```go
// Get a context:
c, err := store.Get(contextName)

// Get the stored endpoint:
var aciContext store.AciContext
if err := contextStore.GetEndpoint(currentContext, &aciContext); err != nil {
	return nil, err
}
```
2020-05-22 16:32:43 +02:00
Djordje Lukic 36c01f511b Refactor the interceptors
Avoid having a function that takes in two contexts as parameters
2020-05-22 10:16:04 +02:00
Christopher Crone ebe3fbc180 Use config dir for serving API
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
2020-05-20 15:56:07 +02:00
guillaume.tardif ecfffc6feb Allow server to start on tcp port or if windows, named pipe rather than unix socket. could not yet make it work on named pipe from js client (connects but error) 2020-05-18 14:14:52 +02:00
Djordje Lukic 4e9a4185af Add `make lint` and run it on CI 2020-05-05 10:50:30 +02:00
Djordje Lukic 24c035e822 Add comments on exported items, remove example command
Also add `make lint` to run the linter
2020-05-05 10:27:44 +02:00
Ulysses Souza 33c45a0a62 Add "goimports"
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2020-05-04 11:30:21 +02:00
Djordje Lukic 6ecb5550f7 Use a request for the context list rpc in cli.proto 2020-04-30 12:42:11 +02:00
Djordje Lukic 0af5afe440 Move the proxy in the server package 2020-04-30 12:20:04 +02:00
Djordje Lukic 8571cf5a04 Create a new client on each request
`docker serve` doesn't need a context any more, the server takes the
current context from the request metadata and creates a new client
2020-04-30 12:07:26 +02:00
Djordje Lukic 9ea91791b4 Change the current context of the client on each request
* the interceptor takes the current context from the metadat
* each handler needs to call `client.SetContext()` before using the
sevices
2020-04-30 12:07:26 +02:00
Djordje Lukic 40a3a20f78 Add serve command that serves the cli and the containers services 2020-04-30 12:07:26 +02:00