api: protos now pass lint checks

Generation is likely broken, but the Makefile linter now passes. Another
pass will have a fully working toolchain.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
Stephen J Day 2016-12-01 12:22:05 -08:00
parent 2507ee35bb
commit 4d1a30ff41
No known key found for this signature in database
GPG key ID: FB5F6B2905D7ECF3
3 changed files with 87 additions and 87 deletions

View file

@ -66,7 +66,7 @@ fmt: ## run go fmt
(echo "👹 please format Go code with 'gofmt -s -w'" && false)
@test -z "$$(find . -path ./vendor -prune -o ! -name timestamp.proto ! -name duration.proto -name '*.proto' -type f -exec grep -Hn -e "^ " {} \; | tee /dev/stderr)" || \
(echo "👹 please indent proto files with tabs only" && false)
@test -z "$$(find . -path ./vendor -prune -o -name '*.proto' -type f -exec grep -Hn "id = " {} \; | grep -v gogoproto.customname | tee /dev/stderr)" || \
@test -z "$$(find . -path ./vendor -prune -o -name '*.proto' -type f -exec grep -EHn "[_ ]id = " {} \; | grep -v gogoproto.customname | tee /dev/stderr)" || \
(echo "👹 id fields in proto files must have a gogoproto.customname set" && false)
@test -z "$$(find . -path ./vendor -prune -o -name '*.proto' -type f -exec grep -Hn "Meta meta = " {} \; | grep -v '(gogoproto.nullable) = false' | tee /dev/stderr)" || \
(echo "👹 meta fields in proto files must have option (gogoproto.nullable) = false" && false)

View file

