Documentation ¶
Overview ¶
Package events defines the event pushing and subscription service.
Index ¶
- Variables
- func RegisterEventsServer(s grpc.ServiceRegistrar, srv EventsServer)
- type Envelope
- func (*Envelope) Descriptor() ([]byte, []int)deprecated
- func (x *Envelope) GetEvent() *anypb.Any
- func (x *Envelope) GetNamespace() string
- func (x *Envelope) GetTimestamp() *timestamppb.Timestamp
- func (x *Envelope) GetTopic() string
- func (*Envelope) ProtoMessage()
- func (x *Envelope) ProtoReflect() protoreflect.Message
- func (x *Envelope) Reset()
- func (x *Envelope) String() string
- type EventsClient
- type EventsServer
- type Events_SubscribeClient
- type Events_SubscribeServer
- type ForwardRequest
- type PublishRequest
- func (*PublishRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PublishRequest) GetEvent() *anypb.Any
- func (x *PublishRequest) GetTopic() string
- func (*PublishRequest) ProtoMessage()
- func (x *PublishRequest) ProtoReflect() protoreflect.Message
- func (x *PublishRequest) Reset()
- func (x *PublishRequest) String() string
- type SubscribeRequest
- type UnimplementedEventsServer
- type UnsafeEventsServer
Constants ¶
This section is empty.
Variables ¶
var Events_ServiceDesc = grpc.ServiceDesc{ ServiceName: "containerd.services.events.v1.Events", HandlerType: (*EventsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Publish", Handler: _Events_Publish_Handler, }, { MethodName: "Forward", Handler: _Events_Forward_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Subscribe", Handler: _Events_Subscribe_Handler, ServerStreams: true, }, }, Metadata: "github.com/containerd/containerd/api/services/events/v1/events.proto", }
Events_ServiceDesc is the grpc.ServiceDesc for Events service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_github_com_containerd_containerd_api_services_events_v1_events_proto protoreflect.FileDescriptor
Functions ¶
func RegisterEventsServer ¶
func RegisterEventsServer(s grpc.ServiceRegistrar, srv EventsServer)
Types ¶
type Envelope ¶
type Envelope struct { Timestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` Topic string `protobuf:"bytes,3,opt,name=topic,proto3" json:"topic,omitempty"` Event *anypb.Any `protobuf:"bytes,4,opt,name=event,proto3" json:"event,omitempty"` // contains filtered or unexported fields }
func (*Envelope) Descriptor
deprecated
func (*Envelope) GetNamespace ¶ added in v1.7.0
func (*Envelope) GetTimestamp ¶ added in v1.7.0
func (x *Envelope) GetTimestamp() *timestamppb.Timestamp
func (*Envelope) ProtoMessage ¶
func (*Envelope) ProtoMessage()
func (*Envelope) ProtoReflect ¶ added in v1.7.0
func (x *Envelope) ProtoReflect() protoreflect.Message
type EventsClient ¶
type EventsClient interface { // 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. Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // 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. Forward(ctx context.Context, in *ForwardRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // 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. Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (Events_SubscribeClient, error) }
EventsClient is the client API for Events service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewEventsClient ¶
func NewEventsClient(cc grpc.ClientConnInterface) EventsClient
type EventsServer ¶
type EventsServer interface { // 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. Publish(context.Context, *PublishRequest) (*emptypb.Empty, error) // 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. Forward(context.Context, *ForwardRequest) (*emptypb.Empty, error) // 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. Subscribe(*SubscribeRequest, Events_SubscribeServer) error // contains filtered or unexported methods }
EventsServer is the server API for Events service. All implementations must embed UnimplementedEventsServer for forward compatibility
type Events_SubscribeClient ¶
type Events_SubscribeClient interface { Recv() (*Envelope, error) grpc.ClientStream }
type Events_SubscribeServer ¶
type Events_SubscribeServer interface { Send(*Envelope) error grpc.ServerStream }
type ForwardRequest ¶
type ForwardRequest struct { Envelope *Envelope `protobuf:"bytes,1,opt,name=envelope,proto3" json:"envelope,omitempty"` // contains filtered or unexported fields }
func (*ForwardRequest) Descriptor
deprecated
func (*ForwardRequest) Descriptor() ([]byte, []int)
Deprecated: Use ForwardRequest.ProtoReflect.Descriptor instead.
func (*ForwardRequest) GetEnvelope ¶ added in v1.7.0
func (x *ForwardRequest) GetEnvelope() *Envelope
func (*ForwardRequest) ProtoMessage ¶
func (*ForwardRequest) ProtoMessage()
func (*ForwardRequest) ProtoReflect ¶ added in v1.7.0
func (x *ForwardRequest) ProtoReflect() protoreflect.Message
func (*ForwardRequest) Reset ¶
func (x *ForwardRequest) Reset()
func (*ForwardRequest) String ¶
func (x *ForwardRequest) String() string
type PublishRequest ¶
type PublishRequest struct { Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"` Event *anypb.Any `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"` // contains filtered or unexported fields }
func (*PublishRequest) Descriptor
deprecated
func (*PublishRequest) Descriptor() ([]byte, []int)
Deprecated: Use PublishRequest.ProtoReflect.Descriptor instead.
func (*PublishRequest) GetEvent ¶ added in v1.7.0
func (x *PublishRequest) GetEvent() *anypb.Any
func (*PublishRequest) GetTopic ¶ added in v1.7.0
func (x *PublishRequest) GetTopic() string
func (*PublishRequest) ProtoMessage ¶
func (*PublishRequest) ProtoMessage()
func (*PublishRequest) ProtoReflect ¶ added in v1.7.0
func (x *PublishRequest) ProtoReflect() protoreflect.Message
func (*PublishRequest) Reset ¶
func (x *PublishRequest) Reset()
func (*PublishRequest) String ¶
func (x *PublishRequest) String() string
type SubscribeRequest ¶
type SubscribeRequest struct { Filters []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"` // contains filtered or unexported fields }
func (*SubscribeRequest) Descriptor
deprecated
func (*SubscribeRequest) Descriptor() ([]byte, []int)
Deprecated: Use SubscribeRequest.ProtoReflect.Descriptor instead.
func (*SubscribeRequest) GetFilters ¶ added in v1.7.0
func (x *SubscribeRequest) GetFilters() []string
func (*SubscribeRequest) ProtoMessage ¶
func (*SubscribeRequest) ProtoMessage()
func (*SubscribeRequest) ProtoReflect ¶ added in v1.7.0
func (x *SubscribeRequest) ProtoReflect() protoreflect.Message
func (*SubscribeRequest) Reset ¶
func (x *SubscribeRequest) Reset()
func (*SubscribeRequest) String ¶
func (x *SubscribeRequest) String() string
type UnimplementedEventsServer ¶ added in v1.4.0
type UnimplementedEventsServer struct { }
UnimplementedEventsServer must be embedded to have forward compatible implementations.
func (UnimplementedEventsServer) Forward ¶ added in v1.4.0
func (UnimplementedEventsServer) Forward(context.Context, *ForwardRequest) (*emptypb.Empty, error)
func (UnimplementedEventsServer) Publish ¶ added in v1.4.0
func (UnimplementedEventsServer) Publish(context.Context, *PublishRequest) (*emptypb.Empty, error)
func (UnimplementedEventsServer) Subscribe ¶ added in v1.4.0
func (UnimplementedEventsServer) Subscribe(*SubscribeRequest, Events_SubscribeServer) error
type UnsafeEventsServer ¶ added in v1.7.0
type UnsafeEventsServer interface {
// contains filtered or unexported methods
}
UnsafeEventsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EventsServer will result in compilation errors.