transfer

package module
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: BSD-3-Clause Imports: 5 Imported by: 3

README

Weplanx Transfer

GitHub Workflow Status Release Coveralls github GitHub go.mod Go version Go Report Card GitHub license

The log transmission client is based on the push mode. Its function is to manage the log stream queues in a unified manner, to cut and buffer the log data written at high frequency, and to supplement the reliability of the non-highly available log system. It works with the same namespace. The log collection service of the log collection service writes to the log system

License

BSD-3-Clause License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogOption added in v1.6.0

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

type Option

type Option func(x *Transfer)

func SetJetStream added in v1.6.0

func SetJetStream(v nats.JetStreamContext) Option

func SetNamespace added in v1.6.0

func SetNamespace(v string) Option

type Payload

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

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 LogOption) (err error)

Jump to

Keyboard shortcuts

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