leafgrpc

package
v0.0.0-...-b2153de Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterLeafServer

func RegisterLeafServer(s *grpc.Server, srv LeafServer)

func RunGrpc

func RunGrpc(sf *core.Snowflake)

启动 grpc 服务

Types

type LeafClient

type LeafClient interface {
	GenId(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error)
}

LeafClient is the client API for Leaf service.

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

func NewLeafClient

func NewLeafClient(cc *grpc.ClientConn) LeafClient

type LeafGrpc

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

LeafGrpc 对象

func (*LeafGrpc) GenId

func (l *LeafGrpc) GenId(ctx context.Context, in *Request) (*Reply, error)

生成 id

type LeafServer

type LeafServer interface {
	GenId(context.Context, *Request) (*Reply, error)
}

LeafServer is the server API for Leaf service.

type Reply

type Reply struct {
	Message              string   `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Reply) Descriptor

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

func (*Reply) GetMessage

func (m *Reply) GetMessage() string

func (*Reply) ProtoMessage

func (*Reply) ProtoMessage()

func (*Reply) Reset

func (m *Reply) Reset()

func (*Reply) String

func (m *Reply) String() string

func (*Reply) XXX_DiscardUnknown

func (m *Reply) XXX_DiscardUnknown()

func (*Reply) XXX_Marshal

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

func (*Reply) XXX_Merge

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

func (*Reply) XXX_Size

func (m *Reply) XXX_Size() int

func (*Reply) XXX_Unmarshal

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

type Request

type Request struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Request) Descriptor

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

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) Reset

func (m *Request) Reset()

func (*Request) String

func (m *Request) String() string

func (*Request) XXX_DiscardUnknown

func (m *Request) XXX_DiscardUnknown()

func (*Request) XXX_Marshal

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

func (*Request) XXX_Merge

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

func (*Request) XXX_Size

func (m *Request) XXX_Size() int

func (*Request) XXX_Unmarshal

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

type UnimplementedLeafServer

type UnimplementedLeafServer struct {
}

UnimplementedLeafServer can be embedded to have forward compatible implementations.

func (*UnimplementedLeafServer) GenId

func (*UnimplementedLeafServer) GenId(ctx context.Context, req *Request) (*Reply, error)

Jump to

Keyboard shortcuts

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