Documentation ¶
Index ¶
- Variables
- func ReadReplaySessionFile(cprPath string) (*replaypb.ReplaySession, error)
- type AlterChannelIdBeforeSendHandlerFunc
- type BeforeSendMessageHandlerFunc
- type CaseConfig
- type ConnectionGroup
- type ConnectionGroupConfig
- type Duration
- type MessageHandlerFunc
- type NeedWaitMessageCallbackHandlerFunc
- type ReplayClient
- func (rc *ReplayClient) AddMessageHandler(msgType channeldpb.MessageType, handlers ...MessageHandlerFunc)
- func (rc *ReplayClient) LoadCaseConfig(path string) error
- func (rc *ReplayClient) Run()
- func (rc *ReplayClient) SetAlterChannelIdBeforeSendHandler(handler AlterChannelIdBeforeSendHandlerFunc)
- func (rc *ReplayClient) SetBeforeSendMessageEntry(msgType channeldpb.MessageType, msgTemp proto.Message, ...)
- func (rc *ReplayClient) SetMessageEntry(msgType uint32, msgTemp proto.Message, handlers ...MessageHandlerFunc)
- func (rc *ReplayClient) SetNeedWaitMessageCallback(handler NeedWaitMessageCallbackHandlerFunc)
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConnGroupConfig = ConnectionGroupConfig{ ConnectionNumber: 1, ActionIntervalMultiplier: 1, WaitAuthSuccess: true, AuthOnlyOnce: true, }
Functions ¶
func ReadReplaySessionFile ¶
func ReadReplaySessionFile(cprPath string) (*replaypb.ReplaySession, error)
Types ¶
type AlterChannelIdBeforeSendHandlerFunc ¶
type AlterChannelIdBeforeSendHandlerFunc func(channelId uint32, msgType channeldpb.MessageType, msgPack *channeldpb.MessagePack, c *client.ChanneldClient) (chId uint32, needToSend bool)
type BeforeSendMessageHandlerFunc ¶
type BeforeSendMessageHandlerFunc func(msg proto.Message, msgPack *channeldpb.MessagePack, c *client.ChanneldClient) (needToSend bool)
type CaseConfig ¶
type CaseConfig struct { ChanneldAddr string `json:"channeldAddr"` ConnectionGroups []ConnectionGroupConfig `json:"connectionGroups"` }
type ConnectionGroup ¶
type ConnectionGroup struct {
// contains filtered or unexported fields
}
type ConnectionGroupConfig ¶
type ConnectionGroupConfig struct { CprFilePath string `json:"cprFilePath"` ConnectionNumber int `json:"connectionNumber"` // Number of connections ConnectInterval Duration `json:"connectInterval"` // start connections interval RunningTime Duration `json:"runningTime"` // replay session running time SleepEndOfSession Duration `json:"sleepEndOfSession"` // sleep each end of session MaxTickInterval Duration `json:"maxTickInterval"` // channeld connection max tick time ActionIntervalMultiplier float64 `json:"actionIntervalMultiplier"` // used to adjust the packet offsettime (ActionIntervalMultiplier * ReplayPacket.Offsettime) WaitAuthSuccess bool `json:"waitAuthSuccess"` // if true, replay loop will wait for auth success AuthOnlyOnce bool `json:"authOnlyOnce"` // if true, only send auth message once in the entire replay }
type Duration ¶
func (*Duration) UnmarshalJSON ¶
type MessageHandlerFunc ¶
type MessageHandlerFunc func(c *client.ChanneldClient, channelId uint32, m proto.Message)
type NeedWaitMessageCallbackHandlerFunc ¶
type NeedWaitMessageCallbackHandlerFunc func(msgType channeldpb.MessageType, msgPack *channeldpb.MessagePack, c *client.ChanneldClient) bool
type ReplayClient ¶
type ReplayClient struct { CaseConfig CaseConfig ConnectionGroups []ConnectionGroup // contains filtered or unexported fields }
func CreateReplayClientByConfigFile ¶
func CreateReplayClientByConfigFile(configPath string) (*ReplayClient, error)
func (*ReplayClient) AddMessageHandler ¶
func (rc *ReplayClient) AddMessageHandler(msgType channeldpb.MessageType, handlers ...MessageHandlerFunc)
func (*ReplayClient) LoadCaseConfig ¶
func (rc *ReplayClient) LoadCaseConfig(path string) error
func (*ReplayClient) Run ¶
func (rc *ReplayClient) Run()
func (*ReplayClient) SetAlterChannelIdBeforeSendHandler ¶
func (rc *ReplayClient) SetAlterChannelIdBeforeSendHandler(handler AlterChannelIdBeforeSendHandlerFunc)
func (*ReplayClient) SetBeforeSendMessageEntry ¶
func (rc *ReplayClient) SetBeforeSendMessageEntry(msgType channeldpb.MessageType, msgTemp proto.Message, handler BeforeSendMessageHandlerFunc)
func (*ReplayClient) SetMessageEntry ¶
func (rc *ReplayClient) SetMessageEntry(msgType uint32, msgTemp proto.Message, handlers ...MessageHandlerFunc)
func (*ReplayClient) SetNeedWaitMessageCallback ¶
func (rc *ReplayClient) SetNeedWaitMessageCallback(handler NeedWaitMessageCallbackHandlerFunc)
Click to show internal directories.
Click to hide internal directories.