venom: Index | Files

package kafka

import ""


Package Files



const Name = "kafka"

Name of executor

func New Uses

func New() venom.Executor

New returns a new Executor

type Executor Uses

type Executor struct {
    Addrs              []string `json:"addrs,omitempty" yaml:"addrs,omitempty"`
    WithTLS            bool     `json:"with_tls,omitempty" yaml:"withTLS,omitempty"`
    WithSASL           bool     `json:"with_sasl,omitempty" yaml:"withSASL,omitempty"`
    WithSASLHandshaked bool     `json:"with_sasl_handshaked,omitempty" yaml:"withSASLHandshaked,omitempty"`
    User               string   `json:"user,omitempty" yaml:"user,omitempty"`
    Password           string   `json:"password,omitempty" yaml:"password,omitempty"`

    //ClientType must be "consumer" or "producer"
    ClientType string `json:"client_type,omitempty" yaml:"clientType,omitempty"`

    //Used when ClientType is consumer
    GroupID string   `json:"group_id,omitempty" yaml:"groupID,omitempty"`
    Topics  []string `json:"topics,omitempty" yaml:"topics,omitempty"`
    //Represents the timeout for reading messages. In Milliseconds. Default 5000
    Timeout int64 `json:"timeout,omitempty" yaml:"timeout,omitempty"`
    //Represents the limit of message will be read. After limit, consumer stop read message
    MessageLimit int `json:"message_limit,omitempty" yaml:"messageLimit,omitempty"`
    //InitialOffset represents the initial offset for the consumer. Possible value : newest, oldest. default: newest
    InitialOffset string `json:"initial_offset,omitempty" yaml:"initialOffset,omitempty"`
    //MarkOffset allows to mark offset when consuming message
    MarkOffset bool `json:"mark_offset,omitempty" yaml:"markOffset,omitempty"`

    //Used when ClientType is producer
    //Messages represents the message sended by producer
    Messages []Message `json:"messages,omitempty" yaml:"messages,omitempty"`

    //MessagesFile represents the messages into the file sended by producer (messages field would be ignored)
    MessagesFile string `json:"messages_file,omitempty" yaml:"messages_file,omitempty"`

    // Kafka version, default is
    KafkaVersion string `json:"kafka_version,omitempty" yaml:"kafka_version,omitempty"`

Executor represents a Test Exec

func (Executor) GetDefaultAssertions Uses

func (Executor) GetDefaultAssertions() *venom.StepAssertions

GetDefaultAssertions return default assertions for type exec

func (Executor) Run Uses

func (Executor) Run(testCaseContext venom.TestCaseContext, l venom.Logger, step venom.TestStep, workdir string) (venom.ExecutorResult, error)

Run execute TestStep of type exec

func (Executor) ZeroValueResult Uses

func (Executor) ZeroValueResult() venom.ExecutorResult

ZeroValueResult return an empty implemtation of this executor result

type Message Uses

type Message struct {
    Topic string
    Value string

Message represents the object sended or received from kafka

type MessageJSON Uses

type MessageJSON struct {
    Topic string
    Value interface{}

MessageJSON represents the object sended or received from kafka

type Result Uses

type Result struct {
    Executor     Executor      `json:"executor,omitempty" yaml:"executor,omitempty"`
    TimeSeconds  float64       `json:"timeSeconds,omitempty" yaml:"timeSeconds,omitempty"`
    TimeHuman    string        `json:"timeHuman,omitempty" yaml:"timeHuman,omitempty"`
    Messages     []Message     `json:"messages,omitempty" yaml:"messages,omitempty"`
    MessagesJSON []interface{} `json:"messagesJSON,omitempty" yaml:"messagesJSON,omitempty"`
    Err          string        `json:"error" yaml:"error"`

Result represents a step result.

Package kafka imports 12 packages (graph) and is imported by 2 packages. Updated 2020-10-28. Refresh now. Tools for package owners.