Documentation
¶
Index ¶
- Constants
- func ConsumeAll(nc *nats.Conn, streamName string, subject string, handler HandlerFunc) error
- func ConsumeAllMessagesSync(nc *nats.Conn, streamName string, subject string, handler HandlerFunc) error
- func ConsumeMessages(nc *nats.Conn, streamName string, subject string, durable string, ...) (jetstream.ConsumeContext, error)
- func ConsumeMessagesNoAck(nc *nats.Conn, streamName string, subject string, durable string, ...) (jetstream.ConsumeContext, error)
- func GetHeader(headers map[string][]string, name string) string
- func NKeySignatureHandler(seed string, b []byte) ([]byte, error)
- type HandlerFunc
- type HandlerFuncNoAck
- type KeyHistory
- type NatsConnPool
- type Stream
- func (this *Stream) AddKeyValue(bucket string, key string, value []byte) error
- func (s *Stream) Close() error
- func (this *Stream) CreateBucket(bucket string, history int, ttl time.Duration) (jetstream.KeyValue, error)
- func (s *Stream) CreateConsumer(stream string, durable string) (jetstream.Consumer, error)
- func (s *Stream) CreateStream(subjects []string) (jetstream.Stream, error)
- func (s *Stream) CreateStreamWithConfig(subjects []string, config jetstream.StreamConfig) (jetstream.Stream, error)
- func (s *Stream) CreateStreamWithDomain(domain string, subjects []string) (jetstream.Stream, error)
- func (s *Stream) CreateStreamWithDomainConfig(domain string, subjects []string, config jetstream.StreamConfig) (jetstream.Stream, error)
- func (this *Stream) DeleteKeyValue(bucket string, key string) error
- func (s *Stream) FetchAll(filters []string, startTime *time.Time) ([][]byte, error)
- func (this *Stream) GetKVs(bucket string) (map[string][]byte, error)
- func (this *Stream) GetKeyHistory(bucket string, key string) error
- func (this *Stream) GetKeys(bucket string) ([]string, error)
- func (s *Stream) GetMessageByID(j jetstream.Stream, sequence uint64) ([]byte, error)
- func (s *Stream) GetMessageBySequence(sequence uint64) ([]byte, error)
- func (s *Stream) GetName() string
- func (s *Stream) GetStream(name string) (jetstream.Stream, error)
- func (this *Stream) GetValueByKey(bucket string, key string) ([]byte, error)
- func (this *Stream) KVWatcher(bucket string, cfunc func(string, string, []byte)) error
- func (s *Stream) LastBySubject(filters []string) ([]byte, error)
- func (s *Stream) LastPerSubject(filters []string) (map[string][][]byte, error)
- func (s *Stream) Publish(subject string, payload []byte) (*jetstream.PubAck, error)
- func (s *Stream) PublishMsg(subject string, payload []byte, publisher string) (*jetstream.PubAck, error)
- func (s *Stream) PublishMsgWithHeader(subject string, payload []byte, header map[string][]string) (*jetstream.PubAck, error)
- func (s *Stream) PurgeStream(name string) error
- func (s *Stream) PurgeSubject(subject string) error
- func (this *Stream) PutKeyValue(bucket string, key string, value []byte) error
- func (this *Stream) UpdateKeyValue(bucket string, key string, value []byte, revision uint64) error
Constants ¶
View Source
const ( FETCH_NO_WAIT = 1000000 MAX_ACK_PENDING = -1 //unlimited MAX_DELIVERY = -1 // unlimited MAX_BYTES = -1 // unlimited PublishedByHeader = "publishedBy" )
View Source
const (
CONN_POOL_SIZE = 100
)
Variables ¶
This section is empty.
Functions ¶
func ConsumeAll ¶ added in v0.2.28
func ConsumeAll(nc *nats.Conn, streamName string, subject string, handler HandlerFunc) error
func ConsumeAllMessagesSync ¶ added in v0.2.23
func ConsumeAllMessagesSync(nc *nats.Conn, streamName string, subject string, handler HandlerFunc) error
func ConsumeMessages ¶ added in v0.2.12
func ConsumeMessages(nc *nats.Conn, streamName string, subject string, durable string, handler HandlerFunc) (jetstream.ConsumeContext, error)
func ConsumeMessagesNoAck ¶ added in v0.2.24
func ConsumeMessagesNoAck(nc *nats.Conn, streamName string, subject string, durable string, handler HandlerFuncNoAck) (jetstream.ConsumeContext, error)
Types ¶
type HandlerFunc ¶ added in v0.2.22
type HandlerFuncNoAck ¶ added in v0.2.24
type KeyHistory ¶
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 NewStreamWithConn ¶ added in v0.2.12
func NewStreamWithConnPool ¶ added in v0.2.12
func (*Stream) AddKeyValue ¶
func (*Stream) CreateBucket ¶
func (*Stream) CreateConsumer ¶
func (*Stream) CreateStream ¶
func (*Stream) CreateStreamWithConfig ¶ added in v0.2.9
func (*Stream) CreateStreamWithDomain ¶ added in v0.2.17
func (*Stream) CreateStreamWithDomainConfig ¶ added in v0.2.17
func (*Stream) GetMessageByID ¶
func (*Stream) GetMessageBySequence ¶
func (*Stream) GetValueByKey ¶
func (*Stream) LastBySubject ¶ added in v0.2.12
func (*Stream) LastPerSubject ¶ added in v0.2.12
func (*Stream) PublishMsg ¶
func (*Stream) PublishMsgWithHeader ¶ added in v0.2.22
func (*Stream) PurgeStream ¶ added in v0.2.28
func (*Stream) PurgeSubject ¶ added in v0.2.22
func (*Stream) PutKeyValue ¶
Click to show internal directories.
Click to hide internal directories.