events

package
v1.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package events defines the event pushing and subscription service.

Index

Constants

This section is empty.

Variables

View Source
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)

View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Envelope.ProtoReflect.Descriptor instead.

func (*Envelope) GetEvent

func (x *Envelope) GetEvent() *anypb.Any

func (*Envelope) GetNamespace

func (x *Envelope) GetNamespace() string

func (*Envelope) GetTimestamp

func (x *Envelope) GetTimestamp() *timestamppb.Timestamp

func (*Envelope) GetTopic

func (x *Envelope) GetTopic() string

func (*Envelope) ProtoMessage

func (*Envelope) ProtoMessage()

func (*Envelope) ProtoReflect

func (x *Envelope) ProtoReflect() protoreflect.Message

func (*Envelope) Reset

func (x *Envelope) Reset()

func (*Envelope) String

func (x *Envelope) String() string

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

func (x *ForwardRequest) GetEnvelope() *Envelope

func (*ForwardRequest) ProtoMessage

func (*ForwardRequest) ProtoMessage()

func (*ForwardRequest) ProtoReflect

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

func (x *PublishRequest) GetEvent() *anypb.Any

func (*PublishRequest) GetTopic

func (x *PublishRequest) GetTopic() string

func (*PublishRequest) ProtoMessage

func (*PublishRequest) ProtoMessage()

func (*PublishRequest) ProtoReflect

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

func (x *SubscribeRequest) GetFilters() []string

func (*SubscribeRequest) ProtoMessage

func (*SubscribeRequest) ProtoMessage()

func (*SubscribeRequest) ProtoReflect

func (x *SubscribeRequest) ProtoReflect() protoreflect.Message

func (*SubscribeRequest) Reset

func (x *SubscribeRequest) Reset()

func (*SubscribeRequest) String

func (x *SubscribeRequest) String() string

type UnimplementedEventsServer

type UnimplementedEventsServer struct {
}

UnimplementedEventsServer must be embedded to have forward compatible implementations.

func (UnimplementedEventsServer) Forward

func (UnimplementedEventsServer) Publish

func (UnimplementedEventsServer) Subscribe

type UnsafeEventsServer

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL