tcpgateway

package
v0.0.0-...-ff803ae Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool struct {
	Value                *bool    `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Bool) Descriptor

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

func (*Bool) GetValue

func (m *Bool) GetValue() bool

func (*Bool) ProtoMessage

func (*Bool) ProtoMessage()

func (*Bool) Reset

func (m *Bool) Reset()

func (*Bool) String

func (m *Bool) String() string

func (*Bool) XXX_DiscardUnknown

func (m *Bool) XXX_DiscardUnknown()

func (*Bool) XXX_Marshal

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

func (*Bool) XXX_Merge

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

func (*Bool) XXX_Size

func (m *Bool) XXX_Size() int

func (*Bool) XXX_Unmarshal

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

type Bytes

type Bytes struct {
	Value                []byte   `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Bytes) Descriptor

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

func (*Bytes) GetValue

func (m *Bytes) GetValue() []byte

func (*Bytes) ProtoMessage

func (*Bytes) ProtoMessage()

func (*Bytes) Reset

func (m *Bytes) Reset()

func (*Bytes) String

func (m *Bytes) String() string

func (*Bytes) XXX_DiscardUnknown

func (m *Bytes) XXX_DiscardUnknown()

func (*Bytes) XXX_Marshal

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

func (*Bytes) XXX_Merge

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

func (*Bytes) XXX_Size

func (m *Bytes) XXX_Size() int

func (*Bytes) XXX_Unmarshal

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

type ClientList

type ClientList struct {
	ClientList           []uint64 `protobuf:"varint,1,rep,name=clientList" json:"clientList,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ClientList) Descriptor

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

func (*ClientList) GetClientList

func (m *ClientList) GetClientList() []uint64

func (*ClientList) ProtoMessage

func (*ClientList) ProtoMessage()

func (*ClientList) Reset

func (m *ClientList) Reset()

func (*ClientList) String

func (m *ClientList) String() string

func (*ClientList) XXX_DiscardUnknown

func (m *ClientList) XXX_DiscardUnknown()

func (*ClientList) XXX_Marshal

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

func (*ClientList) XXX_Merge

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

func (*ClientList) XXX_Size

func (m *ClientList) XXX_Size() int

func (*ClientList) XXX_Unmarshal

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

type EventRouterInfo

type EventRouterInfo struct {
	Rpc             string
	ServiceName     string
	LoadBalanceType string
}

type GateProxyModule

type GateProxyModule struct {
	service.Module
	// contains filtered or unexported fields
}

func NewGateProxyModule

func NewGateProxyModule() *GateProxyModule

func (*GateProxyModule) Send

func (gate *GateProxyModule) Send(clientId interface{}, msgType uint16, msg proto.Message) error

func (*GateProxyModule) SetDefaultGateRpcMethodName

func (gate *GateProxyModule) SetDefaultGateRpcMethodName(rpcMethodName string)

type ILoadBalance

type ILoadBalance interface {
	SelectNode(serviceName string, clientId uint64, eventType string, msgType uint16, msg []byte) int //选择一个结点,通过服务名称
}

type IRouter

type IRouter interface {
	RouterMessage(clientId uint64, msgType uint16, msg []byte) //消息转发
	RouterEvent(clientId uint64, eventType string) bool        //消息转发
	Load()                                                     //加载路由规则

	OnDisconnected(clientId uint64)
	OnConnected(clientId uint64)
}

func NewRouter

func NewRouter(loadBalance ILoadBalance, rpcHandler rpc.IRpcHandler, cfg interface{}) IRouter

type Int

type Int struct {
	Value                *int32   `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Int) Descriptor

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

func (*Int) GetValue

func (m *Int) GetValue() int32

func (*Int) ProtoMessage

func (*Int) ProtoMessage()

func (*Int) Reset

func (m *Int) Reset()

func (*Int) String

func (m *Int) String() string

func (*Int) XXX_DiscardUnknown

func (m *Int) XXX_DiscardUnknown()

func (*Int) XXX_Marshal

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

func (*Int) XXX_Merge

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

func (*Int) XXX_Size

func (m *Int) XXX_Size() int

func (*Int) XXX_Unmarshal

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

