client

package
v15.10.4 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCafileNotFound = errors.New("cafile not found")

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Msg string
}

func (*APIError) Error

func (e *APIError) Error() string

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) DoRequest

func (c *GitlabNetClient) DoRequest(ctx context.Context, method, path string, data interface{}) (*http.Response, error)

func (*GitlabNetClient) Get

func (c *GitlabNetClient) Get(ctx context.Context, path string) (*http.Response, error)

func (*GitlabNetClient) Post

func (c *GitlabNetClient) Post(ctx context.Context, path string, data interface{}) (*http.Response, 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 HTTPClient

type HTTPClient struct {
	*http.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 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.

type OriginalRemoteIPContextKey

type OriginalRemoteIPContextKey struct{}

OriginalRemoteIPContextKey is to be used as the key in a Context to set an X-Forwarded-For header in a request

Jump to

Keyboard shortcuts

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