ptypes

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package ptypes contains the protobuf definitions for the implementation of minogrpc.

Index

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) Descriptor() ([]byte, []int)

func (*Ack) GetErrors

func (m *Ack) GetErrors() []string

func (*Ack) ProtoMessage

func (*Ack) ProtoMessage()

func (*Ack) Reset

func (m *Ack) Reset()

func (*Ack) String

func (m *Ack) String() string

func (*Ack) XXX_DiscardUnknown

func (m *Ack) XXX_DiscardUnknown()

func (*Ack) XXX_Marshal

func (m *Ack) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Ack) XXX_Merge

func (m *Ack) XXX_Merge(src proto.Message)

func (*Ack) XXX_Size

func (m *Ack) XXX_Size() int

func (*Ack) XXX_Unmarshal

func (m *Ack) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*Message) GetFrom

func (m *Message) GetFrom() []byte

func (*Message) GetPayload

func (m *Message) GetPayload() []byte

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) Reset

func (m *Message) Reset()

func (*Message) String

func (m *Message) String() string

func (*Message) XXX_DiscardUnknown

func (m *Message) XXX_DiscardUnknown()

func (*Message) XXX_Marshal

func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Message) XXX_Merge

func (m *Message) XXX_Merge(src proto.Message)

func (*Message) XXX_Size

func (m *Message) XXX_Size() int

func (*Message) XXX_Unmarshal

func (m *Message) XXX_Unmarshal(b []byte) error

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)
	// Share handles a certificate share from another participant of the
	// 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)
	// Share handles a certificate share from another participant of the
	// 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_StreamClient interface {
	Send(*Packet) error
	Recv() (*Packet, error)
	grpc.ClientStream
}

type Overlay_StreamServer

type Overlay_StreamServer interface {
	Send(*Packet) error
	Recv() (*Packet, error)
	grpc.ServerStream
}

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) Descriptor() ([]byte, []int)

func (*Packet) GetSerialized

func (m *Packet) GetSerialized() []byte

func (*Packet) ProtoMessage

func (*Packet) ProtoMessage()

func (*Packet) Reset

func (m *Packet) Reset()

func (*Packet) String

func (m *Packet) String() string

func (*Packet) XXX_DiscardUnknown

func (m *Packet) XXX_DiscardUnknown()

func (*Packet) XXX_Marshal

func (m *Packet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Packet) XXX_Merge

func (m *Packet) XXX_Merge(src proto.Message)

func (*Packet) XXX_Size

func (m *Packet) XXX_Size() int

func (*Packet) XXX_Unmarshal

func (m *Packet) XXX_Unmarshal(b []byte) error

type UnimplementedOverlayServer

type UnimplementedOverlayServer struct {
}

UnimplementedOverlayServer can be embedded to have forward compatible implementations.

func (*UnimplementedOverlayServer) Call

func (*UnimplementedOverlayServer) Forward

func (*UnimplementedOverlayServer) Forward(ctx context.Context, req *Packet) (*Ack, error)

func (*UnimplementedOverlayServer) Join

func (*UnimplementedOverlayServer) Share

func (*UnimplementedOverlayServer) Stream

Jump to

Keyboard shortcuts

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