rpc

package
v0.0.0-...-35419fc Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_server_proto protoreflect.FileDescriptor
View Source
var ServerRPC_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "rpc.ServerRPC",
	HandlerType: (*ServerRPCServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CheckBloom",
			Handler:    _ServerRPC_CheckBloom_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "FwdOnions",
			Handler:       _ServerRPC_FwdOnions_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "server.proto",
}

ServerRPC_ServiceDesc is the grpc.ServiceDesc for ServerRPC service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterServerRPCServer

func RegisterServerRPCServer(s grpc.ServiceRegistrar, srv ServerRPCServer)

Types

type CheckBloomReq

type CheckBloomReq struct {
	Bloom []byte `protobuf:"bytes,1,opt,name=bloom,proto3" json:"bloom,omitempty"`
	// TODO: Signature
	Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*CheckBloomReq) Descriptor deprecated

func (*CheckBloomReq) Descriptor() ([]byte, []int)

Deprecated: Use CheckBloomReq.ProtoReflect.Descriptor instead.

func (*CheckBloomReq) GetBloom

func (x *CheckBloomReq) GetBloom() []byte

func (*CheckBloomReq) GetId

func (x *CheckBloomReq) GetId() string

func (*CheckBloomReq) ProtoMessage

func (*CheckBloomReq) ProtoMessage()

func (*CheckBloomReq) ProtoReflect

func (x *CheckBloomReq) ProtoReflect() protoreflect.Message

func (*CheckBloomReq) Reset

func (x *CheckBloomReq) Reset()

func (*CheckBloomReq) String

func (x *CheckBloomReq) String() string

type CheckBloomRes

type CheckBloomRes struct {
	Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
	// contains filtered or unexported fields
}

func (*CheckBloomRes) Descriptor deprecated

func (*CheckBloomRes) Descriptor() ([]byte, []int)

Deprecated: Use CheckBloomRes.ProtoReflect.Descriptor instead.

func (*CheckBloomRes) GetOk

func (x *CheckBloomRes) GetOk() bool

func (*CheckBloomRes) ProtoMessage

func (*CheckBloomRes) ProtoMessage()

func (*CheckBloomRes) ProtoReflect

func (x *CheckBloomRes) ProtoReflect() protoreflect.Message

func (*CheckBloomRes) Reset

func (x *CheckBloomRes) Reset()

func (*CheckBloomRes) String

func (x *CheckBloomRes) String() string

type FwdOnionsRes

type FwdOnionsRes struct {
	// contains filtered or unexported fields
}

func (*FwdOnionsRes) Descriptor deprecated

func (*FwdOnionsRes) Descriptor() ([]byte, []int)

Deprecated: Use FwdOnionsRes.ProtoReflect.Descriptor instead.

func (*FwdOnionsRes) ProtoMessage

func (*FwdOnionsRes) ProtoMessage()

func (*FwdOnionsRes) ProtoReflect

func (x *FwdOnionsRes) ProtoReflect() protoreflect.Message

func (*FwdOnionsRes) Reset

func (x *FwdOnionsRes) Reset()

func (*FwdOnionsRes) String

func (x *FwdOnionsRes) String() string

type Onion

