Documentation ¶
Index ¶
- Constants
- Variables
- func GetGettyClientHandlerInstance() *gettyClientHandler
- func InitRpcClient(gettyConfig *Config, seataConfig *SeataConfig)
- type Config
- type GettyRemoting
- func (g *GettyRemoting) GetMergedMessage(msgID int32) *message.MergedWarpMessage
- func (g *GettyRemoting) GetMessageFuture(msgID int32) *message.MessageFuture
- func (g *GettyRemoting) NotifyRpcMessageResponse(rpcMessage message.RpcMessage)
- func (g *GettyRemoting) RemoveMergedMessageFuture(msgID int32)
- func (g *GettyRemoting) RemoveMessageFuture(msgID int32)
- func (g *GettyRemoting) SendASync(msg message.RpcMessage, s getty.Session, callback callbackMethod) error
- func (g *GettyRemoting) SendSync(msg message.RpcMessage, s getty.Session, callback callbackMethod) (interface{}, error)
- type GettyRemotingClient
- type RpcClient
- type RpcPackageHandler
- type SeataConfig
- type SeataV1PackageHeader
- type SessionConfig
- type SessionManager
- type ShutdownConfig
- type TransportConfig
Constants ¶
View Source
const (
RpcRequestTimeout = 20 * time.Second
)
View Source
const (
Seatav1HeaderLength = 16
)
*
- <pre>
- 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
- +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
- | magic |Proto | Full length | Head | Msg |Seria|Compr| RequestID |
- | code |clVer | (head+body) | Length |Type |lizer|ess | |
- +-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+
- | |
- | Head Map [Optional] |
- +-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+
- | |
- | body |
- | |
- | ... ... |
- +-----------------------------------------------------------------------------------------------+
- </pre>
- <p>
- <li>Full Length: include all data </li>
- <li>Head Length: include head data from magic code to head map. </li>
- <li>Body Length: Full Length - Head Length</li>
- </p>
- https://github.com/seata/seata/issues/893
Variables ¶
Functions ¶
func GetGettyClientHandlerInstance ¶
func GetGettyClientHandlerInstance() *gettyClientHandler
func InitRpcClient ¶
func InitRpcClient(gettyConfig *Config, seataConfig *SeataConfig)
Types ¶
type Config ¶
type Config struct { ReconnectInterval int `yaml:"reconnect-interval" json:"reconnect-interval" koanf:"reconnect-interval"` ConnectionNum int `yaml:"connection-num" json:"connection-num" koanf:"connection-num"` SessionConfig SessionConfig `yaml:"session" json:"session" koanf:"session"` }
type GettyRemoting ¶
type GettyRemoting struct {
// contains filtered or unexported fields
}
func GetGettyRemotingInstance ¶
func GetGettyRemotingInstance() *GettyRemoting
func (*GettyRemoting) GetMergedMessage ¶
func (g *GettyRemoting) GetMergedMessage(msgID int32) *message.MergedWarpMessage
func (*GettyRemoting) GetMessageFuture ¶
func (g *GettyRemoting) GetMessageFuture(msgID int32) *message.MessageFuture
func (*GettyRemoting) NotifyRpcMessageResponse ¶
func (g *GettyRemoting) NotifyRpcMessageResponse(rpcMessage message.RpcMessage)
func (*GettyRemoting) RemoveMergedMessageFuture ¶
func (g *GettyRemoting) RemoveMergedMessageFuture(msgID int32)
func (*GettyRemoting) RemoveMessageFuture ¶
func (g *GettyRemoting) RemoveMessageFuture(msgID int32)
func (*GettyRemoting) SendASync ¶
func (g *GettyRemoting) SendASync(msg message.RpcMessage, s getty.Session, callback callbackMethod) error
func (*GettyRemoting) SendSync ¶
func (g *GettyRemoting) SendSync(msg message.RpcMessage, s getty.Session, callback callbackMethod) (interface{}, error)
type GettyRemotingClient ¶
type GettyRemotingClient struct {
// contains filtered or unexported fields
}
func GetGettyRemotingClient ¶
func GetGettyRemotingClient() *GettyRemotingClient
func (*GettyRemotingClient) SendAsyncRequest ¶
func (client *GettyRemotingClient) SendAsyncRequest(msg interface{}) error
func (*GettyRemotingClient) SendAsyncResponse ¶
func (client *GettyRemotingClient) SendAsyncResponse(msgID int32, msg interface{}) error
func (*GettyRemotingClient) SendSyncRequest ¶
func (client *GettyRemotingClient) SendSyncRequest(msg interface{}) (interface{}, error)
type SeataConfig ¶
type SeataConfig struct { ApplicationID string TxServiceGroup string ServiceVgroupMapping flagext.StringMap ServiceGrouplist flagext.StringMap }
todo refactor config
type SeataV1PackageHeader ¶
type SessionConfig ¶
type SessionConfig struct { CompressEncoding bool `yaml:"compress-encoding" json:"compress-encoding" koanf:"compress-encoding"` TCPNoDelay bool `yaml:"tcp-no-delay" json:"tcp-no-delay" koanf:"tcp-no-delay"` TCPKeepAlive bool `yaml:"tcp-keep-alive" json:"tcp-keep-alive" koanf:"tcp-keep-alive"` KeepAlivePeriod time.Duration `yaml:"keep-alive-period" json:"keep-alive-period" koanf:"keep-alive-period"` TCPRBufSize int `yaml:"tcp-r-buf-size" json:"tcp-r-buf-size" koanf:"tcp-r-buf-size"` TCPWBufSize int `yaml:"tcp-w-buf-size" json:"tcp-w-buf-size" koanf:"tcp-w-buf-size"` TCPReadTimeout time.Duration `yaml:"tcp-read-timeout" json:"tcp-read-timeout" koanf:"tcp-read-timeout"` TCPWriteTimeout time.Duration `yaml:"tcp-write-timeout" json:"tcp-write-timeout" koanf:"tcp-write-timeout"` WaitTimeout time.Duration `yaml:"wait-timeout" json:"wait-timeout" koanf:"wait-timeout"` MaxMsgLen int `yaml:"max-msg-len" json:"max-msg-len" koanf:"max-msg-len"` SessionName string `yaml:"session-name" json:"session-name" koanf:"session-name"` CronPeriod time.Duration `yaml:"cron-period" json:"cron-period" koanf:"cron-period"` }
func (*SessionConfig) RegisterFlagsWithPrefix ¶
func (cfg *SessionConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)
RegisterFlagsWithPrefix for Config.
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
type ShutdownConfig ¶
func (*ShutdownConfig) RegisterFlagsWithPrefix ¶
func (cfg *ShutdownConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)
type TransportConfig ¶
type TransportConfig struct { ShutdownConfig ShutdownConfig `yaml:"shutdown" json:"shutdown" koanf:"shutdown"` Type string `yaml:"type" json:"type" koanf:"type"` Server string `yaml:"server" json:"server" koanf:"server"` Heartbeat bool `yaml:"heartbeat" json:"heartbeat" koanf:"heartbeat"` Serialization string `yaml:"serialization" json:"serialization" koanf:"serialization"` Compressor string `yaml:"compressor" json:"compressor" koanf:"compressor"` EnableTmClientBatchSendRequest bool `` /* 129-byte string literal not displayed */ EnableRmClientBatchSendRequest bool `` /* 129-byte string literal not displayed */ RPCRmRequestTimeout time.Duration `yaml:"rpc-rm-request-timeout" json:"rpc-rm-request-timeout" koanf:"rpc-rm-request-timeout"` RPCTmRequestTimeout time.Duration `yaml:"rpc-tm-request-timeout" json:"rpc-tm-request-timeout" koanf:"rpc-tm-request-timeout"` }
func (*TransportConfig) RegisterFlagsWithPrefix ¶
func (cfg *TransportConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)
Click to show internal directories.
Click to hide internal directories.