Skip to content

Commit

Permalink
Reindent proto files to match Google Style Guide
Browse files Browse the repository at this point in the history
https://developers.google.com/protocol-buffers/docs/style
Signed-off-by: Manuel Mendez <manny@packet.com>
  • Loading branch information
mmlb committed Oct 27, 2020
1 parent 2df63b2 commit 8a98a48
Show file tree
Hide file tree
Showing 4 changed files with 231 additions and 232 deletions.
8 changes: 4 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
root = true

[*]
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
indent_style = space
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[{Makefile,go.mod,go.sum,*.go,.gitmodules,*.sh}]
indent_style = tab
indent_size = 8
indent_style = tab

[*.md]
indent_size = 4
210 changes: 105 additions & 105 deletions protos/hardware/hardware.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,127 +16,127 @@ import "google/api/annotations.proto";
// Read access to individual hardware profiles is provided through the unique
// ID, MAC, and IP hardware properties.
service HardwareService {
// Push adds a new Hardware profile to the data store.
rpc Push (PushRequest) returns (Empty) {
option (google.api.http) = {
post: "/v1/hardware"
body: "*"
};
};

// ByMac returns the Hardware with the given hardware MAC Address.
rpc ByMAC(GetRequest) returns (Hardware) {
option (google.api.http) = {
post: "/v1/hardware/mac"
body: "*"
};
};

// ByIP returns the Hardware with the given IP Address.
rpc ByIP(GetRequest) returns (Hardware) {
option (google.api.http) = {
post: "/v1/hardware/ip"
body: "*"
};
};

// ByID returns the Hardware with the given ID.
rpc ByID(GetRequest) returns (Hardware) {
option (google.api.http) = {
get: "/v1/hardware/{id}"
};
};

// All returns all of the Hardware profiles.
rpc All(Empty) returns (stream Hardware) {
option (google.api.http) = {
get: "/v1/hardware"
};
};

// Watch watches for events on the given hardware and streams the matching Hardware.
rpc Watch(GetRequest) returns (stream Hardware);

// Delete deletes the given hardware from the data store.
rpc Delete(DeleteRequest) returns (Empty) {
// Push adds a new Hardware profile to the data store.
rpc Push (PushRequest) returns (Empty) {
option (google.api.http) = {
delete: "/v1/hardware/{id}"
};
post: "/v1/hardware"
body: "*"
};
};

// ByMac returns the Hardware with the given hardware MAC Address.
rpc ByMAC(GetRequest) returns (Hardware) {
option (google.api.http) = {
post: "/v1/hardware/mac"
body: "*"
};
};

// ByIP returns the Hardware with the given IP Address.
rpc ByIP(GetRequest) returns (Hardware) {
option (google.api.http) = {
post: "/v1/hardware/ip"
body: "*"
};
};

// ByID returns the Hardware with the given ID.
rpc ByID(GetRequest) returns (Hardware) {
option (google.api.http) = {
get: "/v1/hardware/{id}"
};
};

// All returns all of the Hardware profiles.
rpc All(Empty) returns (stream Hardware) {
option (google.api.http) = {
get: "/v1/hardware"
};
};

// Watch watches for events on the given hardware and streams the matching Hardware.
rpc Watch(GetRequest) returns (stream Hardware);

// Delete deletes the given hardware from the data store.
rpc Delete(DeleteRequest) returns (Empty) {
option (google.api.http) = {
delete: "/v1/hardware/{id}"
};
};
}

message PushRequest {
Hardware data = 1;
Hardware data = 1;
}

message Empty {
}

message GetRequest {
string mac = 1;
string ip = 2;
string id = 3;
string mac = 1;
string ip = 2;
string id = 3;
}

