one

package module
v0.0.0-...-f1b2c4c Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

README

ONE-RPC

A tiny RPC framework

Documentation

Index

Constants

View Source
const (
	ONE_RPC_VERSION = 1
	PROTOCOL        = "tcp"

	SvrAcceptTimeout = 500 * time.Millisecond

	CltDialTimeout  = 500 * time.Millisecond
	CltReadTimeout  = 500 * time.Millisecond
	CltWriteTimeout = 500 * time.Millisecond
	CltIdleTimeout  = 500 * time.Millisecond

	QueueCap = 10000

	TCPReadBuf  = 128 * 1024 * 1024
	TCPWriteBuf = 128 * 1024 * 1024

	CLT_REQ_TIMEOUT = 3 * time.Second

	NORMAL_BALANCE = "normal"

	REGISTER_CENTER_ETCD = "etcd"
)
View Source
const MAX_INT int32 = 1<<31 - 1

Variables

View Source
var (
	ConfPath string
)

Functions

func Init

func Init()

func RegisterService

func RegisterService(name string, serverConf *transport.OneSvrConf, metaInfo ...string) error

func Run

func Run()

func SetRegisterCenter

func SetRegisterCenter(regName string) error

Types

type ClientConstructor

type ClientConstructor func(name string, conf *transport.OneCltConf) transport.CltProtocol

type Context

type Context *contextImp

func GetContext

func GetContext() Context

type OneGlobalConf

type OneGlobalConf struct {
	LogPath  string                           `yaml:"logpath"`
	Server   map[string]*transport.OneSvrConf `yaml:"server"`
	Client   transport.OneCltConf             `yaml:"client"`
	Registry *registry.RegistryConf           `yaml:"registry"`
}

type ServiceController

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

func NewServiceController

func NewServiceController(name string, constructor ClientConstructor, addrs ...string) (sc *ServiceController, err error)

func (*ServiceController) Send

func (sc *ServiceController) Send(ctx context.Context, servant string, funcName string, pkg []byte) (rspPkg []byte, err error)

Directories

Path Synopsis
example
tools
protoc-gen-go
protoc-gen-go is a plugin for the Google protocol buffer compiler to generate Go code.
protoc-gen-go is a plugin for the Google protocol buffer compiler to generate Go code.
protoc-gen-go/grpc
Package grpc outputs gRPC service descriptions in Go code.
Package grpc outputs gRPC service descriptions in Go code.
util

Jump to

Keyboard shortcuts

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