nats

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithConn

func WithConn(name string, conn *nats.Conn) xtemplate.Option

func WithConnOptions

func WithConnOptions(name string, options *nats.Options) xtemplate.Option

func WithConnUrl

func WithConnUrl(name string, url string, opts ...nats.Option) xtemplate.Option

func WithKV

func WithKV(name string, kv jetstream.KeyValue) xtemplate.Option

func WithKVUrl

func WithKVUrl(name, bucket, url string, opts ...nats.Option) xtemplate.Option

Types

type DotKV

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

func (*DotKV) Delete

func (d *DotKV) Delete(key string) error

func (*DotKV) Get

func (d *DotKV) Get(key string) (string, error)

func (*DotKV) Purge

func (d *DotKV) Purge(key string) error

func (*DotKV) Put

func (d *DotKV) Put(key, value string) error

func (*DotKV) Watch

func (d *DotKV) Watch(keys string) (<-chan jetstream.KeyValueEntry, error)

type DotKVProvider

type DotKVProvider struct {
	KV jetstream.KeyValue
	// contains filtered or unexported fields
}

func (DotKVProvider) New

func (DotKVProvider) Type

func (DotKVProvider) Type() string

func (*DotKVProvider) UnmarshalJSON

func (d *DotKVProvider) UnmarshalJSON(b []byte) error

func (*DotKVProvider) UnmarshalText

func (d *DotKVProvider) UnmarshalText(b []byte) error

func (*DotKVProvider) Value

func (d *DotKVProvider) Value(r xtemplate.Request) (any, error)

type DotNats

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

func (*DotNats) Publish

func (d *DotNats) Publish(subject, message string) error

func (*DotNats) Subscribe

func (d *DotNats) Subscribe(subject string) (<-chan *nats.Msg, error)

type DotNatsProvider

type DotNatsProvider struct {
	Conn *nats.Conn
	// contains filtered or unexported fields
}

func (DotNatsProvider) New

func (DotNatsProvider) Type

func (DotNatsProvider) Type() string

func (*DotNatsProvider) UnmarshalJSON

func (d *DotNatsProvider) UnmarshalJSON(b []byte) error

func (*DotNatsProvider) UnmarshalText

func (d *DotNatsProvider) UnmarshalText(b []byte) error

func (*DotNatsProvider) Value

func (d *DotNatsProvider) Value(r xtemplate.Request) (any, error)

Jump to

Keyboard shortcuts

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