webtest

package module
v0.2.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: MIT Imports: 10 Imported by: 0

README

webtest

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseFile

func CloseFile(file *os.File)

func FormatStringArray

func FormatStringArray(buf *bytes.Buffer, arr []string, delimiter string) *bytes.Buffer

func Is2xxSuccessful

func Is2xxSuccessful(r *http.Response) bool

func Is3xxRedirection

func Is3xxRedirection(r *http.Response) bool

func Is4xxClientError

func Is4xxClientError(r *http.Response) bool

func Is5xxServerError

func Is5xxServerError(r *http.Response) bool

func ReadCsv

func ReadCsv(path string) [][]string

func SetHeaders

func SetHeaders(r *http.Request, m map[string]string)

func WriteToFile

func WriteToFile(f *os.File, b []byte)

Types

type FileSettings

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

func InitDefaultFileSettings

func InitDefaultFileSettings() *FileSettings

type Transport

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

func InitTransport

func InitTransport() *Transport

func (*Transport) ConnDuration

func (t *Transport) ConnDuration() time.Duration

func (*Transport) Duration

func (t *Transport) Duration() time.Duration

func (*Transport) ReqDuration

func (t *Transport) ReqDuration() time.Duration

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error)

type WebClient

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

func InitWebClient

func InitWebClient() *WebClient

func (*WebClient) AddQueryParams

func (w *WebClient) AddQueryParams(s string, m map[string]string) string

func (*WebClient) Delete

func (w *WebClient) Delete(url, p string) (*http.Response, error)

func (*WebClient) Get

func (w *WebClient) Get(url string) (*http.Response, error)

func (*WebClient) Headers

func (w *WebClient) Headers(m *map[string]string) *WebClient

func (*WebClient) Options

func (w *WebClient) Options(o *WebClientOptions) *WebClient

func (*WebClient) Patch

func (w *WebClient) Patch(url string, body []byte) (*http.Response, error)

func (*WebClient) Post

func (w *WebClient) Post(url string, body []byte) (*http.Response, error)

func (*WebClient) Put

func (w *WebClient) Put(url string, body []byte) (*http.Response, error)

type WebClientOptions

type WebClientOptions struct {
	WriteToFile bool   `json:"writeToFile"`
	FilePath    string `json:"filePath"`
}

Jump to

Keyboard shortcuts

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