streams

package
v0.2.15 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	FETCH_NO_WAIT   = 100000
	MAX_ACK_PENDING = -1 //unlimited
	MAX_DELIVERY    = -1 // unlimited
	MAX_BYTES       = -1 // unlimited
)
View Source
const (
	CONN_POOL_SIZE = 100
)

Variables

This section is empty.

Functions

func ConsumeMessages added in v0.2.12

func ConsumeMessages(nc *nats.Conn, streamName string, subject string, durable string, handler handlerFunc) (jetstream.ConsumeContext, error)

func GetHeader added in v0.2.12

func GetHeader(headers map[string][]string, name string) string

func NKeySignatureHandler added in v0.2.12

func NKeySignatureHandler(seed string, b []byte) ([]byte, error)

Types

type KeyHistory

type KeyHistory struct {
	Created  time.Time `json:"created"`
	Revision uint64    `json:"revision"`
	Value    string    `json:"value"`
}

type NatsConnPool added in v0.2.12

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

func NewNatsConnPool added in v0.2.12

func NewNatsConnPool(url string, options ...nats.Option) *NatsConnPool

func (*NatsConnPool) Close added in v0.2.12

func (this *NatsConnPool) Close() error

func (*NatsConnPool) GetConnection added in v0.2.12

func (this *NatsConnPool) GetConnection() (*nats.Conn, error)

type Stream

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

func NewStream

func NewStream(url string, streamName string) (*Stream, error)

func NewStreamWithConn added in v0.2.12

func NewStreamWithConn(nc *nats.Conn, streamName string) *Stream

func NewStreamWithConnPool added in v0.2.12

func NewStreamWithConnPool(url string, streamName string, options ...nats.Option) *Stream

func (*Stream) AddKeyValue

func (this *Stream) AddKeyValue(bucket string, key string, value []byte) error

func (*Stream) Close added in v0.2.2

func (s *Stream) Close() error

func (*Stream) CreateBucket

func (this *Stream) CreateBucket(bucket string, history int, ttl time.Duration) (jetstream.KeyValue, error)

func (*Stream) CreateConsumer

func (s *Stream) CreateConsumer(stream string, durable string) (jetstream.Consumer, error)

func (*Stream) CreateStream

func (s *Stream) CreateStream(subjects []string) (jetstream.Stream, error)

func (*Stream) CreateStreamWithConfig added in v0.2.9

func (s *Stream) CreateStreamWithConfig(subjects []string, config jetstream.StreamConfig) (jetstream.Stream, error)

func (*Stream) DeleteKeyValue

func (this *Stream) DeleteKeyValue(bucket string, key string) error

func (*Stream) FetchAll added in v0.2.12

func (s *Stream) FetchAll(filters []string, startTime *time.Time) ([][]byte, error)

func (*Stream) GetKVs

func (this *Stream) GetKVs(bucket string) (map[string][]byte, error)

func (*Stream) GetKeyHistory

func (this *Stream) GetKeyHistory(bucket string, key string) error

func (*Stream) GetKeys

func (this *Stream) GetKeys(bucket string) ([]string, error)

func (*Stream) GetMessageByID

func (s *Stream) GetMessageByID(j jetstream.Stream, sequence uint64) ([]byte, error)

func (*Stream) GetMessageBySequence

func (s *Stream) GetMessageBySequence(stream string, sequence uint64) ([]byte, error)

func (*Stream) GetStream

func (s *Stream) GetStream(name string) (jetstream.Stream, error)

func (*Stream) GetValueByKey

func (this *Stream) GetValueByKey(bucket string, key string) ([]byte, error)

func (*Stream) LastBySubject added in v0.2.12

func (s *Stream) LastBySubject(filters []string) ([]byte, error)

func (*Stream) LastPerSubject added in v0.2.12

func (s *Stream) LastPerSubject(filters []string) (map[string][][]byte, error)

func (*Stream) Publish

func (s *Stream) Publish(subject string, payload []byte) (*jetstream.PubAck, error)

func (*Stream) PublishMsg

func (s *Stream) PublishMsg(subject string, payload []byte, publisher string) (*jetstream.PubAck, error)

func (*Stream) PutKeyValue

func (this *Stream) PutKeyValue(bucket string, key string, value []byte) error

func (*Stream) UpdateKeyValue

func (this *Stream) UpdateKeyValue(bucket string, key string, value []byte, revision uint64) error

Jump to

Keyboard shortcuts

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