client

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: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrEmptyParams        = errors.ConstError("empty params")
	ErrInsufficientParams = errors.ConstError("insufficient params")
	ErrHeadUnavailable    = errors.ConstError("latest head is not available")
)
View Source
const (
	ErrUnsupportedMethod = errors.ConstError("unsupported method")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	NetworkId uint64
	ChainId   uint64
	// contains filtered or unexported fields
}

func NewClient

func NewClient(networkId uint64, chainId uint64, conn *nats.Conn, js nats.JetStreamContext, log *zap.Logger) Client

func (*Client) Init

func (c *Client) Init(ctx context.Context) error

func (*Client) Invoke

func (c *Client) Invoke(ctx context.Context, req *pjrpc.Request, resp *pjrpc.Response) error

type Handler

type Handler = func(ctx context.Context, req *pjrpc.Request, resp *pjrpc.Response)

type Router

type Router struct {
	SubjectPrefix string
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter(conn *nats.Conn, ht *tracking.HeadTracker, subjectPrefix string, log *zap.Logger) Router

func (*Router) Route

func (r *Router) Route(ctx context.Context, req *pjrpc.Request, resp *pjrpc.Response)

Jump to

Keyboard shortcuts

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