grpc

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package grpc implements a grpc payment API server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromGrpcBalInfo

func FromGrpcBalInfo(src *pb.BalanceInfo) perun.BalInfo

FromGrpcBalInfo is a helper function to convert BalInfo struct defined in grpc package to BalInfo struct defined in perun-node. It is exported for use in tests.

func ToGrpcBalInfo

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

ToGrpcBalInfo is a helper function to convert BalInfo struct defined in perun-node to BalInfo struct defined in grpc package. It is exported for use in tests.

Types

type PayChServer

type PayChServer struct {

	// The mutex should be used when accessing the map data structures.
	psync.Mutex
	// contains filtered or unexported fields
}

PayChServer represents a grpc server that implements payment channel API.

func NewPayChServer

func NewPayChServer(n perun.NodeAPI) *PayChServer

NewPayChServer returns a new grpc server that can server the payment channel API.

func (*PayChServer) AddContact

func (a *PayChServer) AddContact(ctx context.Context, req *pb.AddContactReq) (*pb.AddContactResp, error)

AddContact wraps session.AddContact.

func (*PayChServer) ClosePayCh

func (a *PayChServer) ClosePayCh(ctx context.Context, req *pb.ClosePayChReq) (*pb.ClosePayChResp, error)

ClosePayCh wraps channel.ClosePayCh.

func (*PayChServer) CloseSession

CloseSession wraps session.CloseSession. For now, this is a stub.

func (*PayChServer) GetConfig

GetConfig wraps node.GetConfig.

func (*PayChServer) GetContact

func (a *PayChServer) GetContact(ctx context.Context, req *pb.GetContactReq) (*pb.GetContactResp, error)

GetContact wraps session.GetContact.

func (*PayChServer) GetPayChBalance

func (a *PayChServer) GetPayChBalance(ctx context.Context, req *pb.GetPayChBalanceReq) (
	*pb.GetPayChBalanceResp, error)

GetPayChBalance wraps channel.GetPayChBalance.

func (*PayChServer) GetPayChs

func (a *PayChServer) GetPayChs(ctx context.Context, req *pb.GetPayChsReq) (*pb.GetPayChsResp, error)

GetPayChs wraps session.GetPayChs.

func (*PayChServer) Help

Help wraps node.Help.

func (*PayChServer) OpenPayCh

func (a *PayChServer) OpenPayCh(ctx context.Context, req *pb.OpenPayChReq) (*pb.OpenPayChResp, error)

OpenPayCh wraps session.OpenPayCh.

func (*PayChServer) OpenSession

func (a *PayChServer) OpenSession(ctx context.Context, req *pb.OpenSessionReq) (*pb.OpenSessionResp, error)

OpenSession wraps node.OpenSession.

func (*PayChServer) RespondPayChProposal

func (a *PayChServer) RespondPayChProposal(ctx context.Context, req *pb.RespondPayChProposalReq) (
	*pb.RespondPayChProposalResp, error)

RespondPayChProposal wraps session.RespondPayChProposal.

func (*PayChServer) RespondPayChUpdate

func (a *PayChServer) RespondPayChUpdate(ctx context.Context, req *pb.RespondPayChUpdateReq) (
	*pb.RespondPayChUpdateResp, error)

RespondPayChUpdate wraps channel.RespondPayChUpdate.

func (*PayChServer) SendPayChUpdate

func (a *PayChServer) SendPayChUpdate(ctx context.Context, req *pb.SendPayChUpdateReq) (
	*pb.SendPayChUpdateResp, error)

SendPayChUpdate wraps channel.SendPayChUpdate.

func (*PayChServer) SubPayChCloses

SubPayChCloses wraps session.SubPayChCloses.

func (*PayChServer) SubPayChProposals

SubPayChProposals wraps session.SubPayChProposals.

func (*PayChServer) SubPayChUpdates

SubPayChUpdates wraps channel.SubPayChUpdates.

func (*PayChServer) Time

Time wraps node.Time.

func (*PayChServer) UnsubPayChClose

func (a *PayChServer) UnsubPayChClose(ctx context.Context, req *pb.UnsubPayChClosesReq) (
	*pb.UnsubPayChClosesResp, error)

UnsubPayChClose wraps session.UnsubPayChClose.

func (*PayChServer) UnsubPayChProposals

func (a *PayChServer) UnsubPayChProposals(ctx context.Context, req *pb.UnsubPayChProposalsReq) (
	*pb.UnsubPayChProposalsResp, error)

UnsubPayChProposals wraps session.UnsubPayChProposals.

func (*PayChServer) UnsubPayChUpdates

func (a *PayChServer) UnsubPayChUpdates(ctx context.Context, req *pb.UnsubPayChUpdatesReq) (
	*pb.UnsubPayChUpdatesResp, error)

UnsubPayChUpdates wraps channel.UnsubPayChUpdates.

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