grpc

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package grpc implements a grpc payment API server.

Index

Constants

This section is empty.

Variables

View Source
var ToGrpcChUpdateType = map[perun.ChUpdateType]pb.SubPayChUpdatesResp_Notify_ChUpdateType{
	perun.ChUpdateTypeOpen:   pb.SubPayChUpdatesResp_Notify_open,
	perun.ChUpdateTypeFinal:  pb.SubPayChUpdatesResp_Notify_final,
	perun.ChUpdateTypeClosed: pb.SubPayChUpdatesResp_Notify_closed,
}

ToGrpcChUpdateType is a helper var that maps enums from ChUpdateType type defined in perun-node to ChUpdateType type defined in grpc package.

Functions

func ListenAndServePayChAPI added in v0.4.0

func ListenAndServePayChAPI(n perun.NodeAPI, grpcPort string) error

ListenAndServePayChAPI starts a payment channel API server that listens for incoming grpc requests at the specified address and serves those requests using the node API instance.

func ToGrpcBalInfo

func ToGrpcBalInfo(src perun.BalInfo) *pb.BalInfo

ToGrpcBalInfo is a helper function to convert BalInfo struct defined in perun-node to BalInfo struct defined in grpc package.

func ToGrpcPayment added in v0.6.0

func ToGrpcPayment(src payment.Payment) *pb.Payment

ToGrpcPayment is a helper function to convert Payment struct defined in perun-node package to Payment struct defined in gprc package.

func ToGrpcPayments added in v0.6.0

func ToGrpcPayments(payments []payment.Payment) []*pb.Payment

ToGrpcPayments is a helper function to convert slice of Payment struct defined in perun-node package to slice of Payment struct defined in grpc package.

Types

This section is empty.

Directories

Path Synopsis
Package pb contains proto3 definitions for user API and the corresponding generated code for grpc server and client.
Package pb contains proto3 definitions for user API and the corresponding generated code for grpc server and client.

Jump to

Keyboard shortcuts

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