events

package
v1.3.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package events defines the event pushing and subscription service.

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,proto3,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                *types.Any `protobuf:"bytes,4,opt,name=event,proto3" json:"event,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

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

func (*Envelope) XXX_DiscardUnknown added in v1.3.0

func (m *Envelope) XXX_DiscardUnknown()

func (*Envelope) XXX_Marshal added in v1.3.0

func (m *Envelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Envelope) XXX_Merge added in v1.3.0

func (m *Envelope) XXX_Merge(src proto.Message)

func (*Envelope) XXX_Size added in v1.3.0

func (m *Envelope) XXX_Size() int

func (*Envelope) XXX_Unmarshal added in v1.3.0

func (m *Envelope) XXX_Unmarshal(b []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) (*types.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) (*types.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://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

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) (*types.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) (*types.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
}

EventsServer is the server API for Events service.

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"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

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

func (*ForwardRequest) XXX_DiscardUnknown added in v1.3.0

func (m *ForwardRequest) XXX_DiscardUnknown()

func (*ForwardRequest) XXX_Marshal added in v1.3.0

func (m *ForwardRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ForwardRequest) XXX_Merge added in v1.3.0

func (m *ForwardRequest) XXX_Merge(src proto.Message)

func (*ForwardRequest) XXX_Size added in v1.3.0

func (m *ForwardRequest) XXX_Size() int

func (*ForwardRequest) XXX_Unmarshal added in v1.3.0

func (m *ForwardRequest) XXX_Unmarshal(b []byte) error

type PublishRequest

type PublishRequest struct {
	Topic                string     `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
	Event                *types.Any `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

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

func (*PublishRequest) XXX_DiscardUnknown added in v1.3.0

func (m *PublishRequest) XXX_DiscardUnknown()

func (*PublishRequest) XXX_Marshal added in v1.3.0

func (m *PublishRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PublishRequest) XXX_Merge added in v1.3.0

func (m *PublishRequest) XXX_Merge(src proto.Message)

func (*PublishRequest) XXX_Size added in v1.3.0

func (m *PublishRequest) XXX_Size() int

func (*PublishRequest) XXX_Unmarshal added in v1.3.0

func (m *PublishRequest) XXX_Unmarshal(b []byte) error

type SubscribeRequest

type SubscribeRequest struct {
	Filters              []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

func (*SubscribeRequest) XXX_DiscardUnknown added in v1.3.0

func (m *SubscribeRequest) XXX_DiscardUnknown()

func (*SubscribeRequest) XXX_Marshal added in v1.3.0

func (m *SubscribeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SubscribeRequest) XXX_Merge added in v1.3.0

func (m *SubscribeRequest) XXX_Merge(src proto.Message)

func (*SubscribeRequest) XXX_Size added in v1.3.0

func (m *SubscribeRequest) XXX_Size() int

func (*SubscribeRequest) XXX_Unmarshal added in v1.3.0

func (m *SubscribeRequest) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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