server

package
v0.0.0-...-d037a85 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package server is a generated protocol buffer package.

Go

Go defines some messages and services and is generated using protoc-gen-go.

It is generated from these files:

go.proto

It has these top-level messages:

TestRequest
TestReply

Package server is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterTestServiceHandler

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

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

func RegisterTestServiceHandlerClient

func RegisterTestServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TestServiceClient) error

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

func RegisterTestServiceHandlerFromEndpoint

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

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

func RegisterTestServiceServer

func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer)

Types

type TestReply

type TestReply struct {
	// RequestTime is the time of the request.
	RequestTime *google_protobuf2.Timestamp `protobuf:"bytes,1,opt,name=request_time,json=requestTime" json:"request_time,omitempty"`
}

func (*TestReply) Descriptor

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

func (*TestReply) GetRequestTime

func (m *TestReply) GetRequestTime() *google_protobuf2.Timestamp

func (*TestReply) ProtoMessage

func (*TestReply) ProtoMessage()

func (*TestReply) Reset

func (m *TestReply) Reset()

func (*TestReply) String

func (m *TestReply) String() string

type TestRequest

type TestRequest struct {
	// Id is the Id of the request.
	Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
}

TestRequest is a simple message

func (*TestRequest) Descriptor

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

func (*TestRequest) GetId

func (m *TestRequest) GetId() string

func (*TestRequest) ProtoMessage

func (*TestRequest) ProtoMessage()

func (*TestRequest) Reset

func (m *TestRequest) Reset()

func (*TestRequest) String

func (m *TestRequest) String() string

type TestServiceClient

type TestServiceClient interface {
	// TestMethod is a simple unary method.
	TestMethod(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestReply, error)
	// Empty is a method with no input.
	Empty(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (*TestReply, error)
}

func NewTestServiceClient

func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient

type TestServiceServer

type TestServiceServer interface {
	// TestMethod is a simple unary method.
	TestMethod(context.Context, *TestRequest) (*TestReply, error)
	// Empty is a method with no input.
	Empty(context.Context, *google_protobuf1.Empty) (*TestReply, error)
}

Jump to

Keyboard shortcuts

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