Documentation
¶
Index ¶
- func DownloadAsFile(ctx context.Context, options *httputilsparameteroptions.DownloadAsFileOptions) (downloadedFile filesinterfaces.File, err error)
- func GenerateCertAndKeyForTestWebserver(ctx context.Context) (certAndKeyPair *x509utils.X509CertKeyPair, err error)
- func GetNativeClient() (client httputilsinterfaces.Client)
- func GetProgressEveryNBytes(ctx context.Context) int
- func GetTestWebServer(port int) (webServer httputilsinterfaces.Server, err error)
- func GetTlsTestWebServer(ctx context.Context, port int) (webServer httputilsinterfaces.Server, err error)
- func SendRequest(ctx context.Context, requestOptions *httputilsparameteroptions.RequestOptions) (httputilsinterfaces.Response, error)
- func SendRequestAndGetBodyAsString(ctx context.Context, requestOptions *httputilsparameteroptions.RequestOptions) (response string, err error)
- func WithDownloadProgressEveryNBytes(ctx context.Context, nBytes int) context.Context
- func WithDownloadProgressEveryNMBytes(ctx context.Context, nMBytes int) context.Context
- func WithDownloadProgressEveryNkBytes(ctx context.Context, nkBytes int) context.Context
- type NativeClient
- func (n *NativeClient) DownloadAsFile(ctx context.Context, ...) (downloadedFile filesinterfaces.File, err error)
- func (n *NativeClient) DownloadAsTemporaryFile(ctx context.Context, ...) (downloadedFile filesinterfaces.File, err error)
- func (c *NativeClient) SendRequest(ctx context.Context, requestOptions *httputilsparameteroptions.RequestOptions) (response httputilsinterfaces.Response, err error)
- func (c *NativeClient) SendRequestAndGetBodyAsString(ctx context.Context, requestOptions *httputilsparameteroptions.RequestOptions) (responseBody string, err error)
- func (c *NativeClient) SendRequestAndRunYqQueryAgainstBody(ctx context.Context, requestOptions *httputilsparameteroptions.RequestOptions, ...) (result string, err error)
- type TestWebServer
- func (t *TestWebServer) GetMux() (mux *http.ServeMux, err error)
- func (t *TestWebServer) GetPort() (port int, err error)
- func (t *TestWebServer) GetServer() (server *http.Server, err error)
- func (t *TestWebServer) GetTlsCert() (cert *x509.Certificate, err error)
- func (t *TestWebServer) GetWebServerWaitGroup() (webServerWaitGroup *sync.WaitGroup, err error)
- func (t *TestWebServer) SetMux(mux *http.ServeMux) (err error)
- func (t *TestWebServer) SetPort(port int) (err error)
- func (t *TestWebServer) SetServer(server *http.Server) (err error)
- func (t *TestWebServer) SetTlsCertAndKey(ctx context.Context, certAndKey *x509utils.X509CertKeyPair) (err error)
- func (t *TestWebServer) SetWebServerWaitGroup(webServerWaitGroup *sync.WaitGroup) (err error)
- func (t *TestWebServer) StartInBackground(ctx context.Context) (err error)
- func (t *TestWebServer) Stop(ctx context.Context) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadAsFile ¶ added in v0.343.0
func DownloadAsFile(ctx context.Context, options *httputilsparameteroptions.DownloadAsFileOptions) (downloadedFile filesinterfaces.File, err error)
func GenerateCertAndKeyForTestWebserver ¶ added in v0.314.0
func GenerateCertAndKeyForTestWebserver(ctx context.Context) (certAndKeyPair *x509utils.X509CertKeyPair, err error)
func GetNativeClient ¶
func GetNativeClient() (client httputilsinterfaces.Client)
Get the HTTP client written using native go http implementation.
This is the default client to use when sending request from your running machine.
func GetProgressEveryNBytes ¶ added in v0.343.0
func GetTestWebServer ¶
func GetTestWebServer(port int) (webServer httputilsinterfaces.Server, err error)
func GetTlsTestWebServer ¶
func SendRequest ¶ added in v0.314.0
func SendRequest(ctx context.Context, requestOptions *httputilsparameteroptions.RequestOptions) (httputilsinterfaces.Response, error)
func SendRequestAndGetBodyAsString ¶
func SendRequestAndGetBodyAsString(ctx context.Context, requestOptions *httputilsparameteroptions.RequestOptions) (response string, err error)
func WithDownloadProgressEveryNBytes ¶ added in v0.343.0
func WithDownloadProgressEveryNMBytes ¶ added in v0.343.0
Types ¶
type NativeClient ¶
type NativeClient struct { }
HTTP client written using native go http implementation.
func NewNativeClient ¶
func NewNativeClient() (n *NativeClient)
func (*NativeClient) DownloadAsFile ¶
func (n *NativeClient) DownloadAsFile(ctx context.Context, downloadOptions *httputilsparameteroptions.DownloadAsFileOptions) (downloadedFile filesinterfaces.File, err error)
func (*NativeClient) DownloadAsTemporaryFile ¶
func (n *NativeClient) DownloadAsTemporaryFile(ctx context.Context, downloadOptions *httputilsparameteroptions.DownloadAsFileOptions) (downloadedFile filesinterfaces.File, err error)
func (*NativeClient) SendRequest ¶
func (c *NativeClient) SendRequest(ctx context.Context, requestOptions *httputilsparameteroptions.RequestOptions) (response httputilsinterfaces.Response, err error)
func (*NativeClient) SendRequestAndGetBodyAsString ¶
func (c *NativeClient) SendRequestAndGetBodyAsString(ctx context.Context, requestOptions *httputilsparameteroptions.RequestOptions) (responseBody string, err error)
func (*NativeClient) SendRequestAndRunYqQueryAgainstBody ¶
func (c *NativeClient) SendRequestAndRunYqQueryAgainstBody(ctx context.Context, requestOptions *httputilsparameteroptions.RequestOptions, query string) (result string, err error)
type TestWebServer ¶
type TestWebServer struct {
// contains filtered or unexported fields
}
A simple webserver mostly used for testing.
func NewTestWebServer ¶
func NewTestWebServer() (t *TestWebServer)
func (*TestWebServer) GetPort ¶
func (t *TestWebServer) GetPort() (port int, err error)
func (*TestWebServer) GetServer ¶
func (t *TestWebServer) GetServer() (server *http.Server, err error)
func (*TestWebServer) GetTlsCert ¶
func (t *TestWebServer) GetTlsCert() (cert *x509.Certificate, err error)
func (*TestWebServer) GetWebServerWaitGroup ¶
func (t *TestWebServer) GetWebServerWaitGroup() (webServerWaitGroup *sync.WaitGroup, err error)
func (*TestWebServer) SetPort ¶
func (t *TestWebServer) SetPort(port int) (err error)
func (*TestWebServer) SetServer ¶
func (t *TestWebServer) SetServer(server *http.Server) (err error)
func (*TestWebServer) SetTlsCertAndKey ¶
func (t *TestWebServer) SetTlsCertAndKey(ctx context.Context, certAndKey *x509utils.X509CertKeyPair) (err error)
func (*TestWebServer) SetWebServerWaitGroup ¶
func (t *TestWebServer) SetWebServerWaitGroup(webServerWaitGroup *sync.WaitGroup) (err error)
func (*TestWebServer) StartInBackground ¶
func (t *TestWebServer) StartInBackground(ctx context.Context) (err error)
Click to show internal directories.
Click to hide internal directories.