Documentation ¶
Index ¶
- Constants
- Variables
- type ApprovalPairing
- func (a *ApprovalPairing) AwaitPairingResult(ctx context.Context) <-chan PStatus
- func (a *ApprovalPairing) IncomingRequests() <-chan PeerIdentity
- func (a *ApprovalPairing) InterceptMethods() []srpc.UnaryInterceptInfo
- func (a *ApprovalPairing) Register(ctx context.Context, in *proto.RegisterRequest) (*proto.StatusReply, error)
- func (a *ApprovalPairing) RegisterServer(g *grpc.Server)
- func (a *ApprovalPairing) StartPairing(ctx context.Context, details *gtypeAny.Any) (PeerIdentity, error)
- func (a *ApprovalPairing) Status(ctx context.Context, in *gtypeEmpty.Empty) (*proto.StatusReply, error)
- type PStatus
- type Pairing
- type PeerIdentity
Constants ¶
View Source
const ApprovalBuffer = 8
Variables ¶
View Source
var (
StatusRejected = errors.New("pairing rejected by peer")
)
Functions ¶
This section is empty.
Types ¶
type ApprovalPairing ¶
type ApprovalPairing struct {
// contains filtered or unexported fields
}
func (*ApprovalPairing) AwaitPairingResult ¶
func (a *ApprovalPairing) AwaitPairingResult(ctx context.Context) <-chan PStatus
func (*ApprovalPairing) IncomingRequests ¶
func (a *ApprovalPairing) IncomingRequests() <-chan PeerIdentity
func (*ApprovalPairing) InterceptMethods ¶
func (a *ApprovalPairing) InterceptMethods() []srpc.UnaryInterceptInfo
func (*ApprovalPairing) Register ¶
func (a *ApprovalPairing) Register(ctx context.Context, in *proto.RegisterRequest) (*proto.StatusReply, error)
Register defines the function handler for the server-side RPC service definition.
func (*ApprovalPairing) RegisterServer ¶
func (a *ApprovalPairing) RegisterServer(g *grpc.Server)
func (*ApprovalPairing) StartPairing ¶
func (a *ApprovalPairing) StartPairing(ctx context.Context, details *gtypeAny.Any) (PeerIdentity, error)
func (*ApprovalPairing) Status ¶
func (a *ApprovalPairing) Status(ctx context.Context, in *gtypeEmpty.Empty) (*proto.StatusReply, error)
type Pairing ¶
type Pairing interface { srpc.ServerModule // Server-side RPC Register(ctx context.Context, in *proto.RegisterRequest) (*proto.StatusReply, error) IncomingRequests() <-chan PeerIdentity Status(ctx context.Context, in *gtypeEmpty.Empty) (*proto.StatusReply, error) // Client-side RPC StartPairing(ctx context.Context, details *gtypeAny.Any) (PeerIdentity, error) // TODO: integrate into StartPairing AwaitPairingResult(ctx context.Context) <-chan PStatus }
func NewClientApproval ¶
func NewClientApproval(p *authentication.PeerCertMgr, cc *client.ClientConnPlus) Pairing
func NewServerApproval ¶
func NewServerApproval(p *authentication.PeerCertMgr, info gtypeAny.Any) Pairing
type PeerIdentity ¶
type PeerIdentity interface { // PeerID identifies a peer by its CommonName stored in the showed certificate. PeerID() string // Fingerprint clearly describes a peer's certificate in raw format. Fingerprint() authentication.CertFingerprint // FingerprintHex clearly describes a peer's certificate in hexadecimal format. FingerprintHex() string // Details gives user-supplied information passed during pairing. Details() gtypeAny.Any // Accept this peer. Accept() // Reject this peer. Reject() }
Click to show internal directories.
Click to hide internal directories.