grpcapi

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_service_proto protoreflect.FileDescriptor

Functions

func NewDialOptions

func NewDialOptions(config TLSConfig) ([]grpc.DialOption, error)

func NewServerOptions

func NewServerOptions(config TLSConfig) ([]grpc.ServerOption, error)

func RegisterRemoteHostServer

func RegisterRemoteHostServer(s *grpc.Server, srv RemoteHostServer)

Types

type Chunk

type Chunk struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*Chunk) Descriptor deprecated

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

Deprecated: Use Chunk.ProtoReflect.Descriptor instead.

func (*Chunk) GetData

func (x *Chunk) GetData() []byte

func (*Chunk) ProtoMessage

func (*Chunk) ProtoMessage()

func (*Chunk) ProtoReflect

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

func (*Chunk) Reset

func (x *Chunk) Reset()

func (*Chunk) String

func (x *Chunk) String() string

type ConnectionAddress

type ConnectionAddress struct {

	// set if a redirect needs to occur
	RedirectHostPort string `protobuf:"bytes,1,opt,name=redirectHostPort,proto3" json:"redirectHostPort,omitempty"`
	// a randomized token needed to accept the connection.
	Token []byte `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*ConnectionAddress) Descriptor deprecated

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

Deprecated: Use ConnectionAddress.ProtoReflect.Descriptor instead.

func (*ConnectionAddress) GetRedirectHostPort

func (x *ConnectionAddress) GetRedirectHostPort() string

func (*ConnectionAddress) GetToken

func (x *ConnectionAddress) GetToken() []byte

func (*ConnectionAddress) ProtoMessage

func (*ConnectionAddress) ProtoMessage()

func (*ConnectionAddress) ProtoReflect

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

func (*ConnectionAddress) Reset

func (x *ConnectionAddress) Reset()

func (*ConnectionAddress) String

func (x *ConnectionAddress) String() string

type ConnectionAddressAndChunk

type ConnectionAddressAndChunk struct {
	Address *ConnectionAddress `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	Data    []byte             `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*ConnectionAddressAndChunk) Descriptor deprecated

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

Deprecated: Use ConnectionAddressAndChunk.ProtoReflect.Descriptor instead.

func (*ConnectionAddressAndChunk) GetAddress

func (*ConnectionAddressAndChunk) GetData

func (x *ConnectionAddressAndChunk) GetData() []byte

func (*ConnectionAddressAndChunk) ProtoMessage

func (*ConnectionAddressAndChunk) ProtoMessage()

func (*ConnectionAddressAndChunk) ProtoReflect

func (*ConnectionAddressAndChunk) Reset

func (x *ConnectionAddressAndChunk) Reset()

func (*ConnectionAddressAndChunk) String

func (x *ConnectionAddressAndChunk) String() string

type RemoteHostClient

type RemoteHostClient interface {
	Listen(ctx context.Context, in *ServiceAddress, opts ...grpc.CallOption) (RemoteHost_ListenClient, error)
	Connect(ctx context.Context, opts ...grpc.CallOption) (RemoteHost_ConnectClient, error)
	AcceptConnection(ctx context.Context, opts ...grpc.CallOption) (RemoteHost_AcceptConnectionClient, error)
}

RemoteHostClient is the client API for RemoteHost service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewRemoteHostClient

func NewRemoteHostClient(cc grpc.ClientConnInterface) RemoteHostClient

type RemoteHostServer

type RemoteHostServer interface {
	Listen(*ServiceAddress, RemoteHost_ListenServer) error
	Connect(RemoteHost_ConnectServer) error
	AcceptConnection(RemoteHost_AcceptConnectionServer) error
}

RemoteHostServer is the server API for RemoteHost service.

type RemoteHost_AcceptConnectionClient

type RemoteHost_AcceptConnectionClient interface {
	Send(*ConnectionAddressAndChunk) error
	Recv() (*Chunk, error)
	grpc.ClientStream
}

type RemoteHost_AcceptConnectionServer

type RemoteHost_AcceptConnectionServer interface {
	Send(*Chunk) error
	Recv() (*ConnectionAddressAndChunk, error)
	grpc.ServerStream
}

type RemoteHost_ConnectClient

type RemoteHost_ConnectClient interface {
	Send(*ServiceAddressAndChunk) error
	Recv() (*ConnectionAddressAndChunk, error)
	grpc.ClientStream
}

type RemoteHost_ConnectServer

type RemoteHost_ConnectServer interface {
	Send(*ConnectionAddressAndChunk) error
	Recv() (*ServiceAddressAndChunk, error)
	grpc.ServerStream
}

type RemoteHost_ListenClient

type RemoteHost_ListenClient interface {
	Recv() (*ConnectionAddress, error)
	grpc.ClientStream
}

type RemoteHost_ListenServer

type RemoteHost_ListenServer interface {
	Send(*ConnectionAddress) error
	grpc.ServerStream
}

type ServiceAddress

type ServiceAddress struct {
	ServiceName string `protobuf:"bytes,1,opt,name=serviceName,proto3" json:"serviceName,omitempty"`
	// contains filtered or unexported fields
}

func (*ServiceAddress) Descriptor deprecated

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

Deprecated: Use ServiceAddress.ProtoReflect.Descriptor instead.

func (*ServiceAddress) GetServiceName

func (x *ServiceAddress) GetServiceName() string

func (*ServiceAddress) ProtoMessage

func (*ServiceAddress) ProtoMessage()

func (*ServiceAddress) ProtoReflect

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

func (*ServiceAddress) Reset

func (x *ServiceAddress) Reset()

func (*ServiceAddress) String

func (x *ServiceAddress) String() string

type ServiceAddressAndChunk

type ServiceAddressAndChunk struct {
	Address *ServiceAddress `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	Data    []byte          `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*ServiceAddressAndChunk) Descriptor deprecated

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

Deprecated: Use ServiceAddressAndChunk.ProtoReflect.Descriptor instead.

func (*ServiceAddressAndChunk) GetAddress

func (x *ServiceAddressAndChunk) GetAddress() *ServiceAddress

func (*ServiceAddressAndChunk) GetData

func (x *ServiceAddressAndChunk) GetData() []byte

func (*ServiceAddressAndChunk) ProtoMessage

func (*ServiceAddressAndChunk) ProtoMessage()

func (*ServiceAddressAndChunk) ProtoReflect

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

func (*ServiceAddressAndChunk) Reset

func (x *ServiceAddressAndChunk) Reset()

func (*ServiceAddressAndChunk) String

func (x *ServiceAddressAndChunk) String() string

type TLSConfig

type TLSConfig struct {
	Insecure bool
	CAFile   string
	CertFile string
	KeyFile  string
}

type UnimplementedRemoteHostServer

type UnimplementedRemoteHostServer struct {
}

UnimplementedRemoteHostServer can be embedded to have forward compatible implementations.

func (*UnimplementedRemoteHostServer) AcceptConnection

func (*UnimplementedRemoteHostServer) Connect

func (*UnimplementedRemoteHostServer) Listen

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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