artifact

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2018 License: MIT Imports: 10 Imported by: 0

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

func New(server string, timeoutSeconds int, pagesDomain string) *Artifact

New when provided the arguments defined herein, returns a pointer to an Artifact that is used to proxy requests.

func (*Artifact) BuildURL

func (a *Artifact) BuildURL(host, requestPath string) (*url.URL, bool)

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

Jump to

Keyboard shortcuts

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