stream

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: May 5, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EphemeralSubject

func EphemeralSubject(stream string) string

func StreamSubject

func StreamSubject(stream string) string

Types

type Consumer

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

func (*Consumer) Peek

func (c *Consumer) Peek(stream string) (*Msg, error)

Peek reads last message from the stream. Returns nil if stream don't exists, or it is empty.

func (*Consumer) Read

func (c *Consumer) Read(ctx context.Context) <-chan *Msg

Read, Listen, Consume, Bind

type Factory

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

func Make

func Make() Factory

func (Factory) Consumer

func (f Factory) Consumer(stream string) (*Consumer, error)

func (Factory) Durable

func (f Factory) Durable(durableName string) Factory

func (Factory) Ephemeral

func (f Factory) Ephemeral() Factory

func (Factory) MaxAge

func (f Factory) MaxAge(m time.Duration) Factory

func (Factory) MaxMessages

func (f Factory) MaxMessages(m int) Factory

func (Factory) Publisher

func (f Factory) Publisher(stream string) (*Publisher, error)

func (Factory) Stream

func (f Factory) Stream(stream string) error

func (Factory) Subject

func (f Factory) Subject(s string) Factory

type Msg

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

func Peek

func Peek(stream string) (*Msg, error)

Peek reads last message from the stream. Returns nil if stream don't exists, or it is empty.

func (*Msg) Body

func (m *Msg) Body() []byte

func (*Msg) Done

func (m *Msg) Done()

func (*Msg) Header

func (m *Msg) Header() http.Header

func (*Msg) Sequence

func (m *Msg) Sequence() int

func (*Msg) Subject

func (m *Msg) Subject() string

func (*Msg) Time

func (m *Msg) Time() time.Time

type PubMsg

type PubMsg interface {
	Marshal() []byte
	Done()
}

type Publisher

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

func (*Publisher) Close

func (p *Publisher) Close()

func (*Publisher) Publish

func (p *Publisher) Publish(data []byte) error

func (*Publisher) PublishJSON

func (p *Publisher) PublishJSON(o interface{}) error

func (*Publisher) Write

func (p *Publisher) Write(in <-chan PubMsg)

Jump to

Keyboard shortcuts

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