msg

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package msg defines the interface for different message brokers.

Index

Constants

View Source
const (
	EXIT    = -1
	ADDRESS = 0
	TX      = 1
)

Types of object for wallet requests.

View Source
const (
	LISTEN   = 0
	UNLISTEN = 1
)

Actions to be applied to objects for wallet requests.

Variables

This section is empty.

Functions

This section is empty.

Types

type MsgBroker

type MsgBroker interface {
	Setup(interface{}) error
	Close() error

	// methods for wallet service
	SendRequest(net string, r WalletReq) error
	GetEvents(net string, mut *sync.Mutex) (<-chan types.Trans, <-chan error, error)

	// methods for explorer service
	GetReqs(net string, mut *sync.Mutex) (<-chan WalletReq, <-chan error, error)
	SendTrans(net string, t []types.Trans) error
}

type WalletReq added in v0.2.2

type WalletReq struct {
	Net  string `json:"net"`
	Type int    `json:"type"` // type of object
	Obj  string `json:"obj"`
	Act  int    `json:"act"` // action to be applied
}

WalletReq defines the message that wallet service publishes to explorer to ask to explore an object.

Directories

Path Synopsis
Package amqp implements the message broker interface for AMQP compliant brokers (ie RabbitMQ).
Package amqp implements the message broker interface for AMQP compliant brokers (ie RabbitMQ).

Jump to

Keyboard shortcuts

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