rpc

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JSONRPCEndpoint = "/feed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FeedInfoReply

type FeedInfoReply struct {
	Address string `json:"address"`
	Fee     uint64 `json:"fee"`
}

type FeedReply

type FeedReply struct {
	Feed []*manager.FeedObject `json:"feed"`
}

type JSONRPCClient

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

func NewJSONRPCClient

func NewJSONRPCClient(uri string) *JSONRPCClient

New creates a new client object.

func (*JSONRPCClient) Feed

func (cli *JSONRPCClient) Feed(ctx context.Context) ([]*manager.FeedObject, error)

func (*JSONRPCClient) FeedInfo

func (cli *JSONRPCClient) FeedInfo(ctx context.Context) (string, uint64, error)

type JSONRPCServer

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

func NewJSONRPCServer

func NewJSONRPCServer(m Manager) *JSONRPCServer

func (*JSONRPCServer) Feed

func (j *JSONRPCServer) Feed(req *http.Request, _ *struct{}, reply *FeedReply) (err error)

func (*JSONRPCServer) FeedInfo

func (j *JSONRPCServer) FeedInfo(req *http.Request, _ *struct{}, reply *FeedInfoReply) (err error)

type Manager

type Manager interface {
	GetFeedInfo(context.Context) (ed25519.PublicKey, uint64, error)
	GetFeed(context.Context) ([]*manager.FeedObject, error)
}

Jump to

Keyboard shortcuts

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