pub

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MinimalTxInfo

type MinimalTxInfo struct {
	Block           uint64 `json:"block"`
	From            string `json:"from"`
	To              string `json:"to"`
	ContractAddress string `json:"contractAddress"`
	Success         bool   `json:"success"`
	Timestamp       uint64 `json:"timestamp"`
	TxHash          string `json:"transactionHash"`
	TxIndex         uint   `json:"transactionIndex"`
	TXType          string `json:"txType"`
	Value           uint64 `json:"value"`
}

type Pub

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

func NewPub

func NewPub(o PubOpts) (*Pub, error)

func (*Pub) Close

func (p *Pub) Close()

Close gracefully shutdowns the JetStream connection.

func (*Pub) Publish

func (p *Pub) Publish(subject string, dedupId string, eventPayload interface{}) error

Publish publishes the JSON data to the NATS stream.

type PubOpts

type PubOpts struct {
	DedupDuration   time.Duration
	JsCtx           nats.JetStreamContext
	NatsConn        *nats.Conn
	PersistDuration time.Duration
}

Jump to

Keyboard shortcuts

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