externalapiclient

package
v0.0.0-...-1da26c8 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderKeyContentType       = "Content-Type"
	HeaderValueApplicationJSON = "application/json; charset=utf-8"
)

Variables

This section is empty.

Functions

func IsFailToHTTPClientDoError

func IsFailToHTTPClientDoError(err error) bool

func NewFailToHTTPClientDoError

func NewFailToHTTPClientDoError(err error) error

Types

type Client

type Client interface {
	Do(ctx context.Context, request *Request, requestEditors ...RequestEditorFunc) (*Response, error)
}

type ClientImpl

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

func New

func (*ClientImpl) Do

func (c *ClientImpl) Do(ctx context.Context, request *Request, requestEditors ...RequestEditorFunc) (*Response, error)

type FailToHTTPClientDoError

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

func (*FailToHTTPClientDoError) Error

func (e *FailToHTTPClientDoError) Error() string

func (*FailToHTTPClientDoError) Unwrap

func (e *FailToHTTPClientDoError) Unwrap() error

type HTTPClientDoFunc

type HTTPClientDoFunc func(r *http.Request) (*http.Response, error)

type Request

type Request struct {
	Method      string
	URL         string
	ContentType string
	Body        []byte
}

type RequestEditorFunc

type RequestEditorFunc func(r *http.Request) error

type Response

type Response struct {
	StatusCode  int
	ContentType string
	Body        []byte
}

Directories

Path Synopsis
Package externalapiclientmocks is a generated GoMock package.
Package externalapiclientmocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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