adapter

package
v0.0.0-...-e348455 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCall

func NewCall(m *types.Metadata, req Request) (types.Call, error)

func NewFluxMonitorCall

func NewFluxMonitorCall(m *types.Metadata, req Request) (types.Call, error)

func NewSubstrateAdapter

func NewSubstrateAdapter(privkey, txtypeStr, endpoint string) (*substrateAdapter, error)

func NewSubstrateClient

func NewSubstrateClient(u *url.URL, keyringPair signature.KeyringPair, t txType) (*substrateClient, error)

func ParseNumericString

func ParseNumericString(input string) (decimal.Decimal, error)

func RunWebserver

func RunWebserver(
	handler handler,
	port string,
)

Types

type HttpService

type HttpService struct {
	Router  *gin.Engine
	Handler handler
}

func NewHTTPService

func NewHTTPService(
	handler handler,
) *HttpService

func (*HttpService) Call

func (srv *HttpService) Call(c *gin.Context)

func (*HttpService) ServeHTTP

func (srv *HttpService) ServeHTTP(w http.ResponseWriter, r *http.Request)

type JobReq

type JobReq struct {
	JobID string  `json:"id"`
	Data  Request `json:"data"`
}

type Request

type Request struct {
	// Common params:
	RequestType string `json:"request_type"`
	Value       string `json:"value"`
	Result      string `json:"result"`
	Multiply    int64  `json:"multiply,omitempty"`

	// Runlog params:
	Function  string      `json:"function"`
	Type      string      `json:"type"`
	RequestId interface{} `json:"request_id"`

	// Fluxmonitor params:
	FeedId  string `json:"feed_id"`
	RoundId string `json:"round_id"`
}

Jump to

Keyboard shortcuts

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