Documentation
¶
Index ¶
- Constants
- Variables
- func CheckBodyParam(bodyJSON string, bodyFile string) (string, error)
- func CheckPortInUse(port string) string
- func NewID() int64
- func NewStringID() string
- func ParseHTTPParams(method string, headers []string, body string, bodyFile string) ([]byte, map[string]string, error)
- func SetCommandPrefix(name string)
- type Bar
- type TimeBar
Constants ¶
View Source
const ( BodyTypeJSON = "application/json" BodyTypeForm = "application/x-www-form-urlencoded" BodyTypeText = "text/plain" )
Variables ¶
View Source
var CommandPrefix = "sponge perftest"
Functions ¶
func CheckBodyParam ¶
CheckBodyParam checks if the body parameter is provided in JSON or file format.
func CheckPortInUse ¶ added in v1.15.3
CheckPortInUse checks if the given port is in use, if not, it returns a new available port.
func NewStringID ¶ added in v1.15.3
func NewStringID() string
NewStringID Generate a string ID, the hexadecimal form of NewID(), total 16 bytes.
func ParseHTTPParams ¶
func ParseHTTPParams(method string, headers []string, body string, bodyFile string) ([]byte, map[string]string, error)
nolint
func SetCommandPrefix ¶ added in v1.15.3
func SetCommandPrefix(name string)
SetCommandPrefix sets the command prefix for the perftest command.
Types ¶
type Bar ¶
type Bar struct {
// contains filtered or unexported fields
}
Bar represents a thread-safe progress bar.
func (*Bar) Finish ¶
func (b *Bar) Finish()
Finish marks the bar as complete and prints the final state.
type TimeBar ¶
type TimeBar struct {
// contains filtered or unexported fields
}
TimeBar represents a thread-safe time-based progress bar.
func NewTimeBar ¶
NewTimeBar returns a new time-based progress bar with the given duration.
Click to show internal directories.
Click to hide internal directories.