Documentation
¶
Index ¶
- Variables
- func NewHTMLMyTestServer(client MyTestClient, stringer func(req, resp interface{}) ([]byte, error)) *htmlMyTest
- func NewHandler(grpcAddr string, stringer func(req, resp interface{}) ([]byte, error), ...) (net_http.Handler, error)
- func RegisterMyTestServer(s *grpc.Server, srv MyTestServer)
- func Serve(httpAddr, grpcAddr string, ...)
- type MyMsg
- func (*MyMsg) Descriptor() ([]byte, []int)
- func (m *MyMsg) GetValue() int64
- func (*MyMsg) ProtoMessage()
- func (m *MyMsg) Reset()
- func (m *MyMsg) String() string
- func (m *MyMsg) XXX_DiscardUnknown()
- func (m *MyMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MyMsg) XXX_Merge(src proto.Message)
- func (m *MyMsg) XXX_Size() int
- func (m *MyMsg) XXX_Unmarshal(b []byte) error
- type MyMsg2
- func (*MyMsg2) Descriptor() ([]byte, []int)
- func (m *MyMsg2) GetValue() int64
- func (*MyMsg2) ProtoMessage()
- func (m *MyMsg2) Reset()
- func (m *MyMsg2) String() string
- func (m *MyMsg2) XXX_DiscardUnknown()
- func (m *MyMsg2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MyMsg2) XXX_Merge(src proto.Message)
- func (m *MyMsg2) XXX_Size() int
- func (m *MyMsg2) XXX_Unmarshal(b []byte) error
- type MyRequest
- func (*MyRequest) Descriptor() ([]byte, []int)
- func (m *MyRequest) GetValue() int64
- func (m *MyRequest) GetValue2() int32
- func (*MyRequest) ProtoMessage()
- func (m *MyRequest) Reset()
- func (m *MyRequest) String() string
- func (m *MyRequest) XXX_DiscardUnknown()
- func (m *MyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MyRequest) XXX_Merge(src proto.Message)
- func (m *MyRequest) XXX_Size() int
- func (m *MyRequest) XXX_Unmarshal(b []byte) error
- type MyResponse
- func (*MyResponse) Descriptor() ([]byte, []int)
- func (m *MyResponse) GetValue() int64
- func (*MyResponse) ProtoMessage()
- func (m *MyResponse) Reset()
- func (m *MyResponse) String() string
- func (m *MyResponse) XXX_DiscardUnknown()
- func (m *MyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MyResponse) XXX_Merge(src proto.Message)
- func (m *MyResponse) XXX_Size() int
- func (m *MyResponse) XXX_Unmarshal(b []byte) error
- type MyTestClient
- type MyTestServer
- type MyTest_BidiClient
- type MyTest_BidiServer
- type MyTest_DownstreamClient
- type MyTest_DownstreamServer
- type MyTest_UpstreamyClient
- type MyTest_UpstreamyServer
- type UnimplementedMyTestServer
- func (*UnimplementedMyTestServer) Bidi(srv MyTest_BidiServer) error
- func (*UnimplementedMyTestServer) Downstream(req *MyRequest, srv MyTest_DownstreamServer) error
- func (*UnimplementedMyTestServer) UnaryCall(ctx context.Context, req *MyRequest) (*MyResponse, error)
- func (*UnimplementedMyTestServer) Upstreamy(srv MyTest_UpstreamyServer) error
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
</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) ProtoMessage ¶
func (*MyMsg) ProtoMessage()
func (*MyMsg) XXX_DiscardUnknown ¶ added in v1.1.0
func (m *MyMsg) XXX_DiscardUnknown()
func (*MyMsg) XXX_Marshal ¶ added in v1.1.0
func (*MyMsg) XXX_Unmarshal ¶ added in v1.1.0
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) ProtoMessage ¶
func (*MyMsg2) ProtoMessage()
func (*MyMsg2) XXX_DiscardUnknown ¶ added in v1.1.0
func (m *MyMsg2) XXX_DiscardUnknown()
func (*MyMsg2) XXX_Marshal ¶ added in v1.1.0
func (*MyMsg2) XXX_Unmarshal ¶ added in v1.1.0
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) ProtoMessage ¶
func (*MyRequest) ProtoMessage()
func (*MyRequest) XXX_DiscardUnknown ¶ added in v1.1.0
func (m *MyRequest) XXX_DiscardUnknown()
func (*MyRequest) XXX_Marshal ¶ added in v1.1.0
func (*MyRequest) XXX_Unmarshal ¶ added in v1.1.0
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_BidiServer ¶
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) Bidi(srv MyTest_BidiServer) error
func (*UnimplementedMyTestServer) Downstream ¶ added in v1.1.0
func (*UnimplementedMyTestServer) Downstream(req *MyRequest, srv MyTest_DownstreamServer) error
func (*UnimplementedMyTestServer) UnaryCall ¶ added in v1.1.0
func (*UnimplementedMyTestServer) UnaryCall(ctx context.Context, req *MyRequest) (*MyResponse, error)
func (*UnimplementedMyTestServer) Upstreamy ¶ added in v1.1.0
func (*UnimplementedMyTestServer) Upstreamy(srv MyTest_UpstreamyServer) error
Click to show internal directories.
Click to hide internal directories.