Documentation ¶
Index ¶
- Variables
- func DefaultTransport() http.RoundTripper
- func NewTransport(next http.RoundTripper) http.RoundTripper
- type ApiError
- type ErrorResponse
- type GitlabNetClient
- func (c *GitlabNetClient) Do(request *http.Request) (*http.Response, error)
- func (c *GitlabNetClient) DoRequest(ctx context.Context, method, path string, data interface{}) (*http.Response, error)
- func (c *GitlabNetClient) Get(ctx context.Context, path string) (*http.Response, error)
- func (c *GitlabNetClient) Post(ctx context.Context, path string, data interface{}) (*http.Response, error)
- func (c *GitlabNetClient) SetUserAgent(ua string)
- type HTTPClientOpt
- type HttpClient
- type OriginalRemoteIPContextKey
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCafileNotFound = errors.New("cafile not found")
Functions ¶
func DefaultTransport ¶ added in v14.21.0
func DefaultTransport() http.RoundTripper
func NewTransport ¶ added in v14.21.0
func NewTransport(next http.RoundTripper) http.RoundTripper
Types ¶
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
}
type GitlabNetClient ¶
type GitlabNetClient struct {
// contains filtered or unexported fields
}
func NewGitlabNetClient ¶
func NewGitlabNetClient( user, password, secret string, httpClient *HttpClient, ) (*GitlabNetClient, error)
func (*GitlabNetClient) SetUserAgent ¶
func (c *GitlabNetClient) SetUserAgent(ua string)
SetUserAgent overrides the default user agent for the User-Agent header field for subsequent requests for the GitlabNetClient
type HTTPClientOpt ¶
type HTTPClientOpt func(*httpClientCfg)
HTTPClientOpt provides options for configuring an HttpClient
func WithClientCert ¶
func WithClientCert(certPath, keyPath string) HTTPClientOpt
WithClientCert will configure the HttpClient to provide client certificates when connecting to a server.
func WithHTTPRetryOpts ¶ added in v14.16.0
func WithHTTPRetryOpts(waitMin, waitMax time.Duration, maxAttempts int) HTTPClientOpt
type HttpClient ¶
type HttpClient struct { RetryableHTTP *retryablehttp.Client Host string }
func NewHTTPClientWithOpts ¶
func NewHTTPClientWithOpts(gitlabURL, gitlabRelativeURLRoot, caFile, caPath string, readTimeoutSeconds uint64, opts []HTTPClientOpt) (*HttpClient, error)
NewHTTPClientWithOpts builds an HTTP client using the provided options
type OriginalRemoteIPContextKey ¶
type OriginalRemoteIPContextKey struct{}
To use as the key in a Context to set an X-Forwarded-For header in a request
Click to show internal directories.
Click to hide internal directories.