@ -3,178 +3,178 @@ syntax = "proto3";
package containerd.v1;
service Containers {
rpc Create(CreateRequest) returns (CreateResponse);
rpc Start(StartRequest) returns (StartResponse);
rpc Delete(DeleteRequest) returns (DeleteResponse);
rpc State(StateRequest) returns (StateResponse);
rpc Update(UpdateRequest) returns (UpdateResponse);
rpc Pause(PauseRequest) returns (PauseResponse);
rpc Resume(ResumeRequest) returns (ResumeResponse);
rpc Create(CreateRequest) returns (CreateResponse);
rpc Start(StartRequest) returns (StartResponse);
rpc Delete(DeleteRequest) returns (DeleteResponse);
rpc State(StateRequest) returns (StateResponse);
rpc Update(UpdateRequest) returns (UpdateResponse);
rpc Pause(PauseRequest) returns (PauseResponse);
rpc Resume(ResumeRequest) returns (ResumeResponse);
rpc ContainerList(ContainerListRequest) returns (ContainerListResponse);
rpc ContainerList(ContainerListRequest) returns (ContainerListResponse);
rpc CreateProcess(CreateProcessRequest) returns (CreateProcessResponse);
rpc StartProcess(StartProcessRequest) returns (StartProcessResponse);
rpc ProcessState(ProcessStateRequest) returns (ProcessStateResponse);
rpc SignalProcess(SignalProcessRequest) returns (SignalProcessResponse);
rpc DeleteProcess(DeleteProcessRequest) returns (DeleteProcessResponse);
rpc ProcessList(ProcessListRequest) returns (ProcessListResponse);
rpc CreateProcess(CreateProcessRequest) returns (CreateProcessResponse);
rpc StartProcess(StartProcessRequest) returns (StartProcessResponse);
rpc ProcessState(ProcessStateRequest) returns (ProcessStateResponse);
rpc SignalProcess(SignalProcessRequest) returns (SignalProcessResponse);
rpc DeleteProcess(DeleteProcessRequest) returns (DeleteProcessResponse);
rpc ProcessList(ProcessListRequest) returns (ProcessListResponse);
rpc Events(EventsRequest) returns (stream EventsResponse);
rpc Events(EventsRequest) returns (stream EventsResponse);
}
message Container {
string id = 1;
repeated Mount mounts = 2;
string owner = 3;
Process process = 4;
string id = 1 [(gogoproto.customname) = "ID"];
repeated Mount mounts = 2;
string owner = 3;
Process process = 4;
}
message Process {
uint64 pid = 1;
repeated string args = 2;
repeated string env = 3;
User user = 4;
string cwd = 5;
bool terminal = 6;
uint64 pid = 1;
repeated string args = 2;
repeated string env = 3;
User user = 4;
string cwd = 5;
bool terminal = 6;
}
message ProcessSpec {
repeated string args = 1;
repeated string env = 2;
User user = 3;
string cwd = 4;
bool terminal = 5;
string stdin = 6;
string stdout = 7;
string stderr = 8;
repeated string args = 1;
repeated string env = 2;
User user = 3;
string cwd = 4;
bool terminal = 5;
string stdin = 6;
string stdout = 7;
string stderr = 8;
}
message Mount {
string source = 1;
string target = 2;
string type = 3;
repeated string options = 4;
string source = 1;
string target = 2;
string type = 3;
repeated string options = 4;
}
message User {
uint32 uid = 1;
uint32 gid = 2;
repeated uint32 additionalGids = 3;
repeated uint32 additionalGids = 3;
}
message CreateRequest {
string id = 1;
ProcessSpec process = 2;
repeated Mount mounts = 3;
string owner = 4;
string config_path = 5;
string id = 1 [(gogoproto.customname) = "ID"];
ProcessSpec process = 2;
repeated Mount mounts = 3;
string owner = 4;
string config_path = 5;
}
message CreateResponse {
Container container = 1;
Container container = 1;
}
message StartRequest {
string id = 1;
string id = 1 [(gogoproto.customname) = "ID"];
}
message State {
}
message StartResponse {
State state = 1;
State state = 1;
}
message DeleteRequest {
string id = 1;
string id = 1 [(gogoproto.customname) = "ID"];
}
message DeleteResponse {
}
message ContainerListRequest {
repeated string owner = 1;
repeated string owner = 1;
}
message ContainerListResponse {
repeated Container containers = 1;
repeated Container containers = 1;
}
message StateRequest {
string id = 1;
string id = 1 [(gogoproto.customname) = "ID"];
}
message StateResponse {
Container container = 1;
Container container = 1;
}
message UpdateRequest {
string id = 1;
string id = 1 [(gogoproto.customname) = "ID"];
}
message UpdateResponse {
}
message PauseRequest {
string id = 1;
string id = 1 [(gogoproto.customname) = "ID"];
}
message PauseResponse {
}
message ResumeRequest {
string id = 1;
string id = 1 [(gogoproto.customname) = "ID"];
}
message ResumeResponse {
}
message CreateProcessRequest {
string id = 1;
ProcessSpec spec = 2;
string id = 1 [(gogoproto.customname) = "ID"];
ProcessSpec spec = 2;
}
message CreateProcessResponse {
}
message StartProcessRequest {
string cid = 1;
string pid = 2;
string cid = 1;
string pid = 2;
}
message StartProcessResponse {
uint32 pid = 1;
uint32 pid = 1;
}
message ProcessStateRequest {
string cid = 1;
string pid = 2;
string cid = 1;
string pid = 2;
}
message ProcessStateResponse {
State state = 1;
State state = 1;
}
message SignalProcessRequest {
string cid = 1;
string pid = 2;
uint32 signal = 3;
string cid = 1;
string pid = 2;
uint32 signal = 3;
}
message SignalProcessResponse {
}
message DeleteProcessRequest {
string cid = 1;
string pid = 2;
string cid = 1;
string pid = 2;
}
message DeleteProcessResponse {
}
message ProcessListRequest {
string id = 1;
string id = 1 [(gogoproto.customname) = "ID"];
}
message ProcessListResponse {

View file

@ -3,37 +3,37 @@ syntax = "proto3";
package containerd.v1;
service Registry {
// Pull an image from a registry
rpc Pull(PullRequest) returns (PullResponse);
// Push pushes a new or existing image to a registry
rpc Push(PushRequest) returns (PushResponse);
// Delete deletes an image from the registry
rpc Delete(DeleteRequest) returns (DeleteResponse);
// Pull an image from a registry
rpc Pull(PullRequest) returns (PullResponse);
// Push pushes a new or existing image to a registry
rpc Push(PushRequest) returns (PushResponse);
// Delete deletes an image from the registry
rpc Delete(DeleteRequest) returns (DeleteResponse);
// Status returns a progress stream of the push or pull operation
rpc Status(StatusRequest) returns (stream StatusResponse);
// Cancel cancels a push or pull operation
rpc Cancel(CancelRequest) returns (CancelResponse);
// Status returns a progress stream of the push or pull operation
rpc Status(StatusRequest) returns (stream StatusResponse);
// Cancel cancels a push or pull operation
rpc Cancel(CancelRequest) returns (CancelResponse);
}
message PullRequest {
string uri = 1;
Authentication auth = 2;
string uri = 1;
Authentication auth = 2;
}
message PullResponse {
string id = 1;
repeated Layer layers = 2;
string id = 1 [(gogoproto.customname) = "ID"];
repeated Layer layers = 2;
}
message Layer {
string id = 1;
uint64 size = 2;
string id = 1 [(gogoproto.customname) = "ID"];
uint64 size = 2;
}
// TODO: we have no clue what should go here, halp stevvooo
message Authentication {
string username = 1;
string password = 2;
string username = 1;
string password = 2;
}