v1

package
v0.1.271 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 15 Imported by: 4

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_stream_v1_stream_proto protoreflect.FileDescriptor
View Source
var StreamService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.stream.v1.StreamService",
	HandlerType: (*StreamServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListStreams",
			Handler:    _StreamService_ListStreams_Handler,
		},
		{
			MethodName: "AddStream",
			Handler:    _StreamService_AddStream_Handler,
		},
		{
			MethodName: "RemoveStream",
			Handler:    _StreamService_RemoveStream_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "stream/v1/stream.proto",
}

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

Functions

func RegisterStreamServiceHandler

func RegisterStreamServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterStreamServiceHandler registers the http handlers for service StreamService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterStreamServiceHandlerClient

func RegisterStreamServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client StreamServiceClient) error

RegisterStreamServiceHandlerClient registers the http handlers for service StreamService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "StreamServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "StreamServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "StreamServiceClient" to call the correct interceptors.

func RegisterStreamServiceHandlerFromEndpoint

func RegisterStreamServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterStreamServiceHandlerFromEndpoint is same as RegisterStreamServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterStreamServiceHandlerServer

func RegisterStreamServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server StreamServiceServer) error

RegisterStreamServiceHandlerServer registers the http handlers for service StreamService to "mux". UnaryRPC :call StreamServiceServer 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 RegisterStreamServiceHandlerFromEndpoint instead.

func RegisterStreamServiceServer

func RegisterStreamServiceServer(s grpc.ServiceRegistrar, srv StreamServiceServer)

Types

type AddStreamRequest

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

A AddStreamRequest requests the given stream be added to the connection.

func (*AddStreamRequest) Descriptor deprecated

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

Deprecated: Use AddStreamRequest.ProtoReflect.Descriptor instead.

func (*AddStreamRequest) GetName

func (x *AddStreamRequest) GetName() string

func (*AddStreamRequest) ProtoMessage

func (*AddStreamRequest) ProtoMessage()

func (*AddStreamRequest) ProtoReflect

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

func (*AddStreamRequest) Reset

func (x *AddStreamRequest) Reset()

func (*AddStreamRequest) String

func (x *AddStreamRequest) String() string

type AddStreamResponse

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

AddStreamResponse is returned after a successful AddStreamRequest.

func (*AddStreamResponse) Descriptor deprecated

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

Deprecated: Use AddStreamResponse.ProtoReflect.Descriptor instead.

func (*AddStreamResponse) ProtoMessage

func (*AddStreamResponse) ProtoMessage()

func (*AddStreamResponse) ProtoReflect

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

func (*AddStreamResponse) Reset

func (x *AddStreamResponse) Reset()

func (*AddStreamResponse) String

func (x *AddStreamResponse) String() string

type ListStreamsRequest

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

ListStreamsRequest requests all streams registered.

func (*ListStreamsRequest) Descriptor deprecated

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

Deprecated: Use ListStreamsRequest.ProtoReflect.Descriptor instead.

func (*ListStreamsRequest) ProtoMessage

func (*ListStreamsRequest) ProtoMessage()

func (*ListStreamsRequest) ProtoReflect

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

func (*ListStreamsRequest) Reset

func (x *ListStreamsRequest) Reset()

func (*ListStreamsRequest) String

func (x *ListStreamsRequest) String() string

type ListStreamsResponse

type ListStreamsResponse struct {
	Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"`
	// contains filtered or unexported fields
}

A ListStreamsResponse details streams registered.

func (*ListStreamsResponse) Descriptor deprecated

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

Deprecated: Use ListStreamsResponse.ProtoReflect.Descriptor instead.

func (*ListStreamsResponse) GetNames

func (x *ListStreamsResponse) GetNames() []string

func (*ListStreamsResponse) ProtoMessage

func (*ListStreamsResponse) ProtoMessage()

func (*ListStreamsResponse) ProtoReflect

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

func (*ListStreamsResponse) Reset

func (x *ListStreamsResponse) Reset()

func (*ListStreamsResponse) String

func (x *ListStreamsResponse) String() string

type RemoveStreamRequest

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

A RemoveStreamRequest requests the given stream be removed from the connection.

func (*RemoveStreamRequest) Descriptor deprecated

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

Deprecated: Use RemoveStreamRequest.ProtoReflect.Descriptor instead.

func (*RemoveStreamRequest) GetName

func (x *RemoveStreamRequest) GetName() string

func (*RemoveStreamRequest) ProtoMessage

func (*RemoveStreamRequest) ProtoMessage()

func (*RemoveStreamRequest) ProtoReflect

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

func (*RemoveStreamRequest) Reset

func (x *RemoveStreamRequest) Reset()

func (*RemoveStreamRequest) String

func (x *RemoveStreamRequest) String() string

type RemoveStreamResponse

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

RemoveStreamResponse is returned after a successful RemoveStreamRequest.

func (*RemoveStreamResponse) Descriptor deprecated

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

Deprecated: Use RemoveStreamResponse.ProtoReflect.Descriptor instead.

func (*RemoveStreamResponse) ProtoMessage

func (*RemoveStreamResponse) ProtoMessage()

func (*RemoveStreamResponse) ProtoReflect

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

func (*RemoveStreamResponse) Reset

func (x *RemoveStreamResponse) Reset()

func (*RemoveStreamResponse) String

func (x *RemoveStreamResponse) String() string

type StreamServiceClient

type StreamServiceClient interface {
	// ListStreams returns all streams registered.
	ListStreams(ctx context.Context, in *ListStreamsRequest, opts ...grpc.CallOption) (*ListStreamsResponse, error)
	// AddStream requests a particular stream be added.
	AddStream(ctx context.Context, in *AddStreamRequest, opts ...grpc.CallOption) (*AddStreamResponse, error)
	// RemoveStream requests a particular stream be removed. If the calling client
	// is the last to be receiving the stream, it will attempt to be stopped to
	// conserve resources.
	RemoveStream(ctx context.Context, in *RemoveStreamRequest, opts ...grpc.CallOption) (*RemoveStreamResponse, error)
}

StreamServiceClient is the client API for StreamService 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.

type StreamServiceServer

type StreamServiceServer interface {
	// ListStreams returns all streams registered.
	ListStreams(context.Context, *ListStreamsRequest) (*ListStreamsResponse, error)
	// AddStream requests a particular stream be added.
	AddStream(context.Context, *AddStreamRequest) (*AddStreamResponse, error)
	// RemoveStream requests a particular stream be removed. If the calling client
	// is the last to be receiving the stream, it will attempt to be stopped to
	// conserve resources.
	RemoveStream(context.Context, *RemoveStreamRequest) (*RemoveStreamResponse, error)
	// contains filtered or unexported methods
}

StreamServiceServer is the server API for StreamService service. All implementations must embed UnimplementedStreamServiceServer for forward compatibility

type UnimplementedStreamServiceServer

type UnimplementedStreamServiceServer struct {
}

UnimplementedStreamServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedStreamServiceServer) AddStream

func (UnimplementedStreamServiceServer) ListStreams

func (UnimplementedStreamServiceServer) RemoveStream

type UnsafeStreamServiceServer

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

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

Jump to

Keyboard shortcuts

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