GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Go to GitLab Docs homepage
  • What's new?
  • Get free trial
  • Use GitLab
  • GitLab Duo
  • GitLab Orbit
  • Extend
  • Install
  • Administer
  • Subscribe
  • Contribute
  • Solutions
  • Getting started
  • Tutorials

This view

  • Original page
  • New address

GeezerVison is showing docs.gitlab.com — Go Proxy API | GitLab Docs

 / 

Go Proxy API

  • Tier: Free, Premium, Ultimate
  • Offering: GitLab Self-Managed, GitLab Dedicated

Use this API to interact with the Go package manager client. This API is behind a feature flag that is disabled by default. GitLab administrators with access to the GitLab Rails console can enable this API for your GitLab instance.

This API is used by the go command and is generally not meant for manual consumption.

These endpoints do not adhere to the standard API authentication methods. See the Go Proxy package documentation for details on which headers and token types are supported. Undocumented authentication methods might be removed in the future.

List

Get all tagged versions for a given Go module:

GET projects/:id/packages/go/:module_name/@v/list
AttributeTypeRequiredDescription
idstringyesThe project ID or full path of a project.
module_namestringyesThe name of the Go module.
shell
curl --header "PRIVATE-TOKEN: <personal_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/1/packages/go/my-go-module/@v/list"

Example output:

shell
"v1.0.0\nv1.0.1\nv1.3.8\n2.0.0\n2.1.0\n3.0.0"

Version metadata

Get all tagged versions for a given Go module:

GET projects/:id/packages/go/:module_name/@v/:module_version.info
AttributeTypeRequiredDescription
idstringyesThe project ID or full path of a project.
module_namestringyesThe name of the Go module.
module_versionstringyesThe version of the Go module.
shell
curl --header "PRIVATE-TOKEN: <personal_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/1/packages/go/my-go-module/@v/1.0.0.info"

Example output:

json
{
  "Version": "v1.0.0",
  "Time": "1617822312 -0600"
}

Download module file

Fetch the .mod module file:

GET projects/:id/packages/go/:module_name/@v/:module_version.mod
AttributeTypeRequiredDescription
idstringyesThe project ID or full path of a project.
module_namestringyesThe name of the Go module.
module_versionstringyesThe version of the Go module.
shell
curl --header "PRIVATE-TOKEN: <personal_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/1/packages/go/my-go-module/@v/1.0.0.mod"

Write to a file:

shell
curl --header "PRIVATE-TOKEN: <personal_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/1/packages/go/my-go-module/@v/1.0.0.mod" >> foo.mod

This writes to foo.mod in the current directory.

Download module source

Fetch the .zip of the module source:

GET projects/:id/packages/go/:module_name/@v/:module_version.zip
AttributeTypeRequiredDescription
idstringyesThe project ID or full path of a project.
module_namestringyesThe name of the Go module.
module_versionstringyesThe version of the Go module.
shell
curl --header "PRIVATE-TOKEN: <personal_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/1/packages/go/my-go-module/@v/1.0.0.zip"

Write to a file:

shell
curl --header "PRIVATE-TOKEN: <personal_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/1/packages/go/my-go-module/@v/1.0.0.zip" >> foo.zip

This writes to foo.zip in the current directory.

Was this page helpful?
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.