com_grpc

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2019 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultHtmlStringer = func(req, resp interface{}) ([]byte, error) {
	header := []byte("<p><div class=\"container\"><pre>")
	data, err := encoding_json.MarshalIndent(resp, "", "\t")
	if err != nil {
		return nil, err
	}
	footer := []byte("</pre></div></p>")
	return append(append(header, data...), footer...), nil
}
View Source
var Footer string = `
	</body>
	</html>
	`
View Source
var FormMyTest_Bidi string = `` /* 14031-byte string literal not displayed */
View Source
var FormMyTest_Downstream string = `` /* 14298-byte string literal not displayed */
View Source
var FormMyTest_UnaryCall string = `` /* 14296-byte string literal not displayed */
View Source
var FormMyTest_Upstreamy string = `` /* 14041-byte string literal not displayed */
View Source
var Header func(servName, methodName string) string = func(servName, methodName string) string {
	return `
	<html>
	<head>
	<title>` + servName + `:` + methodName + `</title>
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
	</head>
	<body>
	`
}

Functions

func NewHTMLMyTestServer

func NewHTMLMyTestServer(client MyTestClient, stringer func(req, resp interface{}) ([]byte, error)) *htmlMyTest

func NewHandler

func NewHandler(grpcAddr string, stringer func(req, resp interface{}) ([]byte, error), opts ...google_golang_org_grpc.DialOption) (net_http.Handler, error)

func RegisterMyTestServer

func RegisterMyTestServer(s *grpc.Server, srv MyTestServer)

func Serve

func Serve(httpAddr, grpcAddr string, stringer func(req, resp interface{}) ([]byte, error), opts ...google_golang_org_grpc.DialOption)

Types

type MyMsg

