passage

package
v0.0.0-...-f698437 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package passage is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_proto_passage_passage_proto protoreflect.FileDescriptor
View Source
var PassageService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "PassageService",
	HandlerType: (*PassageServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Passage",
			Handler:    _PassageService_Passage_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/passage/passage.proto",
}

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

Functions

func RegisterPassageServiceHandler

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

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

func RegisterPassageServiceHandlerClient

func RegisterPassageServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PassageServiceClient) error

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

func RegisterPassageServiceHandlerFromEndpoint

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

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

func RegisterPassageServiceHandlerServer

func RegisterPassageServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PassageServiceServer) error

RegisterPassageServiceHandlerServer registers the http handlers for service PassageService to "mux". UnaryRPC :call PassageServiceServer 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 RegisterPassageServiceHandlerFromEndpoint instead.

func RegisterPassageServiceServer

func RegisterPassageServiceServer(s grpc.ServiceRegistrar, srv PassageServiceServer)

Types

type PassageRequest

type PassageRequest struct {
	Book    string `protobuf:"bytes,1,opt,name=book,proto3" json:"book,omitempty"`
	Chapter int32  `protobuf:"varint,2,opt,name=chapter,proto3" json:"chapter,omitempty"`
	Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

func (*PassageRequest) Descriptor deprecated

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

Deprecated: Use PassageRequest.ProtoReflect.Descriptor instead.

func (*PassageRequest) GetBook

func (x *PassageRequest) GetBook() string

func (*PassageRequest) GetChapter

func (x *PassageRequest) GetChapter() int32

func (*PassageRequest) GetVersion

func (x *PassageRequest) GetVersion() string

func (*PassageRequest) ProtoMessage

func (*PassageRequest) ProtoMessage()

func (*PassageRequest) ProtoReflect

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

func (*PassageRequest) Reset

func (x *PassageRequest) Reset()

func (*PassageRequest) String

func (x *PassageRequest) String() string

type PassageResponse

type PassageResponse struct {
	Verse []*Verse `protobuf:"bytes,1,rep,name=verse,proto3" json:"verse,omitempty"`
	// contains filtered or unexported fields
}

func (*PassageResponse) Descriptor deprecated

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

Deprecated: Use PassageResponse.ProtoReflect.Descriptor instead.

func (*PassageResponse) GetVerse

func (x *PassageResponse) GetVerse() []*Verse

func (*PassageResponse) ProtoMessage

func (*PassageResponse) ProtoMessage()

func (*PassageResponse) ProtoReflect

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

func (*PassageResponse) Reset

func (x *PassageResponse) Reset()

func (*PassageResponse) String

func (x *PassageResponse) String() string

type PassageServiceClient

type PassageServiceClient interface {
	Passage(ctx context.Context, in *PassageRequest, opts ...grpc.CallOption) (*PassageResponse, error)
}

PassageServiceClient is the client API for PassageService 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 PassageServiceServer

type PassageServiceServer interface {
	Passage(context.Context, *PassageRequest) (*PassageResponse, error)
	// contains filtered or unexported methods
}

PassageServiceServer is the server API for PassageService service. All implementations must embed UnimplementedPassageServiceServer for forward compatibility

type UnimplementedPassageServiceServer

type UnimplementedPassageServiceServer struct {
}

UnimplementedPassageServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedPassageServiceServer) Passage

type UnsafePassageServiceServer

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

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

type Verse

type Verse struct {
	Verse   int32  `protobuf:"varint,1,opt,name=verse,proto3" json:"verse,omitempty"`
	Type    string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

func (*Verse) Descriptor deprecated

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

Deprecated: Use Verse.ProtoReflect.Descriptor instead.

func (*Verse) GetContent

func (x *Verse) GetContent() string

func (*Verse) GetType

func (x *Verse) GetType() string

func (*Verse) GetVerse

func (x *Verse) GetVerse() int32

func (*Verse) ProtoMessage

func (*Verse) ProtoMessage()

func (*Verse) ProtoReflect

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

func (*Verse) Reset

func (x *Verse) Reset()

func (*Verse) String

func (x *Verse) String() string

Jump to

Keyboard shortcuts

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