Documentation ¶
Overview ¶
Package service is a generated protocol buffer package.
It is generated from these files:
arith.proto echo.proto
It has these top-level messages:
ArithRequest ArithResponse EchoRequest EchoResponse
Index ¶
- func AcceptArithServiceClient(lis net.Listener, x ArithService)
- func AcceptEchoServiceClient(lis net.Listener, x EchoService)
- func ListenAndServeArithService(network, addr string, x ArithService) error
- func ListenAndServeEchoService(network, addr string, x EchoService) error
- func NewArithServiceServer(x ArithService) *rpc.Server
- func NewEchoServiceServer(x EchoService) *rpc.Server
- func RegisterArithService(srv *rpc.Server, x ArithService) error
- func RegisterEchoService(srv *rpc.Server, x EchoService) error
- type Arith
- type ArithRequest
- type ArithResponse
- type ArithService
- type ArithServiceClient
- func (c *ArithServiceClient) Add(in *ArithRequest) (out *ArithResponse, err error)
- func (c *ArithServiceClient) Div(in *ArithRequest) (out *ArithResponse, err error)
- func (c *ArithServiceClient) Error(in *ArithRequest) (out *ArithResponse, err error)
- func (c *ArithServiceClient) Mul(in *ArithRequest) (out *ArithResponse, err error)
- type Echo
- type EchoRequest
- type EchoResponse
- type EchoService
- type EchoServiceClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcceptArithServiceClient ¶
func AcceptArithServiceClient(lis net.Listener, x ArithService)
AcceptArithServiceClient accepts connections on the listener and serves requests for each incoming connection. Accept blocks; the caller typically invokes it in a go statement.
func AcceptEchoServiceClient ¶
func AcceptEchoServiceClient(lis net.Listener, x EchoService)
AcceptEchoServiceClient accepts connections on the listener and serves requests for each incoming connection. Accept blocks; the caller typically invokes it in a go statement.
func ListenAndServeArithService ¶
func ListenAndServeArithService(network, addr string, x ArithService) error
ListenAndServeArithService listen announces on the local network address laddr and serves the given ArithService implementation.
func ListenAndServeEchoService ¶
func ListenAndServeEchoService(network, addr string, x EchoService) error
ListenAndServeEchoService listen announces on the local network address laddr and serves the given EchoService implementation.
func NewArithServiceServer ¶
func NewArithServiceServer(x ArithService) *rpc.Server
NewArithServiceServer returns a new ArithService Server.
func NewEchoServiceServer ¶
func NewEchoServiceServer(x EchoService) *rpc.Server
NewEchoServiceServer returns a new EchoService Server.
func RegisterArithService ¶
func RegisterArithService(srv *rpc.Server, x ArithService) error
RegisterArithService publish the given ArithService implementation on the server.
func RegisterEchoService ¶
func RegisterEchoService(srv *rpc.Server, x EchoService) error
RegisterEchoService publish the given EchoService implementation on the server.
Types ¶
type Arith ¶
type Arith int
func (*Arith) Add ¶
func (t *Arith) Add(args *ArithRequest, reply *ArithResponse) error
func (*Arith) Div ¶
func (t *Arith) Div(args *ArithRequest, reply *ArithResponse) error
func (*Arith) Error ¶
func (t *Arith) Error(args *ArithRequest, reply *ArithResponse) error
func (*Arith) Mul ¶
func (t *Arith) Mul(args *ArithRequest, reply *ArithResponse) error
type ArithRequest ¶
type ArithRequest struct { A int32 `protobuf:"varint,1,opt,name=a" json:"a,omitempty"` B int32 `protobuf:"varint,2,opt,name=b" json:"b,omitempty"` }
func (*ArithRequest) ProtoMessage ¶
func (*ArithRequest) ProtoMessage()
func (*ArithRequest) Reset ¶
func (m *ArithRequest) Reset()
func (*ArithRequest) String ¶
func (m *ArithRequest) String() string
type ArithResponse ¶
type ArithResponse struct {
C int32 `protobuf:"varint,1,opt,name=c" json:"c,omitempty"`
}
func (*ArithResponse) ProtoMessage ¶
func (*ArithResponse) ProtoMessage()
func (*ArithResponse) Reset ¶
func (m *ArithResponse) Reset()
func (*ArithResponse) String ¶
func (m *ArithResponse) String() string
type ArithService ¶
type ArithService interface { Add(in *ArithRequest, out *ArithResponse) error Mul(in *ArithRequest, out *ArithResponse) error Div(in *ArithRequest, out *ArithResponse) error Error(in *ArithRequest, out *ArithResponse) error }
type ArithServiceClient ¶
func DialArithService ¶
func DialArithService(network, addr string) (*ArithServiceClient, error)
DialArithService connects to an ArithService at the specified network address.
func DialArithServiceTimeout ¶
func DialArithServiceTimeout(network, addr string, timeout time.Duration) (*ArithServiceClient, error)
DialArithServiceTimeout connects to an ArithService at the specified network address.
func NewArithServiceClient ¶
func NewArithServiceClient(conn io.ReadWriteCloser) *ArithServiceClient
NewArithServiceClient returns a ArithService stub to handle requests to the set of ArithService at the other end of the connection.
func (*ArithServiceClient) Add ¶
func (c *ArithServiceClient) Add(in *ArithRequest) (out *ArithResponse, err error)
func (*ArithServiceClient) Div ¶
func (c *ArithServiceClient) Div(in *ArithRequest) (out *ArithResponse, err error)
func (*ArithServiceClient) Error ¶
func (c *ArithServiceClient) Error(in *ArithRequest) (out *ArithResponse, err error)
func (*ArithServiceClient) Mul ¶
func (c *ArithServiceClient) Mul(in *ArithRequest) (out *ArithResponse, err error)
type Echo ¶
type Echo int
func (*Echo) Echo ¶
func (t *Echo) Echo(args *EchoRequest, reply *EchoResponse) error
func (*Echo) EchoTwice ¶
func (t *Echo) EchoTwice(args *EchoRequest, reply *EchoResponse) error
type EchoRequest ¶
type EchoRequest struct {
Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"`
}
func (*EchoRequest) ProtoMessage ¶
func (*EchoRequest) ProtoMessage()
func (*EchoRequest) Reset ¶
func (m *EchoRequest) Reset()
func (*EchoRequest) String ¶
func (m *EchoRequest) String() string
type EchoResponse ¶
type EchoResponse struct {
Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"`
}
func (*EchoResponse) ProtoMessage ¶
func (*EchoResponse) ProtoMessage()
func (*EchoResponse) Reset ¶
func (m *EchoResponse) Reset()
func (*EchoResponse) String ¶
func (m *EchoResponse) String() string
type EchoService ¶
type EchoService interface { Echo(in *EchoRequest, out *EchoResponse) error EchoTwice(in *EchoRequest, out *EchoResponse) error }
type EchoServiceClient ¶
func DialEchoService ¶
func DialEchoService(network, addr string) (*EchoServiceClient, error)
DialEchoService connects to an EchoService at the specified network address.
func DialEchoServiceTimeout ¶
func DialEchoServiceTimeout(network, addr string, timeout time.Duration) (*EchoServiceClient, error)
DialEchoServiceTimeout connects to an EchoService at the specified network address.
func NewEchoServiceClient ¶
func NewEchoServiceClient(conn io.ReadWriteCloser) *EchoServiceClient
NewEchoServiceClient returns a EchoService stub to handle requests to the set of EchoService at the other end of the connection.
func (*EchoServiceClient) Echo ¶
func (c *EchoServiceClient) Echo(in *EchoRequest) (out *EchoResponse, err error)
func (*EchoServiceClient) EchoTwice ¶
func (c *EchoServiceClient) EchoTwice(in *EchoRequest) (out *EchoResponse, err error)