rpc

package
v0.0.0-...-d9a1657 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderMethod = "method"
	HeaderErr    = "error"

	ErrMethodHeaderNotFound = errors.ConstError("method header not found")
)

Variables

This section is empty.

Functions

func RespondWithError

func RespondWithError(msg *nats.Msg, err error) error

Types

type Handlers

type Handlers struct {
	Options Options
	// contains filtered or unexported fields
}

func NewHandlers

func NewHandlers(
	log *zap.Logger,
	conn *nats.Conn,
	session *web3.Session,
	endpointPrefix string,
	blockIndex *storage.BlockIndex,
	handler func(msg *nats.Msg),
	options ...Option) (*Handlers, error)

func (*Handlers) ClientSubject

func (r *Handlers) ClientSubject() string

func (*Handlers) HandleMsgs

func (r *Handlers) HandleMsgs() error

func (*Handlers) Init

func (r *Handlers) Init() error

func (*Handlers) Prune

func (r *Handlers) Prune() (err error)

func (*Handlers) Register

func (r *Handlers) Register(block *web3.BlockHeader) error

func (*Handlers) Shutdown

func (r *Handlers) Shutdown() error

type Option

type Option func(opts *Options) error

func Concurrency

func Concurrency(concurrency int) Option

func QueueName

func QueueName(name string) Option

type Options

type Options struct {
	Concurrency int
	QueueName   string
}

func GetDefaultOptions

func GetDefaultOptions() Options

Jump to

Keyboard shortcuts

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