jsonrpc

package
v1.1.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: MIT Imports: 14 Imported by: 3

Documentation

Index

Constants

View Source
const ErrCodeProtocol = -33000

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(logger log.Logger, services ...Service) (http.Handler, error)

Types

type Client

type Client struct {
	Client http.Client
	Server string
}

func NewClient

func NewClient(server string) *Client

NewClient creates new API client with default config

func (*Client) Faucet

func (c *Client) Faucet(ctx context.Context, account *url.URL, opts api.FaucetOptions) (*api.Submission, error)

func (*Client) Metrics

func (c *Client) Metrics(ctx context.Context, opts MetricsOptions) (*api.Metrics, error)

func (*Client) NetworkStatus

func (c *Client) NetworkStatus(ctx context.Context, opts NetworkStatusOptions) (*api.NetworkStatus, error)

func (*Client) NodeStatus

func (c *Client) NodeStatus(ctx context.Context, opts NodeStatusOptions) (*api.NodeStatus, error)

func (*Client) Query

func (c *Client) Query(ctx context.Context, scope *url.URL, query api.Query) (api.Record, error)

func (*Client) Submit

func (c *Client) Submit(ctx context.Context, envelope *messaging.Envelope, opts api.SubmitOptions) ([]*api.Submission, error)

func (*Client) Validate

func (c *Client) Validate(ctx context.Context, envelope *messaging.Envelope, opts api.ValidateOptions) ([]*api.Submission, error)

type Faucet

type Faucet struct{ api.Faucet }

type MetricsOptions

type MetricsOptions = api.MetricsOptions

type MetricsService

type MetricsService struct{ api.MetricsService }

func (MetricsService) Metrics

func (s MetricsService) Metrics(ctx context.Context, params json.RawMessage) interface{}

type NetworkService

type NetworkService struct{ api.NetworkService }

func (NetworkService) NetworkStatus

func (s NetworkService) NetworkStatus(ctx context.Context, params json.RawMessage) interface{}

type NetworkStatusOptions

type NetworkStatusOptions = api.NetworkStatusOptions

type NodeService

type NodeService struct{ api.NodeService }

func (NodeService) NodeStatus

func (s NodeService) NodeStatus(ctx context.Context, params json.RawMessage) interface{}

type NodeStatusOptions

type NodeStatusOptions = api.NodeStatusOptions

type Querier

type Querier struct{ api.Querier }

func (Querier) Query

func (s Querier) Query(ctx context.Context, params json.RawMessage) interface{}

type RangeOptions

type RangeOptions = api.RangeOptions

type Service

type Service interface {
	// contains filtered or unexported methods
}

type SubmitOptions

type SubmitOptions = api.SubmitOptions

type Submitter

type Submitter struct{ api.Submitter }

func (Submitter) Submit

func (s Submitter) Submit(ctx context.Context, params json.RawMessage) interface{}

type ValidateOptions

type ValidateOptions = api.ValidateOptions

type Validator

type Validator struct{ api.Validator }

func (Validator) Validate

func (s Validator) Validate(ctx context.Context, params json.RawMessage) interface{}

Jump to

Keyboard shortcuts

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