package toxiproxy

import "github.com/IBM/sarama/internal/toxiproxy"

Index

Types

type Attributes

type Attributes map[string]int

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(endpoint string) *Client

func (*Client) CreateProxy

func (c *Client) CreateProxy(
	name string,
	listenAddr string,
	targetAddr string,
) (*Proxy, error)

func (*Client) Proxy

func (c *Client) Proxy(name string) (*Proxy, error)

func (*Client) ResetState

func (c *Client) ResetState() error

type Proxy

type Proxy struct {
	Name       string `json:"name"`
	ListenAddr string `json:"listen"`
	TargetAddr string `json:"upstream"`
	Enabled    bool   `json:"enabled"`
	// contains filtered or unexported fields
}

func (*Proxy) AddToxic

func (p *Proxy) AddToxic(
	name string,
	toxicType string,
	stream string,
	toxicity float32,
	attributes Attributes,
) (*Toxic, error)

func (*Proxy) Disable

func (p *Proxy) Disable() error

func (*Proxy) Enable

func (p *Proxy) Enable() error

func (*Proxy) Save

func (p *Proxy) Save() (*Proxy, error)

type Toxic

type Toxic struct {
	Name       string     `json:"name"`
	Type       string     `json:"type"`
	Stream     string     `json:"stream,omitempty"`
	Toxicity   float32    `json:"toxicity"`
	Attributes Attributes `json:"attributes"`
}

Source Files

client.go proxy.go toxic.go

Version
v1.45.1 (latest)
Published
Mar 2, 2025
Platform
linux/amd64
Imports
7 packages
Last checked
1 day ago

Tools for package owners.