stream

package
v0.0.0-...-4b7d064 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCloudEvent

func CreateCloudEvent(e *CloudEventInput) cloudevents.Event

Types

type CloudEventInput

type CloudEventInput struct {
	Id          string
	Source      string
	EventType   string
	PublishedAt time.Time
	Data        interface{}
}

type EventStream

type EventStream struct {
	nats.JetStreamContext
}

func (*EventStream) GetAllNewsEvents

func (es *EventStream) GetAllNewsEvents(subject string) []*nats.Msg

func (*EventStream) GetLastEvent

func (es *EventStream) GetLastEvent(subject string) *nats.Msg

func (*EventStream) PublishCloudEvent

func (es *EventStream) PublishCloudEvent(input *CloudEventInput)

type StreamServer

type StreamServer struct {
	*server.Server
}

func Setup

func Setup() *StreamServer

func (*StreamServer) Connect

func (stream *StreamServer) Connect(name string) (*nats.Conn, *EventStream)

Jump to

Keyboard shortcuts

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