Documentation
¶
Overview ¶
Package grpc implements a grpc payment API server.
Index ¶
- func FromGrpcBalInfo(src *pb.BalanceInfo) perun.BalInfo
- func ToGrpcBalInfo(src perun.BalInfo) *pb.BalanceInfo
- type PayChServer
- func (a *PayChServer) AddContact(ctx context.Context, req *pb.AddContactReq) (*pb.AddContactResp, error)
- func (a *PayChServer) ClosePayCh(ctx context.Context, req *pb.ClosePayChReq) (*pb.ClosePayChResp, error)
- func (a *PayChServer) CloseSession(context.Context, *pb.CloseSessionReq) (*pb.CloseSessionResp, error)
- func (a *PayChServer) GetConfig(context.Context, *pb.GetConfigReq) (*pb.GetConfigResp, error)
- func (a *PayChServer) GetContact(ctx context.Context, req *pb.GetContactReq) (*pb.GetContactResp, error)
- func (a *PayChServer) GetPayChBalance(ctx context.Context, req *pb.GetPayChBalanceReq) (*pb.GetPayChBalanceResp, error)
- func (a *PayChServer) GetPayChs(ctx context.Context, req *pb.GetPayChsReq) (*pb.GetPayChsResp, error)
- func (a *PayChServer) Help(context.Context, *pb.HelpReq) (*pb.HelpResp, error)
- func (a *PayChServer) OpenPayCh(ctx context.Context, req *pb.OpenPayChReq) (*pb.OpenPayChResp, error)
- func (a *PayChServer) OpenSession(ctx context.Context, req *pb.OpenSessionReq) (*pb.OpenSessionResp, error)
- func (a *PayChServer) RespondPayChProposal(ctx context.Context, req *pb.RespondPayChProposalReq) (*pb.RespondPayChProposalResp, error)
- func (a *PayChServer) RespondPayChUpdate(ctx context.Context, req *pb.RespondPayChUpdateReq) (*pb.RespondPayChUpdateResp, error)
- func (a *PayChServer) SendPayChUpdate(ctx context.Context, req *pb.SendPayChUpdateReq) (*pb.SendPayChUpdateResp, error)
- func (a *PayChServer) SubPayChCloses(req *pb.SubPayChClosesReq, srv pb.Payment_API_SubPayChClosesServer) error
- func (a *PayChServer) SubPayChProposals(req *pb.SubPayChProposalsReq, srv pb.Payment_API_SubPayChProposalsServer) error
- func (a *PayChServer) SubPayChUpdates(req *pb.SubpayChUpdatesReq, srv pb.Payment_API_SubPayChUpdatesServer) error
- func (a *PayChServer) Time(context.Context, *pb.TimeReq) (*pb.TimeResp, error)
- func (a *PayChServer) UnsubPayChClose(ctx context.Context, req *pb.UnsubPayChClosesReq) (*pb.UnsubPayChClosesResp, error)
- func (a *PayChServer) UnsubPayChProposals(ctx context.Context, req *pb.UnsubPayChProposalsReq) (*pb.UnsubPayChProposalsResp, error)
- func (a *PayChServer) UnsubPayChUpdates(ctx context.Context, req *pb.UnsubPayChUpdatesReq) (*pb.UnsubPayChUpdatesResp, error)
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 ¶
func (a *PayChServer) CloseSession(context.Context, *pb.CloseSessionReq) (*pb.CloseSessionResp, error)
CloseSession wraps session.CloseSession. For now, this is a stub.
func (*PayChServer) GetConfig ¶
func (a *PayChServer) GetConfig(context.Context, *pb.GetConfigReq) (*pb.GetConfigResp, error)
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) 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 ¶
func (a *PayChServer) SubPayChCloses(req *pb.SubPayChClosesReq, srv pb.Payment_API_SubPayChClosesServer) error
SubPayChCloses wraps session.SubPayChCloses.
func (*PayChServer) SubPayChProposals ¶
func (a *PayChServer) SubPayChProposals(req *pb.SubPayChProposalsReq, srv pb.Payment_API_SubPayChProposalsServer) error
SubPayChProposals wraps session.SubPayChProposals.
func (*PayChServer) SubPayChUpdates ¶
func (a *PayChServer) SubPayChUpdates(req *pb.SubpayChUpdatesReq, srv pb.Payment_API_SubPayChUpdatesServer) error
SubPayChUpdates wraps channel.SubPayChUpdates.
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.