type MyMsg struct {
	Value                int64    `protobuf:"varint,1,opt,name=Value,proto3" json:"Value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*MyMsg) Descriptor

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

func (*MyMsg) GetValue

func (m *MyMsg) GetValue() int64

func (*MyMsg) ProtoMessage

func (*MyMsg) ProtoMessage()

func (*MyMsg) Reset

func (m *MyMsg) Reset()

func (*MyMsg) String

func (m *MyMsg) String() string

func (*MyMsg) XXX_DiscardUnknown added in v1.1.0

func (m *MyMsg) XXX_DiscardUnknown()

func (*MyMsg) XXX_Marshal added in v1.1.0

func (m *MyMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MyMsg) XXX_Merge added in v1.1.0

func (m *MyMsg) XXX_Merge(src proto.Message)

func (*MyMsg) XXX_Size added in v1.1.0

func (m *MyMsg) XXX_Size() int

func (*MyMsg) XXX_Unmarshal added in v1.1.0

func (m *MyMsg) XXX_Unmarshal(b []byte) error

type MyMsg2

type MyMsg2 struct {
	Value                int64    `protobuf:"varint,1,opt,name=Value,proto3" json:"Value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*MyMsg2) Descriptor

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

func (*MyMsg2) GetValue

func (m *MyMsg2) GetValue() int64

func (*MyMsg2) ProtoMessage

func (*MyMsg2) ProtoMessage()

func (*MyMsg2) Reset

func (m *MyMsg2) Reset()

func (*MyMsg2) String

func (m *MyMsg2) String() string

func (*MyMsg2) XXX_DiscardUnknown added in v1.1.0

func (m *MyMsg2) XXX_DiscardUnknown()

func (*MyMsg2) XXX_Marshal added in v1.1.0

func (m *MyMsg2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MyMsg2) XXX_Merge added in v1.1.0

func (m *MyMsg2) XXX_Merge(src proto.Message)

func (*MyMsg2) XXX_Size added in v1.1.0

func (m *MyMsg2) XXX_Size() int

func (*MyMsg2) XXX_Unmarshal added in v1.1.0

func (m *MyMsg2) XXX_Unmarshal(b []byte) error

type MyRequest

type MyRequest struct {
	Value                int64    `protobuf:"varint,1,opt,name=Value,proto3" json:"Value,omitempty"`
	Value2               int32    `protobuf:"varint,2,opt,name=Value2,proto3" json:"Value2,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*MyRequest) Descriptor

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

func (*MyRequest) GetValue

func (m *MyRequest) GetValue() int64

func (*MyRequest) GetValue2

func (m *MyRequest) GetValue2() int32

func (*MyRequest) ProtoMessage

func (*MyRequest) ProtoMessage()

func (*MyRequest) Reset

func (m *MyRequest) Reset()

func (*MyRequest) String

func (m *MyRequest) String() string

func (*MyRequest) XXX_DiscardUnknown added in v1.1.0

func (m *MyRequest) XXX_DiscardUnknown()

func (*MyRequest) XXX_Marshal added in v1.1.0

func (m *MyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MyRequest) XXX_Merge added in v1.1.0

func (m *MyRequest) XXX_Merge(src proto.Message)

func (*MyRequest) XXX_Size added in v1.1.0

func (m *MyRequest) XXX_Size() int

func (*MyRequest) XXX_Unmarshal added in v1.1.0

func (m *MyRequest) XXX_Unmarshal(b []byte) error

type MyResponse

type MyResponse struct {
	Value                int64    `protobuf:"varint,1,opt,name=Value,proto3" json:"Value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*MyResponse) Descriptor

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

func (*MyResponse) GetValue

func (m *MyResponse) GetValue() int64

func (*MyResponse) ProtoMessage

func (*MyResponse) ProtoMessage()

func (*MyResponse) Reset

func (m *MyResponse) Reset()

func (*MyResponse) String

func (m *MyResponse) String() string

func (*MyResponse) XXX_DiscardUnknown added in v1.1.0

func (m *MyResponse) XXX_DiscardUnknown()

func (*MyResponse) XXX_Marshal added in v1.1.0

func (m *MyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MyResponse) XXX_Merge added in v1.1.0

func (m *MyResponse) XXX_Merge(src proto.Message)

func (*MyResponse) XXX_Size added in v1.1.0

func (m *MyResponse) XXX_Size() int

func (*MyResponse) XXX_Unmarshal added in v1.1.0

func (m *MyResponse) XXX_Unmarshal(b []byte) error

type MyTestClient

type MyTestClient interface {
	UnaryCall(ctx context.Context, in *MyRequest, opts ...grpc.CallOption) (*MyResponse, error)
	// This RPC streams from the server only.
	Downstream(ctx context.Context, in *MyRequest, opts ...grpc.CallOption) (MyTest_DownstreamClient, error)
	// This RPC streams from the client.
	Upstreamy(ctx context.Context, opts ...grpc.CallOption) (MyTest_UpstreamyClient, error)
	// This one streams in both directions.
	Bidi(ctx context.Context, opts ...grpc.CallOption) (MyTest_BidiClient, error)
}

MyTestClient is the client API for MyTest service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMyTestClient

func NewMyTestClient(cc *grpc.ClientConn) MyTestClient

type MyTestServer

type MyTestServer interface {
	UnaryCall(context.Context, *MyRequest) (*MyResponse, error)
	// This RPC streams from the server only.
	Downstream(*MyRequest, MyTest_DownstreamServer) error
	// This RPC streams from the client.
	Upstreamy(MyTest_UpstreamyServer) error
	// This one streams in both directions.
	Bidi(MyTest_BidiServer) error
}

MyTestServer is the server API for MyTest service.

type MyTest_BidiClient

type MyTest_BidiClient interface {
	Send(*MyMsg) error
	Recv() (*MyMsg2, error)
	grpc.ClientStream
}

type MyTest_BidiServer

type MyTest_BidiServer interface {
	Send(*MyMsg2) error
	Recv() (*MyMsg, error)
	grpc.ServerStream
}

type MyTest_DownstreamClient

type MyTest_DownstreamClient interface {
	Recv() (*MyMsg, error)
	grpc.ClientStream
}

type MyTest_DownstreamServer

type MyTest_DownstreamServer interface {
	Send(*MyMsg) error
	grpc.ServerStream
}

type MyTest_UpstreamyClient

type MyTest_UpstreamyClient interface {
	Send(*MyMsg) error
	CloseAndRecv() (*MyResponse, error)
	grpc.ClientStream
}

type MyTest_UpstreamyServer

type MyTest_UpstreamyServer interface {
	SendAndClose(*MyResponse) error
	Recv() (*MyMsg, error)
	grpc.ServerStream
}

type UnimplementedMyTestServer added in v1.1.0

type UnimplementedMyTestServer struct {
}

UnimplementedMyTestServer can be embedded to have forward compatible implementations.

func (*UnimplementedMyTestServer) Bidi added in v1.1.0

func (*UnimplementedMyTestServer) Downstream added in v1.1.0

func (*UnimplementedMyTestServer) UnaryCall added in v1.1.0

func (*UnimplementedMyTestServer) Upstreamy added in v1.1.0

Jump to

Keyboard shortcuts

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