event

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_event_proto protoreflect.FileDescriptor

Functions

func NewEventEndpoints

func NewEventEndpoints() []*api.Endpoint

func RegisterEventHandler

func RegisterEventHandler(s server.Server, hdlr EventHandler, opts ...server.HandlerOption) error

Types

type ConsumeRequest

type ConsumeRequest struct {

	// The topic to subscribe to
	Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
	// Optional group for the subscription
	Group string `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"`
	// Optional offset to read from e.g "2006-01-02T15:04:05.999Z07:00"
	Offset string `protobuf:"bytes,3,opt,name=offset,proto3" json:"offset,omitempty"`
	// contains filtered or unexported fields
}

Consume events from a given topic.

func (*ConsumeRequest) Descriptor deprecated

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

Deprecated: Use ConsumeRequest.ProtoReflect.Descriptor instead.

func (*ConsumeRequest) GetGroup

func (x *ConsumeRequest) GetGroup() string

func (*ConsumeRequest) GetOffset

func (x *ConsumeRequest) GetOffset() string

func (*ConsumeRequest) GetTopic

func (x *ConsumeRequest) GetTopic() string

func (*ConsumeRequest) ProtoMessage

func (*ConsumeRequest) ProtoMessage()

func (*ConsumeRequest) ProtoReflect

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

func (*ConsumeRequest) Reset

func (x *ConsumeRequest) Reset()

func (*ConsumeRequest) String

func (x *ConsumeRequest) String() string

type ConsumeResponse

type ConsumeResponse struct {

	// The topic subscribed to
	Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
	// Unique message id
	Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	// Timestamp of publishing
	Timestamp string `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// The next json message on the topic
	Message *structpb.Struct `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

A blocking event will be returned in response.

func (*ConsumeResponse) Descriptor deprecated

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

Deprecated: Use ConsumeResponse.ProtoReflect.Descriptor instead.

func (*ConsumeResponse) GetId

func (x *ConsumeResponse) GetId() string

func (*ConsumeResponse) GetMessage

func (x *ConsumeResponse) GetMessage() *structpb.Struct

func (*ConsumeResponse) GetTimestamp

func (x *ConsumeResponse) GetTimestamp() string

func (*ConsumeResponse) GetTopic

func (x *ConsumeResponse) GetTopic() string

func (*ConsumeResponse) ProtoMessage

func (*ConsumeResponse) ProtoMessage()

func (*ConsumeResponse) ProtoReflect

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

func (*ConsumeResponse) Reset

func (x *ConsumeResponse) Reset()

func (*ConsumeResponse) String

func (x *ConsumeResponse) String() string

type Ev

type Ev struct {

	// event id
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// event timestamp
	Timestamp string `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// event message
	Message *structpb.Struct `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*Ev) Descriptor deprecated

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

Deprecated: Use Ev.ProtoReflect.Descriptor instead.

func (*Ev) GetId

func (x *Ev) GetId() string

func (*Ev) GetMessage

func (x *Ev) GetMessage() *structpb.Struct

func (*Ev) GetTimestamp

func (x *Ev) GetTimestamp() string

func (*Ev) ProtoMessage

func (*Ev) ProtoMessage()

func (*Ev) ProtoReflect

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

func (*Ev) Reset

func (x *Ev) Reset()

func (*Ev) String

func (x *Ev) String() string

type EventService

type EventService interface {
	Publish(ctx context.Context, in *PublishRequest, opts ...client.CallOption) (*PublishResponse, error)
	Consume(ctx context.Context, in *ConsumeRequest, opts ...client.CallOption) (Event_ConsumeService, error)
	Read(ctx context.Context, in *ReadRequest, opts ...client.CallOption) (*ReadResponse, error)
}

func NewEventService

func NewEventService(name string, c client.Client) EventService

type Event_ConsumeService

type Event_ConsumeService interface {
	Context() context.Context
	SendMsg(interface{}) error
	RecvMsg(interface{}) error
	Close() error
	Recv() (*ConsumeResponse, error)
}

type Event_ConsumeStream

type Event_ConsumeStream interface {
	Context() context.Context
	SendMsg(interface{}) error
	RecvMsg(interface{}) error
	Close() error
	Send(*ConsumeResponse) error
}

type PublishRequest

type PublishRequest struct {

	// The topic to publish to
	Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
	// The json message to publish
	Message *structpb.Struct `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

Publish a event to the event stream.

func (*PublishRequest) Descriptor deprecated

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

Deprecated: Use PublishRequest.ProtoReflect.Descriptor instead.

func (*PublishRequest) GetMessage

func (x *PublishRequest) GetMessage() *structpb.Struct

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 PublishResponse

type PublishResponse struct {
	// contains filtered or unexported fields
}

func (*PublishResponse) Descriptor deprecated

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

Deprecated: Use PublishResponse.ProtoReflect.Descriptor instead.

func (*PublishResponse) ProtoMessage

func (*PublishResponse) ProtoMessage()

func (*PublishResponse) ProtoReflect

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

func (*PublishResponse) Reset

func (x *PublishResponse) Reset()

func (*PublishResponse) String

func (x *PublishResponse) String() string

type ReadRequest

type ReadRequest struct {

	// topic to read from
	Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
	// number of events to read; default 25
	Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	// offset for the events; default 0
	Offset int32 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"`
	// contains filtered or unexported fields
}

Read stored events

func (*ReadRequest) Descriptor deprecated

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

Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead.

func (*ReadRequest) GetLimit

func (x *ReadRequest) GetLimit() int32

func (*ReadRequest) GetOffset

func (x *ReadRequest) GetOffset() int32

func (*ReadRequest) GetTopic

func (x *ReadRequest) GetTopic() string

func (*ReadRequest) ProtoMessage

func (*ReadRequest) ProtoMessage()

func (*ReadRequest) ProtoReflect

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

func (*ReadRequest) Reset

func (x *ReadRequest) Reset()

func (*ReadRequest) String

func (x *ReadRequest) String() string

type ReadResponse

type ReadResponse struct {

	// the events
	Events []*Ev `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"`
	// contains filtered or unexported fields
}

func (*ReadResponse) Descriptor deprecated

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

Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead.

func (*ReadResponse) GetEvents

func (x *ReadResponse) GetEvents() []*Ev

func (*ReadResponse) ProtoMessage

func (*ReadResponse) ProtoMessage()

func (*ReadResponse) ProtoReflect

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

func (*ReadResponse) Reset

func (x *ReadResponse) Reset()

func (*ReadResponse) String

func (x *ReadResponse) String() string

Jump to

Keyboard shortcuts

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