Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateWasmEncoderID(wasmEncoderData []byte) uint64
- func LargeRandomTester(encoder *TrafficEncoder) *clientpb.TrafficEncoderTest
- func MediumRandomTester(encoder *TrafficEncoder) *clientpb.TrafficEncoderTest
- func SmallRandomTester(encoder *TrafficEncoder) *clientpb.TrafficEncoderTest
- func VeryLargeRandomTester(encoder *TrafficEncoder) *clientpb.TrafficEncoderTest
- type TrafficEncoder
- type TrafficEncoderLogCallback
- type TrafficEncoderTestFunc
Constants ¶
View Source
const ( SmallRandom = "Small Random (64 bytes)" MediumRandom = "Medium Random (8KB)" LargeRandom = "Large Random (8MB)" VeryLargeRandom = "Very Large Random (128MB)" )
Variables ¶
View Source
var ( TrafficEncoderTesters = map[string]TrafficEncoderTestFunc{ SmallRandom: SmallRandomTester, MediumRandom: MediumRandomTester, LargeRandom: LargeRandomTester, VeryLargeRandom: VeryLargeRandomTester, } )
Functions ¶
func CalculateWasmEncoderID ¶
CalculateWasmEncoderID - Creates an Encoder ID based on the hash of the wasm bin
func LargeRandomTester ¶
func LargeRandomTester(encoder *TrafficEncoder) *clientpb.TrafficEncoderTest
LargeRandomTester - 8MB random sample
func MediumRandomTester ¶
func MediumRandomTester(encoder *TrafficEncoder) *clientpb.TrafficEncoderTest
MediumRandomTester - 8KB random sample
func SmallRandomTester ¶
func SmallRandomTester(encoder *TrafficEncoder) *clientpb.TrafficEncoderTest
SmallRandomTester - 64 byte sample
func VeryLargeRandomTester ¶
func VeryLargeRandomTester(encoder *TrafficEncoder) *clientpb.TrafficEncoderTest
VeryLargeRandomTester - 128MB random sample
Types ¶
type TrafficEncoder ¶
type TrafficEncoder struct { ID uint64 FileName string Data []byte // contains filtered or unexported fields }
TrafficEncoder - Implements the `Encoder` interface using a wasm backend
func CreateTrafficEncoder ¶
func CreateTrafficEncoder(name string, wasm []byte, logger TrafficEncoderLogCallback) (*TrafficEncoder, error)
CreateTrafficEncoder - Initialize an WASM runtime using the provided module name, code, and log callback
func (*TrafficEncoder) Close ¶
func (t *TrafficEncoder) Close() error
type TrafficEncoderLogCallback ¶
type TrafficEncoderLogCallback func(string)
TrafficEncoderLogCallback - Callback function exposed to the wasm runtime to log messages
type TrafficEncoderTestFunc ¶
type TrafficEncoderTestFunc func(*TrafficEncoder) *clientpb.TrafficEncoderTest
Click to show internal directories.
Click to hide internal directories.