jetstream

package
v0.0.0-...-76fafce Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_stream_message_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Stream

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

func NewStream

func NewStream(streamName string, js nats.JetStreamContext, logger zerolog.Logger) *Stream

func (*Stream) Publish

func (s *Stream) Publish(ctx context.Context, topicName string, rawMsg am.Message) (err error)

func (*Stream) Subscribe

func (s *Stream) Subscribe(topicName string, handler am.MessageHandler, options ...am.SubscriberOption) (am.Subscription, error)

func (*Stream) Unsubscribe

func (s *Stream) Unsubscribe() error

type StreamMessage

type StreamMessage struct {
	Id       string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name     string                 `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Data     []byte                 `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	Metadata *structpb.Struct       `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"`
	SentAt   *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=sent_at,json=sentAt,proto3" json:"sent_at,omitempty"`
	// contains filtered or unexported fields
}

func (*StreamMessage) Descriptor deprecated

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

Deprecated: Use StreamMessage.ProtoReflect.Descriptor instead.

func (*StreamMessage) GetData

func (x *StreamMessage) GetData() []byte

func (*StreamMessage) GetId

func (x *StreamMessage) GetId() string

func (*StreamMessage) GetMetadata

func (x *StreamMessage) GetMetadata() *structpb.Struct

func (*StreamMessage) GetName

func (x *StreamMessage) GetName() string

func (*StreamMessage) GetSentAt

func (x *StreamMessage) GetSentAt() *timestamppb.Timestamp

func (*StreamMessage) ProtoMessage

func (*StreamMessage) ProtoMessage()

func (*StreamMessage) ProtoReflect

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

func (*StreamMessage) Reset

func (x *StreamMessage) Reset()

func (*StreamMessage) String

func (x *StreamMessage) String() string

Jump to

Keyboard shortcuts

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