Documentation ¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterHostInfoServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterHostInfoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HostInfoServiceClient) error
- func RegisterHostInfoServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterHostInfoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HostInfoServiceServer) error
- func RegisterHostInfoServiceServer(s grpc.ServiceRegistrar, srv HostInfoServiceServer)
- type HostInfoServiceClient
- type HostInfoServiceServer
- type InfoRequest
- type InfoResponse
- func (*InfoResponse) Descriptor() ([]byte, []int)deprecated
- func (x *InfoResponse) GetAddresses() []string
- func (x *InfoResponse) GetId() string
- func (x *InfoResponse) GetPeers() []string
- func (x *InfoResponse) GetProtocols() []string
- func (*InfoResponse) ProtoMessage()
- func (x *InfoResponse) ProtoReflect() protoreflect.Message
- func (x *InfoResponse) Reset()
- func (x *InfoResponse) String() string
- type UnimplementedHostInfoServiceServer
- type UnsafeHostInfoServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_proto_v1_host_proto protoreflect.FileDescriptor
var HostInfoService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.v1.HostInfoService", HandlerType: (*HostInfoServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Info", Handler: _HostInfoService_Info_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/v1/host.proto", }
HostInfoService_ServiceDesc is the grpc.ServiceDesc for HostInfoService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterHostInfoServiceHandler ¶
func RegisterHostInfoServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterHostInfoServiceHandler registers the http handlers for service HostInfoService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterHostInfoServiceHandlerClient ¶
func RegisterHostInfoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HostInfoServiceClient) error
RegisterHostInfoServiceHandlerClient registers the http handlers for service HostInfoService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HostInfoServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HostInfoServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "HostInfoServiceClient" to call the correct interceptors.
func RegisterHostInfoServiceHandlerFromEndpoint ¶
func RegisterHostInfoServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterHostInfoServiceHandlerFromEndpoint is same as RegisterHostInfoServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterHostInfoServiceHandlerServer ¶
func RegisterHostInfoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HostInfoServiceServer) error
RegisterHostInfoServiceHandlerServer registers the http handlers for service HostInfoService to "mux". UnaryRPC :call HostInfoServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterHostInfoServiceHandlerFromEndpoint instead.
func RegisterHostInfoServiceServer ¶
func RegisterHostInfoServiceServer(s grpc.ServiceRegistrar, srv HostInfoServiceServer)
Types ¶
type HostInfoServiceClient ¶
type HostInfoServiceClient interface {
Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error)
}
HostInfoServiceClient is the client API for HostInfoService 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 NewHostInfoServiceClient ¶
func NewHostInfoServiceClient(cc grpc.ClientConnInterface) HostInfoServiceClient
type HostInfoServiceServer ¶
type HostInfoServiceServer interface { Info(context.Context, *InfoRequest) (*InfoResponse, error) // contains filtered or unexported methods }
HostInfoServiceServer is the server API for HostInfoService service. All implementations must embed UnimplementedHostInfoServiceServer for forward compatibility
type InfoRequest ¶
type InfoRequest struct {
// contains filtered or unexported fields
}
func (*InfoRequest) Descriptor
deprecated
func (*InfoRequest) Descriptor() ([]byte, []int)
Deprecated: Use InfoRequest.ProtoReflect.Descriptor instead.
func (*InfoRequest) ProtoMessage ¶
func (*InfoRequest) ProtoMessage()
func (*InfoRequest) ProtoReflect ¶
func (x *InfoRequest) ProtoReflect() protoreflect.Message
func (*InfoRequest) Reset ¶
func (x *InfoRequest) Reset()
func (*InfoRequest) String ¶
func (x *InfoRequest) String() string
type InfoResponse ¶
type InfoResponse struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Addresses []string `protobuf:"bytes,2,rep,name=addresses,proto3" json:"addresses,omitempty"` Protocols []string `protobuf:"bytes,3,rep,name=protocols,proto3" json:"protocols,omitempty"` Peers []string `protobuf:"bytes,4,rep,name=peers,proto3" json:"peers,omitempty"` // contains filtered or unexported fields }
func (*InfoResponse) Descriptor
deprecated
func (*InfoResponse) Descriptor() ([]byte, []int)
Deprecated: Use InfoResponse.ProtoReflect.Descriptor instead.
func (*InfoResponse) GetAddresses ¶
func (x *InfoResponse) GetAddresses() []string
func (*InfoResponse) GetId ¶
func (x *InfoResponse) GetId() string
func (*InfoResponse) GetPeers ¶
func (x *InfoResponse) GetPeers() []string
func (*InfoResponse) GetProtocols ¶
func (x *InfoResponse) GetProtocols() []string
func (*InfoResponse) ProtoMessage ¶
func (*InfoResponse) ProtoMessage()
func (*InfoResponse) ProtoReflect ¶
func (x *InfoResponse) ProtoReflect() protoreflect.Message
func (*InfoResponse) Reset ¶
func (x *InfoResponse) Reset()
func (*InfoResponse) String ¶
func (x *InfoResponse) String() string
type UnimplementedHostInfoServiceServer ¶
type UnimplementedHostInfoServiceServer struct { }
UnimplementedHostInfoServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedHostInfoServiceServer) Info ¶
func (UnimplementedHostInfoServiceServer) Info(context.Context, *InfoRequest) (*InfoResponse, error)
type UnsafeHostInfoServiceServer ¶
type UnsafeHostInfoServiceServer interface {
// contains filtered or unexported methods
}
UnsafeHostInfoServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HostInfoServiceServer will result in compilation errors.