blow

package
v0.0.0-...-4282750 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Gray = uint8(iota + 90)

	Green

	Magenta
	Cyan

	EndColor = "\033[0m"
)

Variables

View Source
var Debug = ss.Must(ss.GetenvBool("DEBUG", false))

Functions

func Color

func Color(str string, color uint8) string

func ColorStart

func ColorStart(color uint8) string

func ColorfulHTML

func ColorfulHTML(str string) string

func ColorfulHeader

func ColorfulHeader(str string) string

func ColorfulResponse

func ColorfulResponse(str string, isJSON bool, pretty bool) string

func IsBlowEnv

func IsBlowEnv() bool

func KeyUsageString

func KeyUsageString(k x509.KeyUsage) []string

KeyUsageString convert x509.KeyUsage to string.

func NewConditionalLock

func NewConditionalLock(condition bool) sync.Locker

func ProxyHTTPDialerTimeout

func ProxyHTTPDialerTimeout(timeout time.Duration, dialer Dialer, tls bool) fasthttp.DialFunc

ProxyHTTPDialerTimeout returns a fasthttp.DialFunc that dials using code original from fasthttpproxy.ProxyHTTPDialerTimeout the env(HTTP_PROXY, HTTPS_PROXY and NO_PROXY) configured HTTP proxy using the given timeout.

Example usage:

c := &fasthttp.Client{
	Dial: ProxyHTTPDialerTimeout(time.Second * 2),
}

func StartBlow

func StartBlow()

func TryStartAsBlow

func TryStartAsBlow() bool

Types

type Bench

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

func (*Bench) Final

func (b *Bench) Final(_ context.Context, conf *berf.Config) error

func (*Bench) Init

func (b *Bench) Init(ctx context.Context, conf *berf.Config) (*berf.BenchOption, error)

func (*Bench) Invoke

func (b *Bench) Invoke(ctx context.Context, conf *berf.Config) (*berf.Result, error)

func (*Bench) Name

func (b *Bench) Name(context.Context, *berf.Config) string

type ConditionLock

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

func (*ConditionLock) Lock

func (c *ConditionLock) Lock()

func (*ConditionLock) Unlock

func (c *ConditionLock) Unlock()

type Dialer

type Dialer interface {
	Dial(addr string) (net.Conn, error)
	DialTimeout(addr string, timeout time.Duration) (net.Conn, error)
}

type Durations

type Durations struct {
	Map     map[string]time.Duration
	Default time.Duration
}

func (*Durations) Get

func (d *Durations) Get(keys ...string) time.Duration

type HttpieArg

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

func (*HttpieArg) AddQuery

func (a *HttpieArg) AddQuery(k, v string)

func (*HttpieArg) Build

func (a *HttpieArg) Build(method string, form bool) *HttpieArgBody

func (*HttpieArg) MaybePost

func (a *HttpieArg) MaybePost() bool

func (*HttpieArg) SetHeader

func (a *HttpieArg) SetHeader(k, v string)

func (*HttpieArg) SetJsonMap

func (a *HttpieArg) SetJsonMap(k string, v interface{})

func (*HttpieArg) SetParam

func (a *HttpieArg) SetParam(k, v string)

func (*HttpieArg) SetPostFile

func (a *HttpieArg) SetPostFile(formname, filename string)

type HttpieArgBody

type HttpieArgBody struct {
	Body io.ReadCloser

	ContentType string

	BodyString string
	Multipart  bool
}

type Invoker

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

func Blow

func Blow(ctx context.Context, conf *berf.Config) *Invoker

func NewInvoker

func NewInvoker(ctx context.Context, opt *Opt) (*Invoker, error)

func (*Invoker) Run

func (r *Invoker) Run(ctx context.Context, bc *berf.Config, initial bool) (*berf.Result, error)

type LogEntry

type LogEntry struct {
	Log string
}

type Opt

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

func (*Opt) HasPrintOption

func (o *Opt) HasPrintOption(feature uint8) bool

func (*Opt) MaybePost

func (o *Opt) MaybePost() bool

type Pair

type Pair struct {
	V1, V2 string
}

Directories

Path Synopsis
art
Package lossy simulates bandwidth, latency and packet loss for net.PacketConn and net.Conn interfaces.
Package lossy simulates bandwidth, latency and packet loss for net.PacketConn and net.Conn interfaces.

Jump to

Keyboard shortcuts

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