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) (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)" || \ @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) (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) (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)" || \ @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) (echo "👹 meta fields in proto files must have option (gogoproto.nullable) = false" && false)

View File

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

View File

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