cloudevents

package
v0.0.0-...-1334a7b Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CloudEvents_Send_FullMethodName = "/vanus.core.cloudevents.CloudEvents/Send"
)
View Source
const (
	// ContentTypeProtobuf indicates that the data attribute is a protobuf message.
	ContentTypeProtobuf = "application/protobuf"
)

Variables

View Source
var CloudEvents_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "vanus.core.cloudevents.CloudEvents",
	HandlerType: (*CloudEventsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Send",
			Handler:    _CloudEvents_Send_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "vanus/core/cloudevents/cloudevents.proto",
}

CloudEvents_ServiceDesc is the grpc.ServiceDesc for CloudEvents 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_vanus_core_cloudevents_cloudevents_proto protoreflect.FileDescriptor

Functions

func FromProto

func FromProto(container *CloudEvent) (*event.Event, error)

FromProto Convert from a protobuf variant into the generic, SDK event.

func RegisterCloudEventsServer

func RegisterCloudEventsServer(s grpc.ServiceRegistrar, srv CloudEventsServer)

Types

type BatchEvent

type BatchEvent struct {
	Events     *CloudEventBatch `protobuf:"bytes,2,opt,name=events,proto3" json:"events,omitempty"`
	EventbusId uint64           `protobuf:"varint,3,opt,name=eventbus_id,json=eventbusId,proto3" json:"eventbus_id,omitempty"`
	// contains filtered or unexported fields
}

func (*BatchEvent) Descriptor deprecated

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

Deprecated: Use BatchEvent.ProtoReflect.Descriptor instead.

func (*BatchEvent) GetEventbusId

func (x *BatchEvent) GetEventbusId() uint64

func (*BatchEvent) GetEvents

func (x *BatchEvent) GetEvents() *CloudEventBatch

func (*BatchEvent) ProtoMessage

func (*BatchEvent) ProtoMessage()

func (*BatchEvent) ProtoReflect

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

func (*BatchEvent) Reset

func (x *BatchEvent) Reset()

func (*BatchEvent) String

func (x *BatchEvent) String() string

type CloudEvent

type CloudEvent struct {

	// Required Attributes
	Id          string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Source      string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` // URI-reference
	SpecVersion string `protobuf:"bytes,3,opt,name=spec_version,json=specVersion,proto3" json:"spec_version,omitempty"`
	Type        string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"`
	// Optional & Extension Attributes
	Attributes map[string]*CloudEvent_CloudEventAttributeValue `` /* 161-byte string literal not displayed */
	// -- CloudEvent Data (Bytes, Text, or Proto)
	//
	// Types that are assignable to Data:
	//
	//	*CloudEvent_BinaryData
	//	*CloudEvent_TextData
	//	*CloudEvent_ProtoData
	Data isCloudEvent_Data `protobuf_oneof:"data"`
	// contains filtered or unexported fields
}

func ToProto

func ToProto(e *event.Event) (*CloudEvent, error)

ToProto convert an SDK event to a protobuf variant of the event that can be marshaled.

func (*CloudEvent) Descriptor deprecated

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

Deprecated: Use CloudEvent.ProtoReflect.Descriptor instead.

func (*CloudEvent) GetAttributes

func (x *CloudEvent) GetAttributes() map[string]*CloudEvent_CloudEventAttributeValue

func (*CloudEvent) GetBinaryData

func (x *CloudEvent) GetBinaryData() []byte

func (*CloudEvent) GetData

func (m *CloudEvent) GetData() isCloudEvent_Data

func (*CloudEvent) GetId

func (x *CloudEvent) GetId() string

func (*CloudEvent) GetProtoData

func (x *CloudEvent) GetProtoData() *anypb.Any

func (*CloudEvent) GetSource

func (x *CloudEvent) GetSource() string

func (*CloudEvent) GetSpecVersion

func (x *CloudEvent) GetSpecVersion() string

func (*CloudEvent) GetTextData

func (x *CloudEvent) GetTextData() string

func (*CloudEvent) GetType

func (x *CloudEvent) GetType() string

func (*CloudEvent) ProtoMessage

func (*CloudEvent) ProtoMessage()

func (*CloudEvent) ProtoReflect

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

func (*CloudEvent) Reset

func (x *CloudEvent) Reset()

func (*CloudEvent) String

func (x *CloudEvent) String() string

type CloudEventBatch

type CloudEventBatch struct {
	Events []*CloudEvent `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"`
	// contains filtered or unexported fields
}

func (*CloudEventBatch) Descriptor deprecated

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

Deprecated: Use CloudEventBatch.ProtoReflect.Descriptor instead.

func (*CloudEventBatch) GetEvents

func (x *CloudEventBatch) GetEvents() []*CloudEvent

func (*CloudEventBatch) ProtoMessage

func (*CloudEventBatch) ProtoMessage()

func (*CloudEventBatch) ProtoReflect

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

func (*CloudEventBatch) Reset

func (x *CloudEventBatch) Reset()

func (*CloudEventBatch) String

func (x *CloudEventBatch) String() string

type CloudEvent_BinaryData

type CloudEvent_BinaryData struct {
	BinaryData []byte `protobuf:"bytes,6,opt,name=binary_data,json=binaryData,proto3,oneof"`
}

type CloudEvent_CloudEventAttributeValue

