Add ttrpc server to containerd
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
113
api/next.pb.txt
113
api/next.pb.txt
@@ -4202,6 +4202,119 @@ file {
|
||||
weak_dependency: 2
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
name: "github.com/containerd/containerd/api/services/ttrpc/events/v1/events.proto"
|
||||
package: "containerd.services.events.ttrpc.v1"
|
||||
dependency: "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto"
|
||||
dependency: "gogoproto/gogo.proto"
|
||||
dependency: "google/protobuf/any.proto"
|
||||
dependency: "google/protobuf/empty.proto"
|
||||
dependency: "google/protobuf/timestamp.proto"
|
||||
message_type {
|
||||
name: "PublishRequest"
|
||||
field {
|
||||
name: "topic"
|
||||
number: 1
|
||||
label: LABEL_OPTIONAL
|
||||
type: TYPE_STRING
|
||||
json_name: "topic"
|
||||
}
|
||||
field {
|
||||
name: "event"
|
||||
number: 2
|
||||
label: LABEL_OPTIONAL
|
||||
type: TYPE_MESSAGE
|
||||
type_name: ".google.protobuf.Any"
|
||||
json_name: "event"
|
||||
}
|
||||
}
|
||||
message_type {
|
||||
name: "ForwardRequest"
|
||||
field {
|
||||
name: "envelope"
|
||||
number: 1
|
||||
label: LABEL_OPTIONAL
|
||||
type: TYPE_MESSAGE
|
||||
type_name: ".containerd.services.events.ttrpc.v1.Envelope"
|
||||
json_name: "envelope"
|
||||
}
|
||||
}
|
||||
message_type {
|
||||
name: "SubscribeRequest"
|
||||
field {
|
||||
name: "filters"
|
||||
number: 1
|
||||
label: LABEL_REPEATED
|
||||
type: TYPE_STRING
|
||||
json_name: "filters"
|
||||
}
|
||||
}
|
||||
message_type {
|
||||
name: "Envelope"
|
||||
field {
|
||||
name: "timestamp"
|
||||
number: 1
|
||||
label: LABEL_OPTIONAL
|
||||
type: TYPE_MESSAGE
|
||||
type_name: ".google.protobuf.Timestamp"
|
||||
options {
|
||||
65001: 0
|
||||
65010: 1
|
||||
}
|
||||
json_name: "timestamp"
|
||||
}
|
||||
field {
|
||||
name: "namespace"
|
||||
number: 2
|
||||
label: LABEL_OPTIONAL
|
||||
type: TYPE_STRING
|
||||
json_name: "namespace"
|
||||
}
|
||||
field {
|
||||
name: "topic"
|
||||
number: 3
|
||||
label: LABEL_OPTIONAL
|
||||
type: TYPE_STRING
|
||||
json_name: "topic"
|
||||
}
|
||||
field {
|
||||
name: "event"
|
||||
number: 4
|
||||
label: LABEL_OPTIONAL
|
||||
type: TYPE_MESSAGE
|
||||
type_name: ".google.protobuf.Any"
|
||||
json_name: "event"
|
||||
}
|
||||
options {
|
||||
64400: 1
|
||||
}
|
||||
}
|
||||
service {
|
||||
name: "Events"
|
||||
method {
|
||||
name: "Publish"
|
||||
input_type: ".containerd.services.events.ttrpc.v1.PublishRequest"
|
||||
output_type: ".google.protobuf.Empty"
|
||||
}
|
||||
method {
|
||||
name: "Forward"
|
||||
input_type: ".containerd.services.events.ttrpc.v1.ForwardRequest"
|
||||
output_type: ".google.protobuf.Empty"
|
||||
}
|
||||
method {
|
||||
name: "Subscribe"
|
||||
input_type: ".containerd.services.events.ttrpc.v1.SubscribeRequest"
|
||||
output_type: ".containerd.services.events.ttrpc.v1.Envelope"
|
||||
server_streaming: true
|
||||
}
|
||||
}
|
||||
options {
|
||||
go_package: "github.com/containerd/containerd/api/services/ttrpc/events/v1;events"
|
||||
}
|
||||
weak_dependency: 0
|
||||
weak_dependency: 1
|
||||
syntax: "proto3"
|
||||
}
|
||||
file {
|
||||
name: "github.com/containerd/containerd/api/services/version/v1/version.proto"
|
||||
package: "containerd.services.version.v1"
|
||||
|
||||
18
api/services/ttrpc/events/v1/doc.go
Normal file
18
api/services/ttrpc/events/v1/doc.go
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
Copyright The containerd Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package events defines the event pushing and subscription service.
|
||||
package events
|
||||
1238
api/services/ttrpc/events/v1/events.pb.go
Normal file
1238
api/services/ttrpc/events/v1/events.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
56
api/services/ttrpc/events/v1/events.proto
Normal file
56
api/services/ttrpc/events/v1/events.proto
Normal file
@@ -0,0 +1,56 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package containerd.services.events.ttrpc.v1;
|
||||
|
||||
import weak "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto";
|
||||
import weak "gogoproto/gogo.proto";
|
||||
import "google/protobuf/any.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
option go_package = "github.com/containerd/containerd/api/services/ttrpc/events/v1;events";
|
||||
|
||||
service Events {
|
||||
// Publish an event to a topic.
|
||||
//
|
||||
// The event will be packed into a timestamp envelope with the namespace
|
||||
// introspected from the context. The envelope will then be dispatched.
|
||||
rpc Publish(PublishRequest) returns (google.protobuf.Empty);
|
||||
|
||||
// Forward sends an event that has already been packaged into an envelope
|
||||
// with a timestamp and namespace.
|
||||
//
|
||||
// This is useful if earlier timestamping is required or when forwarding on
|
||||
// behalf of another component, namespace or publisher.
|
||||
rpc Forward(ForwardRequest) returns (google.protobuf.Empty);
|
||||
|
||||
// Subscribe to a stream of events, possibly returning only that match any
|
||||
// of the provided filters.
|
||||
//
|
||||
// Unlike many other methods in containerd, subscribers will get messages
|
||||
// from all namespaces unless otherwise specified. If this is not desired,
|
||||
// a filter can be provided in the format 'namespace==<namespace>' to
|
||||
// restrict the received events.
|
||||
rpc Subscribe(SubscribeRequest) returns (stream Envelope);
|
||||
}
|
||||
|
||||
message PublishRequest {
|
||||
string topic = 1;
|
||||
google.protobuf.Any event = 2;
|
||||
}
|
||||
|
||||
message ForwardRequest {
|
||||
Envelope envelope = 1;
|
||||
}
|
||||
|
||||
message SubscribeRequest {
|
||||
repeated string filters = 1;
|
||||
}
|
||||
|
||||
message Envelope {
|
||||
option (containerd.plugin.fieldpath) = true;
|
||||
google.protobuf.Timestamp timestamp = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
|
||||
string namespace = 2;
|
||||
string topic = 3;
|
||||
google.protobuf.Any event = 4;
|
||||
}
|
||||
Reference in New Issue
Block a user