Documentation
¶
Overview ¶
Package ptypes contains the protobuf definitions for the implementation of minogrpc.
Index ¶
- func RegisterOverlayServer(s *grpc.Server, srv OverlayServer)
- type Ack
- func (*Ack) Descriptor() ([]byte, []int)
- func (m *Ack) GetErrors() []string
- func (*Ack) ProtoMessage()
- func (m *Ack) Reset()
- func (m *Ack) String() string
- func (m *Ack) XXX_DiscardUnknown()
- func (m *Ack) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Ack) XXX_Merge(src proto.Message)
- func (m *Ack) XXX_Size() int
- func (m *Ack) XXX_Unmarshal(b []byte) error
- type CertificateAck
- func (*CertificateAck) Descriptor() ([]byte, []int)
- func (*CertificateAck) ProtoMessage()
- func (m *CertificateAck) Reset()
- func (m *CertificateAck) String() string
- func (m *CertificateAck) XXX_DiscardUnknown()
- func (m *CertificateAck) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CertificateAck) XXX_Merge(src proto.Message)
- func (m *CertificateAck) XXX_Size() int
- func (m *CertificateAck) XXX_Unmarshal(b []byte) error
- type CertificateChain
- func (*CertificateChain) Descriptor() ([]byte, []int)
- func (m *CertificateChain) GetAddress() []byte
- func (m *CertificateChain) GetValue() []byte
- func (*CertificateChain) ProtoMessage()
- func (m *CertificateChain) Reset()
- func (m *CertificateChain) String() string
- func (m *CertificateChain) XXX_DiscardUnknown()
- func (m *CertificateChain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CertificateChain) XXX_Merge(src proto.Message)
- func (m *CertificateChain) XXX_Size() int
- func (m *CertificateChain) XXX_Unmarshal(b []byte) error
- type JoinRequest
- func (*JoinRequest) Descriptor() ([]byte, []int)
- func (m *JoinRequest) GetChain() *CertificateChain
- func (m *JoinRequest) GetToken() string
- func (*JoinRequest) ProtoMessage()
- func (m *JoinRequest) Reset()
- func (m *JoinRequest) String() string
- func (m *JoinRequest) XXX_DiscardUnknown()
- func (m *JoinRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *JoinRequest) XXX_Merge(src proto.Message)
- func (m *JoinRequest) XXX_Size() int
- func (m *JoinRequest) XXX_Unmarshal(b []byte) error
- type JoinResponse
- func (*JoinResponse) Descriptor() ([]byte, []int)
- func (m *JoinResponse) GetPeers() []*CertificateChain
- func (*JoinResponse) ProtoMessage()
- func (m *JoinResponse) Reset()
- func (m *JoinResponse) String() string
- func (m *JoinResponse) XXX_DiscardUnknown()
- func (m *JoinResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *JoinResponse) XXX_Merge(src proto.Message)
- func (m *JoinResponse) XXX_Size() int
- func (m *JoinResponse) XXX_Unmarshal(b []byte) error
- type Message
- func (*Message) Descriptor() ([]byte, []int)
- func (m *Message) GetFrom() []byte
- func (m *Message) GetPayload() []byte
- func (*Message) ProtoMessage()
- func (m *Message) Reset()
- func (m *Message) String() string
- func (m *Message) XXX_DiscardUnknown()
- func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Message) XXX_Merge(src proto.Message)
- func (m *Message) XXX_Size() int
- func (m *Message) XXX_Unmarshal(b []byte) error
- type OverlayClient
- type OverlayServer
- type Overlay_StreamClient
- type Overlay_StreamServer
- type Packet
- func (*Packet) Descriptor() ([]byte, []int)
- func (m *Packet) GetSerialized() []byte
- func (*Packet) ProtoMessage()
- func (m *Packet) Reset()
- func (m *Packet) String() string
- func (m *Packet) XXX_DiscardUnknown()
- func (m *Packet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Packet) XXX_Merge(src proto.Message)
- func (m *Packet) XXX_Size() int
- func (m *Packet) XXX_Unmarshal(b []byte) error
- type UnimplementedOverlayServer
- func (*UnimplementedOverlayServer) Call(ctx context.Context, req *Message) (*Message, error)
- func (*UnimplementedOverlayServer) Forward(ctx context.Context, req *Packet) (*Ack, error)
- func (*UnimplementedOverlayServer) Join(ctx context.Context, req *JoinRequest) (*JoinResponse, error)
- func (*UnimplementedOverlayServer) Share(ctx context.Context, req *CertificateChain) (*CertificateAck, error)
- func (*UnimplementedOverlayServer) Stream(srv Overlay_StreamServer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterOverlayServer ¶
func RegisterOverlayServer(s *grpc.Server, srv OverlayServer)
Types ¶
type Ack ¶
type Ack struct { Errors []string `protobuf:"bytes,1,rep,name=errors,proto3" json:"errors,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Ack is the return of a unicast request to forward a message.
func (*Ack) Descriptor ¶
func (*Ack) ProtoMessage ¶
func (*Ack) ProtoMessage()
func (*Ack) XXX_DiscardUnknown ¶
func (m *Ack) XXX_DiscardUnknown()
func (*Ack) XXX_Unmarshal ¶
type CertificateAck ¶
type CertificateAck struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*CertificateAck) Descriptor ¶
func (*CertificateAck) Descriptor() ([]byte, []int)
func (*CertificateAck) ProtoMessage ¶
func (*CertificateAck) ProtoMessage()
func (*CertificateAck) Reset ¶
func (m *CertificateAck) Reset()
func (*CertificateAck) String ¶
func (m *CertificateAck) String() string
func (*CertificateAck) XXX_DiscardUnknown ¶
func (m *CertificateAck) XXX_DiscardUnknown()
func (*CertificateAck) XXX_Marshal ¶
func (m *CertificateAck) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CertificateAck) XXX_Merge ¶
func (m *CertificateAck) XXX_Merge(src proto.Message)
func (*CertificateAck) XXX_Size ¶
func (m *CertificateAck) XXX_Size() int
func (*CertificateAck) XXX_Unmarshal ¶
func (m *CertificateAck) XXX_Unmarshal(b []byte) error
type CertificateChain ¶
type CertificateChain struct { Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // value represents certificates as ASN.1 DER data. The certificates must be // concatenated with no intermediate padding. This value can be parsed with // `x509.LoadCertificates`. Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
CertificateChain is a wrapper around a chain of x509 raw certificates and its address.
func (*CertificateChain) Descriptor ¶
func (*CertificateChain) Descriptor() ([]byte, []int)
func (*CertificateChain) GetAddress ¶
func (m *CertificateChain) GetAddress() []byte
func (*CertificateChain) GetValue ¶
func (m *CertificateChain) GetValue() []byte
func (*CertificateChain) ProtoMessage ¶
func (*CertificateChain) ProtoMessage()
func (*CertificateChain) Reset ¶
func (m *CertificateChain) Reset()
func (*CertificateChain) String ¶
func (m *CertificateChain) String() string
func (*CertificateChain) XXX_DiscardUnknown ¶
func (m *CertificateChain) XXX_DiscardUnknown()
func (*CertificateChain) XXX_Marshal ¶
func (m *CertificateChain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CertificateChain) XXX_Merge ¶
func (m *CertificateChain) XXX_Merge(src proto.Message)
func (*CertificateChain) XXX_Size ¶
func (m *CertificateChain) XXX_Size() int
func (*CertificateChain) XXX_Unmarshal ¶
func (m *CertificateChain) XXX_Unmarshal(b []byte) error
type JoinRequest ¶
type JoinRequest struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` Chain *CertificateChain `protobuf:"bytes,2,opt,name=chain,proto3" json:"chain,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
JoinRequest sends a request to join a network to a distant node. It must contain a valid token and its own certificate.
func (*JoinRequest) Descriptor ¶
func (*JoinRequest) Descriptor() ([]byte, []int)
func (*JoinRequest) GetChain ¶
func (m *JoinRequest) GetChain() *CertificateChain
func (*JoinRequest) GetToken ¶
func (m *JoinRequest) GetToken() string
func (*JoinRequest) ProtoMessage ¶
func (*JoinRequest) ProtoMessage()
func (*JoinRequest) Reset ¶
func (m *JoinRequest) Reset()
func (*JoinRequest) String ¶
func (m *JoinRequest) String() string
func (*JoinRequest) XXX_DiscardUnknown ¶
func (m *JoinRequest) XXX_DiscardUnknown()
func (*JoinRequest) XXX_Marshal ¶
func (m *JoinRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*JoinRequest) XXX_Merge ¶
func (m *JoinRequest) XXX_Merge(src proto.Message)
func (*JoinRequest) XXX_Size ¶
func (m *JoinRequest) XXX_Size() int
func (*JoinRequest) XXX_Unmarshal ¶
func (m *JoinRequest) XXX_Unmarshal(b []byte) error
type JoinResponse ¶
type JoinResponse struct { Peers []*CertificateChain `protobuf:"bytes,1,rep,name=peers,proto3" json:"peers,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
JoinResponse is a response of a join request that contains the list of certificates known by the distant node.
func (*JoinResponse) Descriptor ¶
func (*JoinResponse) Descriptor() ([]byte, []int)
func (*JoinResponse) GetPeers ¶
func (m *JoinResponse) GetPeers() []*CertificateChain
func (*JoinResponse) ProtoMessage ¶
func (*JoinResponse) ProtoMessage()
func (*JoinResponse) Reset ¶
func (m *JoinResponse) Reset()
func (*JoinResponse) String ¶
func (m *JoinResponse) String() string
func (*JoinResponse) XXX_DiscardUnknown ¶
func (m *JoinResponse) XXX_DiscardUnknown()
func (*JoinResponse) XXX_Marshal ¶
func (m *JoinResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*JoinResponse) XXX_Merge ¶
func (m *JoinResponse) XXX_Merge(src proto.Message)
func (*JoinResponse) XXX_Size ¶
func (m *JoinResponse) XXX_Size() int
func (*JoinResponse) XXX_Unmarshal ¶
func (m *JoinResponse) XXX_Unmarshal(b []byte) error
type Message ¶
type Message struct { From []byte `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Message is a network message that contains the address of the sender and the payload.
func (*Message) Descriptor ¶
func (*Message) GetPayload ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) XXX_DiscardUnknown ¶
func (m *Message) XXX_DiscardUnknown()
func (*Message) XXX_Marshal ¶
func (*Message) XXX_Unmarshal ¶
type OverlayClient ¶
type OverlayClient interface { // Join handles join request from an unknown node. It accepts to share the // certificates if the token is valid. Join(ctx context.Context, in *JoinRequest, opts ...grpc.CallOption) (*JoinResponse, error) // network. Share(ctx context.Context, in *CertificateChain, opts ...grpc.CallOption) (*CertificateAck, error) // Call is a unicast rpc to send a message to a participant and expect a // reply from it. Call(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) // Stream is a stream rpc that will build a network of nodes which will // relay the messages between each others. Stream(ctx context.Context, opts ...grpc.CallOption) (Overlay_StreamClient, error) // Forward is used in association with Stream to send a message through // relays and get a feedback that the message has been received. Forward(ctx context.Context, in *Packet, opts ...grpc.CallOption) (*Ack, error) }
OverlayClient is the client API for Overlay service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewOverlayClient ¶
func NewOverlayClient(cc grpc.ClientConnInterface) OverlayClient
type OverlayServer ¶
type OverlayServer interface { // Join handles join request from an unknown node. It accepts to share the // certificates if the token is valid. Join(context.Context, *JoinRequest) (*JoinResponse, error) // network. Share(context.Context, *CertificateChain) (*CertificateAck, error) // Call is a unicast rpc to send a message to a participant and expect a // reply from it. Call(context.Context, *Message) (*Message, error) // Stream is a stream rpc that will build a network of nodes which will // relay the messages between each others. Stream(Overlay_StreamServer) error // Forward is used in association with Stream to send a message through // relays and get a feedback that the message has been received. Forward(context.Context, *Packet) (*Ack, error) }
OverlayServer is the server API for Overlay service.
type Overlay_StreamClient ¶
type Overlay_StreamServer ¶
type Packet ¶
type Packet struct { Serialized []byte `protobuf:"bytes,1,opt,name=serialized,proto3" json:"serialized,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Packet is a wrapper around a packet.
func (*Packet) Descriptor ¶
func (*Packet) GetSerialized ¶
func (*Packet) ProtoMessage ¶
func (*Packet) ProtoMessage()
func (*Packet) XXX_DiscardUnknown ¶
func (m *Packet) XXX_DiscardUnknown()
func (*Packet) XXX_Marshal ¶
func (*Packet) XXX_Unmarshal ¶
type UnimplementedOverlayServer ¶
type UnimplementedOverlayServer struct { }
UnimplementedOverlayServer can be embedded to have forward compatible implementations.
func (*UnimplementedOverlayServer) Join ¶
func (*UnimplementedOverlayServer) Join(ctx context.Context, req *JoinRequest) (*JoinResponse, error)
func (*UnimplementedOverlayServer) Share ¶
func (*UnimplementedOverlayServer) Share(ctx context.Context, req *CertificateChain) (*CertificateAck, error)
func (*UnimplementedOverlayServer) Stream ¶
func (*UnimplementedOverlayServer) Stream(srv Overlay_StreamServer) error