interfaces

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpClient

type HttpClient interface {
	SetBaseUrl(baseUrl string) error
	SetMaxRetry(maxRetry int)
	SetTimeout(timeout time.Duration)
	Del(endpoint string, query types.Query, headers map[string]string) HttpResponse
	Get(endpoint string, query types.Query, headers map[string]string) HttpResponse
	Head(endpoint string, headers map[string]string) HttpResponse
	Post(endpoint string, query types.Query, headers map[string]string, body any, bodyType types.ContentType) HttpResponse
	Put(endpoint string, query types.Query, headers map[string]string, body any, bodyType types.ContentType) HttpResponse
	Patch(endpoint string, query types.Query, headers map[string]string, body any, bodyType types.ContentType) HttpResponse
}

type HttpResponse

type HttpResponse interface {
	Result(any) error
	Error() error
	IsSuccessfulResponse() bool
	Status() int
	Headers() http.Header
	RawData() []byte
	RawResponse() *http.Response
}

Jump to

Keyboard shortcuts

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