Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Artifact ¶
type Artifact struct {
// contains filtered or unexported fields
}
Artifact proxies requests for artifact files to the GitLab artifacts API
func New ¶
New when provided the arguments defined herein, returns a pointer to an Artifact that is used to proxy requests.
func (*Artifact) BuildURL ¶
BuildURL returns a pointer to a url.URL for where the request should be proxied to. The returned bool will indicate if there is some sort of issue with the url while it is being generated.
The URL is generated from the host (which contains the top-level group and ends with the pagesDomain) and the path (which contains any subgroups, the project, a job ID and a path for the artifact file we want to download)
func (*Artifact) TryMakeRequest ¶
func (a *Artifact) TryMakeRequest(host string, w http.ResponseWriter, r *http.Request, token string, additionalHandler func(*http.Response) bool) bool
TryMakeRequest will attempt to proxy a request and write it to the argument http.ResponseWriter, ultimately returning a bool that indicates if the http.ResponseWriter has been written to in any capacity. Additional handler func may be given which should return true if it did handle the response.