helloworld

package
v0.0.0-...-828e206 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewXClientForGreeter

func NewXClientForGreeter(addr string) client.XClient

NewXClientForGreeter creates a XClient. You can configure this client with more options such as etcd registry, serialize type, select algorithm and fail mode.

func ServeForGreeter

func ServeForGreeter(addr string) error

ServeForGreeter starts a server only registers one service. You can register more services and only start one server. It blocks until the application exits.

Types

type GreeterClient

type GreeterClient struct {
	// contains filtered or unexported fields
}

================== client stub=================== Greeter is a client wrapped XClient.

func NewGreeterClient

func NewGreeterClient(xclient client.XClient) *GreeterClient

NewGreeterClient wraps a XClient as GreeterClient. You can pass a shared XClient object created by NewXClientForGreeter.

func (*GreeterClient) SayHello

func (c *GreeterClient) SayHello(ctx context.Context, args *HelloRequest) (reply *HelloReply, err error)

SayHello is client rpc method as defined

type GreeterImpl

type GreeterImpl struct{}

================== server skeleton===================

func (*GreeterImpl) SayHello

func (s *GreeterImpl) SayHello(ctx context.Context, args *HelloRequest, reply *HelloReply) (err error)

SayHello is server rpc method as defined

type HelloReply

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

The response message containing the greetings

func (*HelloReply) Descriptor

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

func (*HelloReply) GetC

func (m *HelloReply) GetC() int32

func (*HelloReply) ProtoMessage

func (*HelloReply) ProtoMessage()

func (*HelloReply) Reset

func (m *HelloReply) Reset()

func (*HelloReply) String

func (m *HelloReply) String() string

func (*HelloReply) XXX_DiscardUnknown

func (m *HelloReply) XXX_DiscardUnknown()

func (*HelloReply) XXX_Marshal

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

func (*HelloReply) XXX_Merge

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

func (*HelloReply) XXX_Size

func (m *HelloReply) XXX_Size() int

func (*HelloReply) XXX_Unmarshal

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

type HelloRequest

type HelloRequest struct {
	A                    int32    `protobuf:"varint,1,opt,name=a,proto3" json:"a,omitempty"`
	B                    int32    `protobuf:"varint,2,opt,name=b,proto3" json:"b,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The request message containing the user's name.

func (*HelloRequest) Descriptor

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

func (*HelloRequest) GetA

func (m *HelloRequest) GetA() int32

func (*HelloRequest) GetB

func (m *HelloRequest) GetB() int32

func (*HelloRequest) ProtoMessage

func (*HelloRequest) ProtoMessage()

func (*HelloRequest) Reset

func (m *HelloRequest) Reset()

func (*HelloRequest) String

func (m *HelloRequest) String() string

func (*HelloRequest) XXX_DiscardUnknown

func (m *HelloRequest) XXX_DiscardUnknown()

func (*HelloRequest) XXX_Marshal

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

func (*HelloRequest) XXX_Merge

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

func (*HelloRequest) XXX_Size

func (m *HelloRequest) XXX_Size() int

func (*HelloRequest) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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