Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientConfig ¶
type ClientConfig struct {
BaseURL string `js:"baseUrl"`
ClientID string `js:"clientId"`
ClientSecret string `js:"clientSecret"`
TokenURL string `js:"tokenUrl"`
Scope string `js:"scope"`
MaxBatchSize int `js:"maxBatchSize"`
}
ClientConfig holds all options passed from the JS constructor.
type KafkaRestClient ¶
type KafkaRestClient struct {
// contains filtered or unexported fields
}
KafkaRestClient is the object exposed to k6 JS scripts.
func (*KafkaRestClient) Close ¶
func (c *KafkaRestClient) Close()
Close is a no-op for now but satisfies the expected JS API surface.
func (*KafkaRestClient) Produce ¶
func (c *KafkaRestClient) Produce(topic string, messages []Message) (*ProduceResponse, error)
Produce publishes a batch of messages to the given Kafka topic. JS usage: client.produce("my-topic", [{value: {foo: "bar"}}])
type KafkaRestModule ¶
type KafkaRestModule struct {
// contains filtered or unexported fields
}
func (*KafkaRestModule) Exports ¶
func (m *KafkaRestModule) Exports() modules.Exports
type Message ¶
type Message struct {
Key interface{} `json:"key,omitempty"`
Value interface{} `json:"value"`
}
Message represents a single Kafka record sent to the REST Proxy.
type OffsetMetadata ¶
type OffsetMetadata struct {
Partition int `json:"partition"`
Offset int64 `json:"offset"`
ErrorCode *int `json:"error_code,omitempty"`
Error string `json:"error,omitempty"`
}
OffsetMetadata describes where a single record landed in Kafka.
type ProduceResponse ¶
type ProduceResponse struct {
KeySchemaID int `json:"key_schema_id,omitempty"`
ValueSchemaID int `json:"value_schema_id,omitempty"`
Offsets []OffsetMetadata `json:"offsets"`
}
ProduceResponse is returned to the JS script after a successful publish.
type RootModule ¶
type RootModule struct{}
func (*RootModule) NewModuleInstance ¶
func (*RootModule) NewModuleInstance(vu modules.VU) modules.Instance
type TokenManager ¶
type TokenManager struct {
// contains filtered or unexported fields
}
TokenManager fetches and caches an OAuth client-credentials token. It is safe for concurrent use across goroutines (VUs).
func NewTokenManager ¶
func NewTokenManager(cfg ClientConfig) *TokenManager
NewTokenManager creates a TokenManager from a ClientConfig.