client_api

package
v0.0.0-...-e03385f Latest Latest
Warning

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

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

Documentation

Overview

Package client_api is a generated protocol buffer package.

It is generated from these files:

api.proto

It has these top-level messages:

PingMessage
DummyDataRequest
DummyDataResponse

Package client_api is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package client_api provides api for client uses

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterPingHandler

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

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

func RegisterPingHandlerClient

func RegisterPingHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PingClient) error

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

func RegisterPingHandlerFromEndpoint

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

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

func RegisterPingServer

func RegisterPingServer(s *grpc.Server, srv PingServer)

Types

type DummyDataRequest

type DummyDataRequest struct {
	Keyname string `protobuf:"bytes,1,opt,name=keyname" json:"keyname,omitempty"`
}

func (*DummyDataRequest) Descriptor

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

func (*DummyDataRequest) GetKeyname

func (m *DummyDataRequest) GetKeyname() string

func (*DummyDataRequest) ProtoMessage

func (*DummyDataRequest) ProtoMessage()

func (*DummyDataRequest) Reset

func (m *DummyDataRequest) Reset()

func (*DummyDataRequest) String

func (m *DummyDataRequest) String() string

type DummyDataResponse

type DummyDataResponse struct {
	Id        int64   `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
	Firstname string  `protobuf:"bytes,2,opt,name=firstname" json:"firstname,omitempty"`
	Balance   float64 `protobuf:"fixed64,3,opt,name=balance" json:"balance,omitempty"`
}

func (*DummyDataResponse) Descriptor

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

func (*DummyDataResponse) GetBalance

func (m *DummyDataResponse) GetBalance() float64

func (*DummyDataResponse) GetFirstname

func (m *DummyDataResponse) GetFirstname() string

func (*DummyDataResponse) GetId

func (m *DummyDataResponse) GetId() int64

func (*DummyDataResponse) ProtoMessage

func (*DummyDataResponse) ProtoMessage()

func (*DummyDataResponse) Reset

func (m *DummyDataResponse) Reset()

func (*DummyDataResponse) String

func (m *DummyDataResponse) String() string

type PingClient

type PingClient interface {
	SayHello(ctx context.Context, in *PingMessage, opts ...grpc.CallOption) (*PingMessage, error)
	GetDummyData(ctx context.Context, in *DummyDataRequest, opts ...grpc.CallOption) (*DummyDataResponse, error)
}

func NewPingClient

func NewPingClient(cc *grpc.ClientConn) PingClient

type PingMessage

type PingMessage struct {
	Greeting string `protobuf:"bytes,1,opt,name=greeting" json:"greeting,omitempty"`
}

func (*PingMessage) Descriptor

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

func (*PingMessage) GetGreeting

func (m *PingMessage) GetGreeting() string

func (*PingMessage) ProtoMessage

func (*PingMessage) ProtoMessage()

func (*PingMessage) Reset

func (m *PingMessage) Reset()

func (*PingMessage) String

func (m *PingMessage) String() string

type PingServer

type PingServer interface {
	SayHello(context.Context, *PingMessage) (*PingMessage, error)
	GetDummyData(context.Context, *DummyDataRequest) (*DummyDataResponse, error)
}

type Server

type Server struct {
}

Server represents the gRPC server

func (*Server) GetDummyData

func (s *Server) GetDummyData(ctx context.Context, in *DummyDataRequest) (*DummyDataResponse, error)

GetDummyData generates response to GetDummyData

func (*Server) SayHello

func (s *Server) SayHello(ctx context.Context, in *PingMessage) (*PingMessage, error)

SayHello generates response to a Ping request

Jump to

Keyboard shortcuts

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