type Int64

type Int64 struct {
	Value                *int64   `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Int64) Descriptor

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

func (*Int64) GetValue

func (m *Int64) GetValue() int64

func (*Int64) ProtoMessage

func (*Int64) ProtoMessage()

func (*Int64) Reset

func (m *Int64) Reset()

func (*Int64) String

func (m *Int64) String() string

func (*Int64) XXX_DiscardUnknown

func (m *Int64) XXX_DiscardUnknown()

func (*Int64) XXX_Marshal

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

func (*Int64) XXX_Merge

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

func (*Int64) XXX_Size

func (m *Int64) XXX_Size() int

func (*Int64) XXX_Unmarshal

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

type LoadBalance

type LoadBalance struct {
}

func (*LoadBalance) SelectNode

func (balance *LoadBalance) SelectNode(serviceName string, clientId uint64, eventType string, msgType uint16, msg []byte) int

type Msg

type Msg struct {
	Head                         *MsgHead `protobuf:"bytes,1,opt,name=head" json:"head,omitempty"`
	Ret                          *int32   `protobuf:"varint,2,opt,name=ret" json:"ret,omitempty"`
	XXX_NoUnkeyedLiteral         struct{} `json:"-"`
	proto.XXX_InternalExtensions `json:"-"`
	XXX_unrecognized             []byte `json:"-"`
	XXX_sizecache                int32  `json:"-"`
}

func (*Msg) Descriptor

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

func (*Msg) ExtensionRangeArray

func (*Msg) ExtensionRangeArray() []proto.ExtensionRange

func (*Msg) GetHead

func (m *Msg) GetHead() *MsgHead

func (*Msg) GetRet

func (m *Msg) GetRet() int32

func (*Msg) ProtoMessage

func (*Msg) ProtoMessage()

func (*Msg) Reset

func (m *Msg) Reset()

func (*Msg) String

func (m *Msg) String() string

func (*Msg) XXX_DiscardUnknown

func (m *Msg) XXX_DiscardUnknown()

func (*Msg) XXX_Marshal

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

func (*Msg) XXX_Merge

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

func (*Msg) XXX_Size

func (m *Msg) XXX_Size() int

func (*Msg) XXX_Unmarshal

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

type MsgHead

type MsgHead struct {
	Cid                  *int32   `protobuf:"varint,1,opt,name=cid" json:"cid,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*MsgHead) Descriptor

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

func (*MsgHead) GetCid

func (m *MsgHead) GetCid() int32

func (*MsgHead) ProtoMessage

func (*MsgHead) ProtoMessage()

func (*MsgHead) Reset

func (m *MsgHead) Reset()

func (*MsgHead) String

func (m *MsgHead) String() string

func (*MsgHead) XXX_DiscardUnknown

func (m *MsgHead) XXX_DiscardUnknown()

func (*MsgHead) XXX_Marshal

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

func (*MsgHead) XXX_Merge

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

func (*MsgHead) XXX_Size

func (m *MsgHead) XXX_Size() int

func (*MsgHead) XXX_Unmarshal

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

type MsgRouterInfo

type MsgRouterInfo struct {
	Rpc             string
	ServiceName     string
	LoadBalanceType string
}

type MsgTypeRouterInfo

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

type PlaceHolders

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

func (*PlaceHolders) Descriptor

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

func (*PlaceHolders) ProtoMessage

func (*PlaceHolders) ProtoMessage()

func (*PlaceHolders) Reset

func (m *PlaceHolders) Reset()

func (*PlaceHolders) String

func (m *PlaceHolders) String() string

func (*PlaceHolders) XXX_DiscardUnknown

func (m *PlaceHolders) XXX_DiscardUnknown()

func (*PlaceHolders) XXX_Marshal

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

func (*PlaceHolders) XXX_Merge

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

func (*PlaceHolders) XXX_Size

func (m *PlaceHolders) XXX_Size() int

func (*PlaceHolders) XXX_Unmarshal

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

type RawInputArgs

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

func (RawInputArgs) DoGc

func (args RawInputArgs) DoGc()

func (RawInputArgs) GetAdditionParam

func (args RawInputArgs) GetAdditionParam() interface{}

func (RawInputArgs) GetRawData

func (args RawInputArgs) GetRawData() []byte

type ReplyMessage

type ReplyMessage struct {
	ClientList           []uint64 `protobuf:"varint,1,rep,name=clientList" json:"clientList,omitempty"`
	MsgType              *uint32  `protobuf:"varint,2,opt,name=msgType" json:"msgType,omitempty"`
	Msg                  []byte   `protobuf:"bytes,3,opt,name=msg" json:"msg,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ReplyMessage) Descriptor

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

func (*ReplyMessage) GetClientList

func (m *ReplyMessage) GetClientList() []uint64

func (*ReplyMessage) GetMsg

func (m *ReplyMessage) GetMsg() []byte

func (*ReplyMessage) GetMsgType

func (m *ReplyMessage) GetMsgType() uint32

func (*ReplyMessage) ProtoMessage

func (*ReplyMessage) ProtoMessage()

func (*ReplyMessage) Reset

func (m *ReplyMessage) Reset()

func (*ReplyMessage) String

func (m *ReplyMessage) String() string

func (*ReplyMessage) XXX_DiscardUnknown

func (m *ReplyMessage) XXX_DiscardUnknown()

func (*ReplyMessage) XXX_Marshal

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

func (*ReplyMessage) XXX_Merge

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

func (*ReplyMessage) XXX_Size

func (m *ReplyMessage) XXX_Size() int

func (*ReplyMessage) XXX_Unmarshal

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

type Router

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

func (*Router) GetEventRouterService

func (r *Router) GetEventRouterService(eventType string) *EventRouterInfo

func (*Router) GetMsgRouterService

func (r *Router) GetMsgRouterService(msgType uint16) *MsgRouterInfo

func (*Router) GetRouterId

func (r *Router) GetRouterId(clientId uint64, serviceName *string) int

func (*Router) Load

func (r *Router) Load()

func (*Router) OnConnected

func (r *Router) OnConnected(clientId uint64)

func (*Router) OnDisconnected

func (r *Router) OnDisconnected(clientId uint64)

func (*Router) RouterEvent

func (r *Router) RouterEvent(clientId uint64, eventType string) bool

func (*Router) RouterMessage

func (r *Router) RouterMessage(cliId uint64, msgType uint16, msg []byte)

func (*Router) SetRouterId

func (r *Router) SetRouterId(clientId uint64, serviceName string, routerId int)

type RouterCfg

type RouterCfg struct {
}

type String

type String struct {
	Value                *string  `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*String) Descriptor

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

func (*String) GetValue

func (m *String) GetValue() string

func (*String) ProtoMessage

func (*String) ProtoMessage()

func (*String) Reset

func (m *String) Reset()

func (*String) String

func (m *String) String() string

func (*String) XXX_DiscardUnknown

func (m *String) XXX_DiscardUnknown()

func (*String) XXX_Marshal

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

func (*String) XXX_Merge

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

func (*String) XXX_Size

func (m *String) XXX_Size() int

func (*String) XXX_Unmarshal

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

type TcpGateService

type TcpGateService struct {
	service.Service
	// contains filtered or unexported fields
}

func (*TcpGateService) OnInit

func (gateService *TcpGateService) OnInit() error

func (*TcpGateService) OnLoad

func (gateService *TcpGateService) OnLoad()

func (*TcpGateService) RPC_Dispatch

func (gateService *TcpGateService) RPC_Dispatch(replyMsg *ReplyMessage) error

func (*TcpGateService) SetEventChannel

func (gateService *TcpGateService) SetEventChannel(channelNum int)

func (*TcpGateService) SetLoadBalance

func (gateService *TcpGateService) SetLoadBalance(loadBalance ILoadBalance)

func (*TcpGateService) SetRawProcessor

func (gateService *TcpGateService) SetRawProcessor(processor processor.IRawProcessor)

func (*TcpGateService) SetRouter

func (gateService *TcpGateService) SetRouter(router IRouter)

func (*TcpGateService) SetTcpGateService

func (gateService *TcpGateService) SetTcpGateService(tcpService *tcpservice.TcpService)

Jump to

Keyboard shortcuts

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