jsonrpc

package
v0.0.39 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodMerryFund     = "merry_fund"
	MethodMerryUpdate   = "merry_update"
	MethodMerryVersion  = "merry_version"
	MethodMerryBitcoin  = "merry_bitcoin"
	MethodMerryArbitrum = "merry_arbitrum"
	MethodMerryEthereum = "merry_ethereum"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Fund(req RequestFund) error
	Update() error
	Version() (ResponseVersion, error)
	RelayBitcoin(req RequestRelay) (interface{}, error)
	RelayEthereum(req RequestRelay) (interface{}, error)
	RelayArbitrum(req RequestRelay) (interface{}, error)
}

func NewClient

func NewClient(c *http.Client, url string) Client

type Handler

type Handler interface {
	MerryFund(ctx context.Context, Request RequestFund) error
	MerryUpdate(ctx context.Context) error
	MerryVersion() ResponseVersion
	MerryRelay(ctx context.Context, service string, Request RequestRelay) (merry.Response, error)
}

func NewMerryHandler

func NewMerryHandler(merry *merry.Merry) Handler

type RequestFund

type RequestFund struct {
	To string `json:"to" binding:"required"`
}

type RequestRelay

type RequestRelay struct {
	Method  string          `json:"method" binding:"required"`
	Request json.RawMessage `json:"request" binding:"required"`
}

type ResponseRelay

type ResponseRelay interface{}

type ResponseVersion

type ResponseVersion struct {
	Version string `json:"version"`
	Commit  string `json:"commit"`
	Date    string `json:"date"`
}

type Server

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

func NewServer

func NewServer(logger *zap.Logger, engine *gin.Engine, handler Handler) *Server

func (*Server) Close

func (server *Server) Close() error

func (*Server) Start

func (server *Server) Start(port int) error

Jump to

Keyboard shortcuts

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