{"modulePath":"github.com/ablankz/bloader","version":"v0.1.25","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package httpexec\n\nPackage httpexec provides the executor for the HTTP request.\n\n## Types\n\n```go\ntype ExecReq interface {\n\t// CreateRequest creates the http.Request object for the query\n\tCreateRequest(ctx context.Context, log logger.Logger, count int) (*http.Request, error)\n}\n```\nExecReq represents the request executor\n\n```go\ntype MassRequestContent[Req ExecReq] struct {\n\tReq          Req\n\tInterval     time.Duration\n\tResponseWait bool\n\tResChan      chan\u003c- ResponseContent\n\tCountLimit   RequestCountLimit\n\tResponseType ResponseType\n}\n```\nMassRequestContent represents the request content\n\n```go\nfunc (q MassRequestContent[Req]) MassRequestExecute(\n\tctx context.Context,\n\tlog logger.Logger,\n) error\n```\nMassRequestExecute executes the request\n\n```go\ntype MassRequestExecutor interface {\n\t// MassRequestExecute executes the request\n\tMassRequestExecute(ctx context.Context, log logger.Logger) error\n}\n```\nMassRequestExecutor represents the request executor\n\n```go\ntype RequestContent[Req ExecReq] struct {\n\tReq          Req\n\tResponseType ResponseType\n}\n```\nRequestContent represents the request content\n\n```go\nfunc (q RequestContent[Req]) RequestExecute(\n\tctx context.Context,\n\tlog logger.Logger,\n) (ResponseContent, error)\n```\nRequestExecute executes the request\n\n```go\ntype RequestCountLimit struct {\n\tEnabled bool\n\tCount   int\n}\n```\nRequestCountLimit represents the request count limit\n\n```go\ntype RequestExecutor interface {\n\t// RequestExecute executes the request\n\tRequestExecute(ctx context.Context, log logger.Logger) (ResponseContent, error)\n}\n```\nRequestExecutor represents the request executor\n\n```go\ntype ResponseContent struct {\n\tSuccess         bool\n\tStartTime       time.Time\n\tEndTime         time.Time\n\tRes             any\n\tCount           int\n\tByteResponse    []byte\n\tResponseTime    int64\n\tStatusCode      int\n\tReqCreateHasErr bool\n\tParseResHasErr  bool\n\tHasSystemErr    bool\n\tWithCountLimit  bool\n}\n```\nResponseContent represents the response content\n\n```go\nfunc (r ResponseContent) ToWriteHTTPData() WriteHTTPData\n```\nToWriteHTTPData converts the ResponseContent to WriteHTTPData\n\n```go\ntype ResponseType string\n```\nResponseType represents the response type\n\n```go\nconst (\n\t// ResponseTypeJSON represents the JSON response type\n\tResponseTypeJSON ResponseType = \"json\"\n\t// ResponseTypeXML represents the XML response type\n\tResponseTypeXML ResponseType = \"xml\"\n\t// ResponseTypeYAML represents the YAML response type\n\tResponseTypeYAML ResponseType = \"yaml\"\n\t// ResponseTypeText represents the text response type\n\tResponseTypeText ResponseType = \"text\"\n\t// ResponseTypeHTML represents the HTML response type\n\tResponseTypeHTML ResponseType = \"html\"\n)\n```\n\n```go\ntype WriteHTTPData struct {\n\tSuccess          bool\n\tSendDatetime     string\n\tReceivedDatetime string\n\tCount            int\n\tResponseTime     int\n\tStatusCode       string\n}\n```\nWriteHTTPData represents the data to be written\n\n```go\nfunc (d WriteHTTPData) ToSlice() []string\n```\nToSlice converts the WriteHTTPData to a slice\n\n","path":"github.com/ablankz/bloader/internal/executor/httpexec","name":"httpexec","synopsis":"Package httpexec provides the executor for the HTTP request.","isRedistributable":true}
