proto

package
v0.0.0-...-acfe538 Latest Latest
Warning

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

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

Documentation

Overview

Package proto is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_proto_github_proto protoreflect.FileDescriptor
View Source
var GithubService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "GithubService",
	HandlerType: (*GithubServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Github",
			Handler:    _GithubService_Github_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/github.proto",
}

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

Functions

func RegisterGithubServiceHandler

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

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

func RegisterGithubServiceHandlerClient

func RegisterGithubServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GithubServiceClient) error

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

func RegisterGithubServiceHandlerFromEndpoint

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

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

func RegisterGithubServiceHandlerServer

func RegisterGithubServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GithubServiceServer) error

RegisterGithubServiceHandlerServer registers the http handlers for service GithubService to "mux". UnaryRPC :call GithubServiceServer 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 RegisterGithubServiceHandlerFromEndpoint instead.

func RegisterGithubServiceServer

func RegisterGithubServiceServer(s grpc.ServiceRegistrar, srv GithubServiceServer)

Types

type GithubInput

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

Request

func (*GithubInput) Descriptor deprecated

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

Deprecated: Use GithubInput.ProtoReflect.Descriptor instead.

func (*GithubInput) GetUsername

func (x *GithubInput) GetUsername() string

func (*GithubInput) ProtoMessage

func (*GithubInput) ProtoMessage()

func (*GithubInput) ProtoReflect

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

func (*GithubInput) Reset

func (x *GithubInput) Reset()

func (*GithubInput) String

func (x *GithubInput) String() string

type GithubOutput

type GithubOutput struct {
	Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"`
	Name  string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Bio   string `protobuf:"bytes,3,opt,name=bio,proto3" json:"bio,omitempty"`
	Blog  string `protobuf:"bytes,4,opt,name=blog,proto3" json:"blog,omitempty"`
	// contains filtered or unexported fields
}

Response

func (*GithubOutput) Descriptor deprecated

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

Deprecated: Use GithubOutput.ProtoReflect.Descriptor instead.

func (*GithubOutput) GetBio

func (x *GithubOutput) GetBio() string

func (*GithubOutput) GetBlog

func (x *GithubOutput) GetBlog() string

func (*GithubOutput) GetLogin

func (x *GithubOutput) GetLogin() string

func (*GithubOutput) GetName

func (x *GithubOutput) GetName() string

func (*GithubOutput) ProtoMessage

func (*GithubOutput) ProtoMessage()

func (*GithubOutput) ProtoReflect

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

func (*GithubOutput) Reset

func (x *GithubOutput) Reset()

func (*GithubOutput) String

func (x *GithubOutput) String() string

type GithubServiceClient

type GithubServiceClient interface {
	Github(ctx context.Context, in *GithubInput, opts ...grpc.CallOption) (*GithubOutput, error)
}

GithubServiceClient is the client API for GithubService 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 GithubServiceServer

type GithubServiceServer interface {
	Github(context.Context, *GithubInput) (*GithubOutput, error)
	// contains filtered or unexported methods
}

GithubServiceServer is the server API for GithubService service. All implementations must embed UnimplementedGithubServiceServer for forward compatibility

type UnimplementedGithubServiceServer

type UnimplementedGithubServiceServer struct {
}

UnimplementedGithubServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedGithubServiceServer) Github

type UnsafeGithubServiceServer

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

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

Jump to

Keyboard shortcuts

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