transfer

package
v1.10.3 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(x *Transfer)

func SetJetStream

func SetJetStream(v nats.JetStreamContext) Option

func SetNamespace

func SetNamespace(v string) Option

type Payload

type Payload struct {
	Timestamp time.Time              `msgpack:"timestamp"`
	Data      map[string]interface{} `msgpack:"data"`
	XData     map[string]interface{} `msgpack:"xdata"`
}

type StreamOption

type StreamOption struct {
	Key         string `msgpack:"key"`
	Description string `msgpack:"description"`
}

type Transfer

type Transfer struct {
	Namespace string
	Js        nats.JetStreamContext
	KeyValue  nats.KeyValue
}

func New

func New(options ...Option) (x *Transfer, err error)

func (*Transfer) Get

func (x *Transfer) Get(key string) (result map[string]interface{}, err error)

func (*Transfer) Publish

func (x *Transfer) Publish(ctx context.Context, key string, payload Payload) (err error)

func (*Transfer) Remove

func (x *Transfer) Remove(key string) (err error)

func (*Transfer) Set

func (x *Transfer) Set(ctx context.Context, option StreamOption) (err error)

func (*Transfer) Update

func (x *Transfer) Update(ctx context.Context, option StreamOption) (err error)

Jump to

Keyboard shortcuts

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