events

package
v1.2.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package events defines the event pushing and subscription service.

Package events is a generated protocol buffer package.

It is generated from these files:
	github.com/containerd/containerd/api/services/events/v1/events.proto

It has these top-level messages:
	PublishRequest
	ForwardRequest
	SubscribeRequest
	Envelope

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowEvents   = fmt.Errorf("proto: integer overflow")
)

Functions

func RegisterEventsServer

func RegisterEventsServer(s *grpc.Server, srv EventsServer)

Types

type Envelope

type Envelope struct {
	Timestamp time.Time             `protobuf:"bytes,1,opt,name=timestamp,stdtime" json:"timestamp"`
	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     *google_protobuf1.Any `protobuf:"bytes,4,opt,name=event" json:"event,omitempty"`
}

func (*Envelope) Descriptor

func (*Envelope) Descriptor() ([]byte, []int)

func (*Envelope) Field

func (m *Envelope) Field(fieldpath []string) (string, bool)

Field returns the value for the given fieldpath as a string, if defined. If the value is not defined, the second value will be false.

func (*Envelope) Marshal

func (m *Envelope) Marshal() (dAtA []byte, err error)

func (*Envelope) MarshalTo

func (m *Envelope) MarshalTo(dAtA []byte) (int, error)

func (*Envelope) ProtoMessage

func (*Envelope) ProtoMessage()

func (*Envelope) Reset

func (m *Envelope) Reset()

func (*Envelope) Size

func (m *Envelope) Size() (n int)

func (*Envelope) String

func (this *Envelope) String() string

func (*Envelope) Unmarshal

func (m *Envelope) Unmarshal(dAtA []byte) error

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) (*google_protobuf2.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 fowarding on
	// behalf of another component, namespace or publisher.
	Forward(ctx context.Context, in *ForwardRequest, opts ...grpc.CallOption) (*google_protobuf2.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)
}

func NewEventsClient

func NewEventsClient(cc *grpc.ClientConn) 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) (*google_protobuf2.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 fowarding on
	// behalf of another component, namespace or publisher.
	Forward(context.Context, *ForwardRequest) (*google_protobuf2.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
}

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" json:"envelope,omitempty"`
}

func (*ForwardRequest) Descriptor

func (*ForwardRequest) Descriptor() ([]byte, []int)

func (*ForwardRequest) Marshal

func (m *ForwardRequest) Marshal() (dAtA []byte, err error)

func (*ForwardRequest) MarshalTo

func (m *ForwardRequest) MarshalTo(dAtA []byte) (int, error)

func (*ForwardRequest) ProtoMessage

func (*ForwardRequest) ProtoMessage()

func (*ForwardRequest) Reset

func (m *ForwardRequest) Reset()

func (*ForwardRequest) Size

func (m *ForwardRequest) Size() (n int)

func (*ForwardRequest) String

func (this *ForwardRequest) String() string

func (*ForwardRequest) Unmarshal

func (m *ForwardRequest) Unmarshal(dAtA []byte) error

type PublishRequest

type PublishRequest struct {
	Topic string                `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
	Event *google_protobuf1.Any `protobuf:"bytes,2,opt,name=event" json:"event,omitempty"`
}

func (*PublishRequest) Descriptor

func (*PublishRequest) Descriptor() ([]byte, []int)

func (*PublishRequest) Marshal

func (m *PublishRequest) Marshal() (dAtA []byte, err error)

func (*PublishRequest) MarshalTo

func (m *PublishRequest) MarshalTo(dAtA []byte) (int, error)

func (*PublishRequest) ProtoMessage

func (*PublishRequest) ProtoMessage()

func (*PublishRequest) Reset

func (m *PublishRequest) Reset()

func (*PublishRequest) Size

func (m *PublishRequest) Size() (n int)

func (*PublishRequest) String

func (this *PublishRequest) String() string

func (*PublishRequest) Unmarshal

func (m *PublishRequest) Unmarshal(dAtA []byte) error

type SubscribeRequest

type SubscribeRequest struct {
	Filters []string `protobuf:"bytes,1,rep,name=filters" json:"filters,omitempty"`
}

func (*SubscribeRequest) Descriptor

func (*SubscribeRequest) Descriptor() ([]byte, []int)

func (*SubscribeRequest) Marshal

func (m *SubscribeRequest) Marshal() (dAtA []byte, err error)

func (*SubscribeRequest) MarshalTo

func (m *SubscribeRequest) MarshalTo(dAtA []byte) (int, error)

func (*SubscribeRequest) ProtoMessage

func (*SubscribeRequest) ProtoMessage()

func (*SubscribeRequest) Reset

func (m *SubscribeRequest) Reset()

func (*SubscribeRequest) Size

func (m *SubscribeRequest) Size() (n int)

func (*SubscribeRequest) String

func (this *SubscribeRequest) String() string

func (*SubscribeRequest) Unmarshal

func (m *SubscribeRequest) Unmarshal(dAtA []byte) error

Jump to

Keyboard shortcuts

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