Documentation ¶
Index ¶
- func Fallbacks(ff ...string) configurator
- func FileServer(files fs.FS, cc ...configurator) (h *fileServer, err error)
- func Logger(l *zap.Logger) configurator
- func MountSPA(r chi.Router, path string, root fs.FS, cc ...configurator) error
- func NotFound(h http.HandlerFunc) configurator
- func SetupDefaults(timeout time.Duration, tlsInsecure bool)
- func ToError(resp *http.Response) error
- func UrlPrefix(prefix string) configurator
- type BufferedReader
- type Client
- func (c *Client) Debug(level DebugLevel) *Client
- func (c *Client) Delete(url string) (*http.Request, error)
- func (c *Client) Do(req *http.Request) (*http.Response, error)
- func (c *Client) Get(url string) (*http.Request, error)
- func (c *Client) Patch(url string, body interface{}) (*http.Request, error)
- func (c *Client) Post(url string, body interface{}) (*http.Request, error)
- func (c *Client) Request(method, url string, body interface{}) (*http.Request, error)
- type Config
- type DebugLevel
- type Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileServer ¶
func MountSPA ¶
MountSPA helper function, preconfigures FileServer for SPA serving and mounts it to chi Router
func NotFound ¶
func NotFound(h http.HandlerFunc) configurator
func SetupDefaults ¶
SetupDefaults Reconfigures defaults for HTTP client & transport
Types ¶
type BufferedReader ¶
type BufferedReader struct {
// contains filtered or unexported fields
}
The BufferedReader behaves exactly like a bytes.Reader, with the exception when the last block is read, it automatically rewinds the internal pointer to the start, so effectively, the content can be read again without calling Seek() externally.
func NewBufferedReader ¶
func NewBufferedReader(rr io.Reader) (bb *BufferedReader, err error)
NewBufferedReader copies original data to the BufferedReader
type Client ¶
type Client struct { Transport *http.Transport Client *http.Client // contains filtered or unexported fields }
func (*Client) Debug ¶
func (c *Client) Debug(level DebugLevel) *Client
type DebugLevel ¶
type DebugLevel string
const ( INFO DebugLevel = "info" FULL DebugLevel = "full" )
Click to show internal directories.
Click to hide internal directories.