transport

package
v0.0.0-...-02b4230 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

*

*
* @author liangjf
* @create on 2020/5/20
* @version 1.0

*

*
* @author liangjf
* @create on 2020/5/20
* @version 1.0

*

*
* @author liangjf
* @create on 2020/5/20
* @version 1.0

*

*
* @author liangjf
* @create on 2020/5/21
* @version 1.0

*

*
* @author liangjf
* @create on 2020/5/20
* @version 1.0

*

*
* @author liangjf
* @create on 2020/5/20
* @version 1.0

Index

Constants

This section is empty.

Variables

View Source
var (
	HeartbeatReply             = []byte("ok")
	ErrConnReqPayloadInfoReply = []byte("conn req payload info err")
)

Functions

This section is empty.

Types

type FactoryRPCTransport

type FactoryRPCTransport struct{}

type FactoryTcpTransport

type FactoryTcpTransport struct{}

type FactoryWSTransport

type FactoryWSTransport struct{}

type IFactory

type IFactory interface {
	CreateTransport() ITransport
}

type ITransport

type ITransport interface {
	Init(...Option)
	ListenServer(context.Context) error
}

func NewFactoryRPCTransport

func NewFactoryRPCTransport(opts ...Option) ITransport

func NewFactoryTcpTransport

func NewFactoryTcpTransport(opts ...Option) ITransport

func NewFactoryWSTransport

func NewFactoryWSTransport(opts ...Option) ITransport

func NewRpcTransport

func NewRpcTransport(opts ...Option) ITransport

func NewTcpTransport

func NewTcpTransport(opts ...Option) ITransport

func NewWSTransport

func NewWSTransport(opts ...Option) ITransport

type Option

type Option func(*Options)

func Addr

func Addr(address string) Option

func DiscoveryAddr

func DiscoveryAddr(DiscoveryAddr []string) Option

func KeepAlivePeriod

func KeepAlivePeriod(keepAlivePeriod time.Duration) Option

func Network

func Network(network string) Option

func RpcPort

func RpcPort(rpcPort int) Option

func SrvName

func SrvName(SrvName string) Option

func Timeout

func Timeout(timeout time.Duration) Option

type Options

type Options struct {
	Address         string
	Network         string
	KeepAlivePeriod time.Duration
	Timeout         time.Duration
	RpcPort         int
	DiscoveryAddr   []string
	SrvName         string
}

Jump to

Keyboard shortcuts

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