rpc

package
v0.0.0-...-5152dd2 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package rpc is a generated protocol buffer package.

It is generated from these files:

msg.proto

It has these top-level messages:

Request
Response

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthMsg = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMsg   = fmt.Errorf("proto: integer overflow")
)
View Source
var ErrTimeout = errors.New("timeout")

ErrTimeout represents the timeout error variable

Functions

This section is empty.

Types

type CallHandler

type CallHandler func(funcID int32, args []byte) ([]byte, error)

CallHandler handles all RPC calls

type Client

type Client interface {
	Close()
	RemoteCall(p Request) ([]byte, error)
}

Client is a client object

func Connect

func Connect(cfg ClientConfig) (Client, error)

Connect connects to the RabbitMQ exchange server

type ClientConfig

type ClientConfig struct {
	URL         string
	ServerQueue string
	Timeout     time.Duration
}

ClientConfig holds the configuration for the client

type Request

type Request struct {
	FuncID int32  `protobuf:"varint,1,opt,name=FuncID,proto3" json:"FuncID,omitempty"`
	Body   []byte `protobuf:"bytes,2,opt,name=Body,proto3" json:"Body,omitempty"`
}

func (*Request) Descriptor

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

func (*Request) GetBody

func (m *Request) GetBody() []byte

func (*Request) GetFuncID

func (m *Request) GetFuncID() int32

func (*Request) Marshal

func (m *Request) Marshal() (dAtA []byte, err error)

func (*Request) MarshalTo

func (m *Request) MarshalTo(dAtA []byte) (int, error)

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) Reset

func (m *Request) Reset()

func (*Request) Size

func (m *Request) Size() (n int)

func (*Request) String

func (m *Request) String() string

func (*Request) Unmarshal

func (m *Request) Unmarshal(dAtA []byte) error

type Response

type Response struct {
	IsSuccess bool   `protobuf:"varint,1,opt,name=IsSuccess,proto3" json:"IsSuccess,omitempty"`
	Body      []byte `protobuf:"bytes,2,opt,name=Body,proto3" json:"Body,omitempty"`
	ErrText   string `protobuf:"bytes,3,opt,name=ErrText,proto3" json:"ErrText,omitempty"`
}

func (*Response) Descriptor

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

func (*Response) GetBody

func (m *Response) GetBody() []byte

func (*Response) GetErrText

func (m *Response) GetErrText() string

func (*Response) GetIsSuccess

func (m *Response) GetIsSuccess() bool

func (*Response) Marshal

func (m *Response) Marshal() (dAtA []byte, err error)

func (*Response) MarshalTo

func (m *Response) MarshalTo(dAtA []byte) (int, error)

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) Reset

func (m *Response) Reset()

func (*Response) Size

func (m *Response) Size() (n int)

func (*Response) String

func (m *Response) String() string

func (*Response) Unmarshal

func (m *Response) Unmarshal(dAtA []byte) error

type Server

type Server interface {
	Close()
	Serve(handler CallHandler)
}

Server is the main server object

func CreateServer

func CreateServer(url string, queueName string) (Server, error)

CreateServer creates a worker/server

Directories

Path Synopsis
Package test is a generated protocol buffer package.
Package test is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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