type Onion struct {
	Body     []byte `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
	NextHop  string `protobuf:"bytes,2,opt,name=nextHop,proto3" json:"nextHop,omitempty"`
	DeadDrop string `protobuf:"bytes,3,opt,name=deadDrop,proto3" json:"deadDrop,omitempty"`
	// contains filtered or unexported fields
}

Pre-encoding format of msgs transmitted between servers

func (*Onion) Descriptor deprecated

func (*Onion) Descriptor() ([]byte, []int)

Deprecated: Use Onion.ProtoReflect.Descriptor instead.

func (*Onion) GetBody

func (x *Onion) GetBody() []byte

func (*Onion) GetDeadDrop

func (x *Onion) GetDeadDrop() string

func (*Onion) GetNextHop

func (x *Onion) GetNextHop() string

func (*Onion) ProtoMessage

func (*Onion) ProtoMessage()

func (*Onion) ProtoReflect

func (x *Onion) ProtoReflect() protoreflect.Message

func (*Onion) Reset

func (x *Onion) Reset()

func (*Onion) String

func (x *Onion) String() string

type OnionMsg

type OnionMsg struct {

	// Types that are assignable to Msg:
	//
	//	*OnionMsg_Body
	//	*OnionMsg_Meta
	Msg isOnionMsg_Msg `protobuf_oneof:"msg"`
	// contains filtered or unexported fields
}

func (*OnionMsg) Descriptor deprecated

func (*OnionMsg) Descriptor() ([]byte, []int)

Deprecated: Use OnionMsg.ProtoReflect.Descriptor instead.

func (*OnionMsg) GetBody

func (x *OnionMsg) GetBody() []byte

func (*OnionMsg) GetMeta

func (x *OnionMsg) GetMeta() *OnionMsgMeta

func (*OnionMsg) GetMsg

func (m *OnionMsg) GetMsg() isOnionMsg_Msg

func (*OnionMsg) ProtoMessage

func (*OnionMsg) ProtoMessage()

func (*OnionMsg) ProtoReflect

func (x *OnionMsg) ProtoReflect() protoreflect.Message

func (*OnionMsg) Reset

func (x *OnionMsg) Reset()

func (*OnionMsg) String

func (x *OnionMsg) String() string

type OnionMsgMeta

type OnionMsgMeta struct {

	// Leave empty to indicate the onion is from a client
	// TODO: Signature
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*OnionMsgMeta) Descriptor deprecated

func (*OnionMsgMeta) Descriptor() ([]byte, []int)

Deprecated: Use OnionMsgMeta.ProtoReflect.Descriptor instead.

func (*OnionMsgMeta) GetId

func (x *OnionMsgMeta) GetId() string

func (*OnionMsgMeta) ProtoMessage

func (*OnionMsgMeta) ProtoMessage()

func (*OnionMsgMeta) ProtoReflect

func (x *OnionMsgMeta) ProtoReflect() protoreflect.Message

func (*OnionMsgMeta) Reset

func (x *OnionMsgMeta) Reset()

func (*OnionMsgMeta) String

func (x *OnionMsgMeta) String() string

type OnionMsg_Body

type OnionMsg_Body struct {
	Body []byte `protobuf:"bytes,1,opt,name=body,proto3,oneof"`
}

type OnionMsg_Meta

type OnionMsg_Meta struct {
	Meta *OnionMsgMeta `protobuf:"bytes,2,opt,name=meta,proto3,oneof"`
}

type PConfig

type PConfig struct {
	Addr  string
	PK    *[32]byte
	Layer int
}

PConfig is per-server publicly available config

type RoundEndMsg

type RoundEndMsg struct {
	Round int
	// TODO: Signature
	ID string
}

RoundEndMsg is sent from server to coordinator. For mashaling, see RoundStartMsg.

type RoundStartMsg

type RoundStartMsg struct {
	Round int
}

RoundStartMsg is sent from coordinator to server. Use JSON to mashal it since Redis sub/pub transmit string.

type ServerRPCClient

type ServerRPCClient interface {
	FwdOnions(ctx context.Context, opts ...grpc.CallOption) (ServerRPC_FwdOnionsClient, error)
	CheckBloom(ctx context.Context, in *CheckBloomReq, opts ...grpc.CallOption) (*CheckBloomRes, error)
}

ServerRPCClient is the client API for ServerRPC service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewServerRPCClient

func NewServerRPCClient(cc grpc.ClientConnInterface) ServerRPCClient

type ServerRPCServer

type ServerRPCServer interface {
	FwdOnions(ServerRPC_FwdOnionsServer) error
	CheckBloom(context.Context, *CheckBloomReq) (*CheckBloomRes, error)
	// contains filtered or unexported methods
}

ServerRPCServer is the server API for ServerRPC service. All implementations must embed UnimplementedServerRPCServer for forward compatibility

type ServerRPC_FwdOnionsClient

type ServerRPC_FwdOnionsClient interface {
	Send(*OnionMsg) error
	CloseAndRecv() (*FwdOnionsRes, error)
	grpc.ClientStream
}

type ServerRPC_FwdOnionsServer

type ServerRPC_FwdOnionsServer interface {
	SendAndClose(*FwdOnionsRes) error
	Recv() (*OnionMsg, error)
	grpc.ServerStream
}

type UnimplementedServerRPCServer

type UnimplementedServerRPCServer struct {
}

UnimplementedServerRPCServer must be embedded to have forward compatible implementations.

func (UnimplementedServerRPCServer) CheckBloom

func (UnimplementedServerRPCServer) FwdOnions

type UnsafeServerRPCServer

type UnsafeServerRPCServer interface {
	// contains filtered or unexported methods
}

UnsafeServerRPCServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServerRPCServer will result in compilation errors.

Jump to

Keyboard shortcuts

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