proto

package
v0.0.0-...-7712f03 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package proto is a generated protocol buffer package.

It is generated from these files:

example/proto/demo.proto

It has these top-level messages:

Demo
Custom

Package proto is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDemoServiceHandler

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

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

func RegisterDemoServiceHandlerClient

func RegisterDemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DemoServiceClient) error

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

func RegisterDemoServiceHandlerFromEndpoint

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

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

func RegisterDemoServiceServer

func RegisterDemoServiceServer(s *grpc.Server, srv DemoServiceServer)

Types

type Custom

type Custom struct {
	DoItYourself string `protobuf:"bytes,1,opt,name=doItYourself" json:"doItYourself,omitempty"`
}

This message left as is to show that we can provide our own preprocessors

func (*Custom) Descriptor

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

func (*Custom) GetDoItYourself

func (m *Custom) GetDoItYourself() string

func (*Custom) ProtoMessage

func (*Custom) ProtoMessage()

func (*Custom) Reset

func (m *Custom) Reset()

func (*Custom) String

func (m *Custom) String() string

type Demo

type Demo struct {
	// Also it is possible to specify additional method on field level
	PreprocessedField string `protobuf:"bytes,1,opt,name=preprocessedField" json:"preprocessedField,omitempty"`
	// Preprocessor automatically checks if field is repeated and generates methods accordingly
	PreprocessedRepeatedField []string `protobuf:"bytes,2,rep,name=preprocessedRepeatedField" json:"preprocessedRepeatedField,omitempty"`
	// If a field does not fit preprocess method, it is just ignored
	Ignored int32 `protobuf:"varint,3,opt,name=ignored" json:"ignored,omitempty"`
}

func (*Demo) Descriptor

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

func (*Demo) GetIgnored

func (m *Demo) GetIgnored() int32

func (*Demo) GetPreprocessedField

func (m *Demo) GetPreprocessedField() string

func (*Demo) GetPreprocessedRepeatedField

func (m *Demo) GetPreprocessedRepeatedField() []string

func (*Demo) Preprocess

func (m *Demo) Preprocess() error

func (*Demo) ProtoMessage

func (*Demo) ProtoMessage()

func (*Demo) Reset

func (m *Demo) Reset()

func (*Demo) String

func (m *Demo) String() string

type DemoServiceClient

type DemoServiceClient interface {
	Echo(ctx context.Context, in *Demo, opts ...grpc.CallOption) (*Demo, error)
}

func NewDemoServiceClient

func NewDemoServiceClient(cc *grpc.ClientConn) DemoServiceClient

type DemoServiceServer

type DemoServiceServer interface {
	Echo(context.Context, *Demo) (*Demo, error)
}

Jump to

Keyboard shortcuts

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