message Hardware {
message DHCP {
message IP {
string address = 1;
string netmask = 2;
string gateway = 3;
int64 family = 4;
}
string mac = 1;
reserved 2; // obsolete ip
string hostname = 3;
int64 lease_time = 4;
repeated string name_servers = 5;
repeated string time_servers = 6;
reserved 7; // obsolete gateway
string arch = 8;
bool uefi = 9;
string iface_name = 10;
IP ip = 11;
}
message Netboot {
message IPXE {
string url = 1;
string contents = 2;
}
message Osie {
string base_url = 1;
string kernel = 2;
string initrd = 3;
}

bool allow_pxe = 1;
bool allow_workflow = 2;
IPXE ipxe = 3;
reserved 4; // obsolete bootstrapper
Osie osie = 5;
}
message Network {
message Interface {
DHCP dhcp = 1;
Netboot netboot = 2;
}
reserved 1; // obsolete dhcp
reserved 2; // obsolete netboot
repeated Interface interfaces = 3;
reserved 4; // obsolete default
}

reserved 1; // obsolete json
reserved 2; // obsolete dhcp
reserved 3; // obsolete netboot
reserved 4; // obsolete network
reserved 5; // obsolete metadata
Network network = 6;
string id = 7;
int64 version = 8;
message DHCP {
message IP {
string address = 1;
string netmask = 2;
string gateway = 3;
int64 family = 4;
}
string mac = 1;
reserved 2; // obsolete ip
string hostname = 3;
int64 lease_time = 4;
repeated string name_servers = 5;
repeated string time_servers = 6;
reserved 7; // obsolete gateway
string arch = 8;
bool uefi = 9;
string iface_name = 10;
IP ip = 11;
}
message Netboot {
message IPXE {
string url = 1;
string contents = 2;
}
message Osie {
string base_url = 1;
string kernel = 2;
string initrd = 3;
}

bool allow_pxe = 1;
bool allow_workflow = 2;
IPXE ipxe = 3;
reserved 4; // obsolete bootstrapper
Osie osie = 5;
}
message Network {
message Interface {
DHCP dhcp = 1;
Netboot netboot = 2;
}
reserved 1; // obsolete dhcp
reserved 2; // obsolete netboot
repeated Interface interfaces = 3;
reserved 4; // obsolete default
}

reserved 1; // obsolete json
reserved 2; // obsolete dhcp
reserved 3; // obsolete netboot
reserved 4; // obsolete network
reserved 5; // obsolete metadata
Network network = 6;
string id = 7;
int64 version = 8;
string metadata = 9;
}

message DeleteRequest {
string id = 1;
string id = 1;
}
62 changes: 31 additions & 31 deletions protos/template/template.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,47 @@ import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";

service Template {
rpc CreateTemplate(WorkflowTemplate) returns (CreateResponse) {
option (google.api.http) = {
post: "/v1/templates"
body: "*"
};
};
rpc GetTemplate(GetRequest) returns (WorkflowTemplate) {
option (google.api.http) = {
get: "/v1/templates/{id}"
};
};
rpc DeleteTemplate(GetRequest) returns (Empty) {
option (google.api.http) = {
delete: "/v1/templates/{id}"
};
};
rpc ListTemplates(Empty) returns (stream WorkflowTemplate) {
option (google.api.http) = {
get: "/v1/templates"
};
};
rpc UpdateTemplate(WorkflowTemplate) returns (Empty);
rpc CreateTemplate(WorkflowTemplate) returns (CreateResponse) {
option (google.api.http) = {
post: "/v1/templates"
body: "*"
};
};
rpc GetTemplate(GetRequest) returns (WorkflowTemplate) {
option (google.api.http) = {
get: "/v1/templates/{id}"
};
};
rpc DeleteTemplate(GetRequest) returns (Empty) {
option (google.api.http) = {
delete: "/v1/templates/{id}"
};
};
rpc ListTemplates(Empty) returns (stream WorkflowTemplate) {
option (google.api.http) = {
get: "/v1/templates"
};
};
rpc UpdateTemplate(WorkflowTemplate) returns (Empty);
}

message Empty {
}

message WorkflowTemplate {
string id = 1;
string name = 2;
reserved 3; // obsolete data
google.protobuf.Timestamp createdAt = 4;
google.protobuf.Timestamp updatedAt = 5;
google.protobuf.Timestamp deletedAt = 6;
string data = 7;
string id = 1;
string name = 2;
reserved 3; // obsolete data
google.protobuf.Timestamp createdAt = 4;
google.protobuf.Timestamp updatedAt = 5;
google.protobuf.Timestamp deletedAt = 6;
string data = 7;
}

message CreateResponse {
string id = 1;
string id = 1;
}

message GetRequest {
string id = 1;
string id = 1;
}
Loading

0 comments on commit 8a98a48

Please sign in to comment.