replaying

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2019 License: Apache-2.0, Apache-2.0 Imports: 13 Imported by: 0

README

pass session from inbound => sut => outbound

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MatchThreshold float64

Functions

func AssignLocalAddr

func AssignLocalAddr() (*net.TCPAddr, error)

func InitMatcher

func InitMatcher()

func StoreTmp

func StoreTmp(inboundAddr net.TCPAddr, session *ReplayingSession)

Types

type AppendFile

type AppendFile struct {
	FileName string
	Content  []byte
	// contains filtered or unexported fields
}

func (*AppendFile) GetActionId

func (action *AppendFile) GetActionId() string

func (*AppendFile) GetActionType

func (action *AppendFile) GetActionType() string

func (*AppendFile) GetOccurredAt

func (action *AppendFile) GetOccurredAt() int64

func (*AppendFile) MarshalJSON

func (appendFile *AppendFile) MarshalJSON() ([]byte, error)

type CallFromInbound

type CallFromInbound struct {
	OriginalRequestTime int64
	OriginalRequest     []byte
	// contains filtered or unexported fields
}

func (*CallFromInbound) GetActionId

func (action *CallFromInbound) GetActionId() string

func (*CallFromInbound) GetActionType

func (action *CallFromInbound) GetActionType() string

func (*CallFromInbound) GetOccurredAt

func (action *CallFromInbound) GetOccurredAt() int64

func (*CallFromInbound) MarshalJSON

func (callFromInbound *CallFromInbound) MarshalJSON() ([]byte, error)

type CallFunction

type CallFunction struct {
	CallIntoFile string
	CallIntoLine int
	FuncName     string
	Args         []interface{}
	// contains filtered or unexported fields
}

func (*CallFunction) GetActionId

func (action *CallFunction) GetActionId() string

func (*CallFunction) GetActionType

func (action *CallFunction) GetActionType() string

func (*CallFunction) GetOccurredAt

func (action *CallFunction) GetOccurredAt() int64

type CallOutbound

type CallOutbound struct {
	MatchedRequest     []byte
	MatchedResponse    []byte
	MatchedActionIndex int
	MatchedMark        float64
	Request            []byte
	Peer               net.TCPAddr
	// contains filtered or unexported fields
}

func NewCallOutbound

func NewCallOutbound(peer net.TCPAddr, request []byte) *CallOutbound

func (*CallOutbound) GetActionId

func (action *CallOutbound) GetActionId() string

func (*CallOutbound) GetActionType

func (action *CallOutbound) GetActionType() string

func (*CallOutbound) GetOccurredAt

func (action *CallOutbound) GetOccurredAt() int64

func (*CallOutbound) MarshalJSON

func (callOutbound *CallOutbound) MarshalJSON() ([]byte, error)

type ChunkMatcher

type ChunkMatcher struct {
}

func (ChunkMatcher) DoMatch

func (matchOther ChunkMatcher) DoMatch(ctx context.Context, connLastMatchedIndex int, request []byte, replayingSession *ReplayingSession) (int, float64, *recording.CallOutbound)

type MatcherIf

type MatcherIf interface {
	DoMatch(ctx context.Context, connLastMatchedIndex int, request []byte, replayingSession *ReplayingSession) (int, float64, *recording.CallOutbound)
}
var Matcher MatcherIf

type ReplayedAction

type ReplayedAction interface {
	GetActionId() string
	GetActionType() string
	GetOccurredAt() int64
}

type ReplayedSession

type ReplayedSession struct {
	SessionId       string
	CallFromInbound *CallFromInbound
	ReturnInbound   *ReturnInbound
	Actions         []ReplayedAction
}

type ReplayingSession

type ReplayingSession struct {
	SessionId       string
	CallFromInbound *recording.CallFromInbound
	ReturnInbound   *recording.ReturnInbound
	CallOutbounds   []*recording.CallOutbound
	RedirectDirs    map[string]string
	MockFiles       map[string][]byte
	TracePaths      []string
	// contains filtered or unexported fields
}

func NewReplayingSession

func NewReplayingSession() *ReplayingSession

func RetrieveTmp

func RetrieveTmp(inboundAddr net.TCPAddr) *ReplayingSession

func (*ReplayingSession) AppendFile

func (replayingSession *ReplayingSession) AppendFile(ctx context.Context, content []byte, fileName string)

func (*ReplayingSession) CallFunction

func (replayingSession *ReplayingSession) CallFunction(ctx context.Context, content []byte)

func (*ReplayingSession) CallOutbound

func (replayingSession *ReplayingSession) CallOutbound(ctx context.Context, callOutbound *CallOutbound)

func (*ReplayingSession) Finish

func (replayingSession *ReplayingSession) Finish(response []byte) *ReplayedSession

func (*ReplayingSession) ReturnFunction

func (replayingSession *ReplayingSession) ReturnFunction(ctx context.Context, content []byte)

func (*ReplayingSession) SendUDP

func (replayingSession *ReplayingSession) SendUDP(ctx context.Context, content []byte, peer net.UDPAddr)

type ReturnFunction

type ReturnFunction struct {
	CallFunctionId string
	ReturnValue    interface{}
	// contains filtered or unexported fields
}

func (*ReturnFunction) GetActionId

func (action *ReturnFunction) GetActionId() string

func (*ReturnFunction) GetActionType

func (action *ReturnFunction) GetActionType() string

func (*ReturnFunction) GetOccurredAt

func (action *ReturnFunction) GetOccurredAt() int64

type ReturnInbound

type ReturnInbound struct {
	OriginalResponse []byte
	Response         []byte
	// contains filtered or unexported fields
}

func (*ReturnInbound) GetActionId

func (action *ReturnInbound) GetActionId() string

func (*ReturnInbound) GetActionType

func (action *ReturnInbound) GetActionType() string

func (*ReturnInbound) GetOccurredAt

func (action *ReturnInbound) GetOccurredAt() int64

func (*ReturnInbound) MarshalJSON

func (returnInbound *ReturnInbound) MarshalJSON() ([]byte, error)

type SendUDP

type SendUDP struct {
	Peer    net.UDPAddr
	Content []byte
	// contains filtered or unexported fields
}

func (*SendUDP) GetActionId

func (action *SendUDP) GetActionId() string

func (*SendUDP) GetActionType

func (action *SendUDP) GetActionType() string

func (*SendUDP) GetOccurredAt

func (action *SendUDP) GetOccurredAt() int64

func (*SendUDP) MarshalJSON

func (sendUDP *SendUDP) MarshalJSON() ([]byte, error)

type SimMatcher

type SimMatcher struct {
}

func (SimMatcher) DoMatch

func (matchSim SimMatcher) DoMatch(ctx context.Context, connLastMatchedIndex int, request []byte, replayingSession *ReplayingSession) (int, float64, *recording.CallOutbound)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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