handler

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Mainnet = "api.iotex.one:443"
)

Variables

View Source
var (
	ErrGrpcConnFailed = "failed to establish gRPC connection"
	ErrGrpcCallFailed = "failed to execute gRPC call"
)

Functions

func Endpoint

func Endpoint() string

func GetAccount

func GetAccount(r *http.Request, cli iotexapi.APIServiceClient) (proto.Message, error)

GetAccount extracts address from http request, make gRPC call GetAccount()

func GetActionByAddr

func GetActionByAddr(r *http.Request, cli iotexapi.APIServiceClient) (proto.Message, error)

GetActionByHash extracts address from http request, make gRPC call GetActions()

func GetActionByHash

func GetActionByHash(r *http.Request, cli iotexapi.APIServiceClient) (proto.Message, error)

GetActionByHash extracts hash from http request, make gRPC call GetActions()

func GetChainMeta

func GetChainMeta(r *http.Request, cli iotexapi.APIServiceClient) (proto.Message, error)

GetChainMeta make gRPC call GetChainMeta(), and returns the chain meta

func GetReceiptByHash

func GetReceiptByHash(r *http.Request, cli iotexapi.APIServiceClient) (proto.Message, error)

GetReceiptByHash extracts hash from http request, make gRPC call GetActions()

func GetTsfInBlock

func GetTsfInBlock(r *http.Request, cli iotexapi.APIServiceClient) (proto.Message, error)

GetTsfInBlock make gRPC call GetRawBlocks(), and returns all transfers in the block

func GetVotesByAddr

func GetVotesByAddr(r *http.Request, cli iotexapi.APIServiceClient) (proto.Message, error)

GetVotesByAddr extracts address from http request, make gRPC call GetBucket()

func GetVotesByIndex

func GetVotesByIndex(r *http.Request, cli iotexapi.APIServiceClient) (proto.Message, error)

GetVotesByIndex extracts address from http request, make gRPC call GetBucket()

func GrpcConnection

func GrpcConnection() (*grpc.ClientConn, error)

func GrpcToHttpHandler

func GrpcToHttpHandler(fn func(*http.Request, iotexapi.APIServiceClient) (proto.Message, error)) http.HandlerFunc

GrpcToHttpHandler turns gRPC handler into http handler

func ReadContract

func ReadContract(r *http.Request, cli iotexapi.APIServiceClient) (proto.Message, error)

GetActionByHash extracts address from http request, make gRPC call GetActions()

func SendSignedActionBytes

func SendSignedActionBytes(r *http.Request, cli iotexapi.APIServiceClient) (proto.Message, error)

SendSignedActionBytes extracts signed transaction bytes from http request, make gRPC call SendAction()

func TLSEnabled

func TLSEnabled() bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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