events

package
v0.2.8-alpha Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	StreamName     string = "CUSTODIAL"
	StreamSubjects string = "CUSTODIAL.*"
	// Subjects
	AccountNewNonce    string = "CUSTODIAL.accountNewNonce"
	AccountRegister    string = "CUSTODIAL.accountRegister"
	AccountGiftGas     string = "CUSTODIAL.systemNewAccountGas"
	AccountGiftVoucher string = "CUSTODIAL.systemNewAccountVoucher"
	AccountRefillGas   string = "CUSTODIAL.systemRefillAccountGas"
	DispatchFail       string = "CUSTODIAL.dispatchFail"
	DispatchSuccess    string = "CUSTODIAL.dispatchSuccess"
	SignTransfer       string = "CUSTODIAL.signTransfer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EventEmitter

type EventEmitter interface {
	Close()
	Publish(subject string, dedupId string, eventPayload interface{}) error
}

func NewJetStreamEventEmitter

func NewJetStreamEventEmitter(o JetStreamOpts) (EventEmitter, error)

type EventPayload

type EventPayload struct {
	OtxId      uint   `json:"otxId"`
	TrackingId string `json:"trackingId"`
	TxHash     string `json:"txHash"`
}

type JetStream

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

func (*JetStream) Close

func (js *JetStream) Close()

Close gracefully shutdowns the JetStream connection.

func (*JetStream) Publish

func (js *JetStream) Publish(subject string, dedupId string, eventPayload interface{}) error

Publish publishes the JSON data to the NATS stream.

type JetStreamOpts

type JetStreamOpts struct {
	ServerUrl       string
	PersistDuration time.Duration
	DedupDuration   time.Duration
}

Jump to

Keyboard shortcuts

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