client

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: BSD-3-Clause Imports: 5 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Js       nats.JetStreamContext
	KeyValue nats.KeyValue
}

func New

func New(js nats.JetStreamContext) (x *Client, err error)

func (*Client) Get

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

func (*Client) Publish

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

func (*Client) Remove

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

func (*Client) Set

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

func (*Client) Update

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

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"`
}

Jump to

Keyboard shortcuts

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