type CloudEvent_CloudEventAttributeValue struct {

	// Types that are assignable to Attr:
	//
	//	*CloudEvent_CloudEventAttributeValue_CeBoolean
	//	*CloudEvent_CloudEventAttributeValue_CeInteger
	//	*CloudEvent_CloudEventAttributeValue_CeString
	//	*CloudEvent_CloudEventAttributeValue_CeBytes
	//	*CloudEvent_CloudEventAttributeValue_CeUri
	//	*CloudEvent_CloudEventAttributeValue_CeUriRef
	//	*CloudEvent_CloudEventAttributeValue_CeTimestamp
	Attr isCloudEvent_CloudEventAttributeValue_Attr `protobuf_oneof:"attr"`
	// contains filtered or unexported fields
}

func (*CloudEvent_CloudEventAttributeValue) Descriptor deprecated

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

Deprecated: Use CloudEvent_CloudEventAttributeValue.ProtoReflect.Descriptor instead.

func (*CloudEvent_CloudEventAttributeValue) GetAttr

func (m *CloudEvent_CloudEventAttributeValue) GetAttr() isCloudEvent_CloudEventAttributeValue_Attr

func (*CloudEvent_CloudEventAttributeValue) GetCeBoolean

func (x *CloudEvent_CloudEventAttributeValue) GetCeBoolean() bool

func (*CloudEvent_CloudEventAttributeValue) GetCeBytes

func (x *CloudEvent_CloudEventAttributeValue) GetCeBytes() []byte

func (*CloudEvent_CloudEventAttributeValue) GetCeInteger

func (x *CloudEvent_CloudEventAttributeValue) GetCeInteger() int32

func (*CloudEvent_CloudEventAttributeValue) GetCeString

func (*CloudEvent_CloudEventAttributeValue) GetCeTimestamp

func (*CloudEvent_CloudEventAttributeValue) GetCeUri

func (*CloudEvent_CloudEventAttributeValue) GetCeUriRef

func (*CloudEvent_CloudEventAttributeValue) ProtoMessage

func (*CloudEvent_CloudEventAttributeValue) ProtoMessage()

func (*CloudEvent_CloudEventAttributeValue) ProtoReflect

func (*CloudEvent_CloudEventAttributeValue) Reset

func (*CloudEvent_CloudEventAttributeValue) String

type CloudEvent_CloudEventAttributeValue_CeBoolean

type CloudEvent_CloudEventAttributeValue_CeBoolean struct {
	CeBoolean bool `protobuf:"varint,1,opt,name=ce_boolean,json=ceBoolean,proto3,oneof"`
}

type CloudEvent_CloudEventAttributeValue_CeBytes

type CloudEvent_CloudEventAttributeValue_CeBytes struct {
	CeBytes []byte `protobuf:"bytes,4,opt,name=ce_bytes,json=ceBytes,proto3,oneof"`
}

type CloudEvent_CloudEventAttributeValue_CeInteger

type CloudEvent_CloudEventAttributeValue_CeInteger struct {
	CeInteger int32 `protobuf:"varint,2,opt,name=ce_integer,json=ceInteger,proto3,oneof"`
}

type CloudEvent_CloudEventAttributeValue_CeString

type CloudEvent_CloudEventAttributeValue_CeString struct {
	CeString string `protobuf:"bytes,3,opt,name=ce_string,json=ceString,proto3,oneof"`
}

type CloudEvent_CloudEventAttributeValue_CeTimestamp

type CloudEvent_CloudEventAttributeValue_CeTimestamp struct {
	CeTimestamp *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=ce_timestamp,json=ceTimestamp,proto3,oneof"`
}

type CloudEvent_CloudEventAttributeValue_CeUri

type CloudEvent_CloudEventAttributeValue_CeUri struct {
	CeUri string `protobuf:"bytes,5,opt,name=ce_uri,json=ceUri,proto3,oneof"`
}

type CloudEvent_CloudEventAttributeValue_CeUriRef

type CloudEvent_CloudEventAttributeValue_CeUriRef struct {
	CeUriRef string `protobuf:"bytes,6,opt,name=ce_uri_ref,json=ceUriRef,proto3,oneof"`
}

type CloudEvent_ProtoData

type CloudEvent_ProtoData struct {
	ProtoData *anypb.Any `protobuf:"bytes,8,opt,name=proto_data,json=protoData,proto3,oneof"`
}

type CloudEvent_TextData

type CloudEvent_TextData struct {
	TextData string `protobuf:"bytes,7,opt,name=text_data,json=textData,proto3,oneof"`
}

type CloudEventsClient

type CloudEventsClient interface {
	Send(ctx context.Context, in *BatchEvent, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

CloudEventsClient is the client API for CloudEvents 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.

type CloudEventsServer

type CloudEventsServer interface {
	Send(context.Context, *BatchEvent) (*emptypb.Empty, error)
}

CloudEventsServer is the server API for CloudEvents service. All implementations should embed UnimplementedCloudEventsServer for forward compatibility

type UnimplementedCloudEventsServer

type UnimplementedCloudEventsServer struct {
}

UnimplementedCloudEventsServer should be embedded to have forward compatible implementations.

func (UnimplementedCloudEventsServer) Send

type UnsafeCloudEventsServer

type UnsafeCloudEventsServer interface {
	// contains filtered or unexported methods
}

UnsafeCloudEventsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CloudEventsServer will result in compilation errors.

Jump to

Keyboard shortcuts

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