Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithRestClient ¶ added in v2.20.0
func ContextWithRestClient(ctx context.Context, client RestClient) context.Context
Types ¶
type RestClient ¶
type RestClient interface { RestClientDelete RestClientGet RestClientPost RestClientPut WithBearerTokenAuthentication(tokenSource oauth2.TokenSource) RestClient WithBasicAuthentication(user string, password string) RestClient WithHeader(key, value string) RestClient WithTransport(tr http.RoundTripper) RestClient WithTimeout(timeout time.Duration) RestClient }
func FromContext ¶ added in v2.20.0
func FromContext(ctx context.Context) RestClient
FromContext returns the previously set context or creates a new one
func New ¶
func New() RestClient
func NewWithClient ¶
func NewWithClient(client *http.Client) RestClient
type RestClientDelete ¶ added in v2.4.2
type RestClientGet ¶ added in v2.4.2
type RestClientPost ¶ added in v2.4.2
type RestClientPost interface { Post(ctx context.Context, url string) (*http.Response, error) PostJson(ctx context.Context, url string, body interface{}) (*http.Response, error) PostMultipart(ctx context.Context, url string, multipartWriter func(writer *multipart.Writer) error) (*http.Response, error) PostMultipartChunked(ctx context.Context, url string, multipartWriter func(writer *multipart.Writer)) (*http.Response, error) }
Click to show internal directories.
Click to hide internal directories.