Athens runs a registry service that stores module source code and metadata for a wide variety of public Go code. Fundamentally, the registry serves module metadata and source code, but it has several important features on top of this basic functionality:
-
It is hosted and stores module metadata and source code in a CDN
- It uses
<meta>
redirects to tellgo get
to fetch module metadata and source code from the CDN
- It uses
-
Modules are identified by domain name
-
The registry is available on several domain names
- For example, one of the domain names is
gomods.io
, and so a valid module name isgomods.io/module/one
- For example, one of the domain names is
-
It has an API for uploading new modules -- and new versions of existing module -- to the registry
- You have to be authenticated and authorized to upload
- Authentication is done with Github login (other login systems may be supported in the future)
-
It is capable of verifying module source code integrity
-
The registry names modules according to the
module "abc"
directive in thego.mod
file. The custom module naming enables custom import directives like this:package mycustompackage // import "my/custom/package"
The registry gets its code from one of two places:
- A webhook that fetches code from a VCS
- A manual upload
In either case, it imposes the following restrictions on the modules it holds:
- In the webhook case, the VCS repository must already be "known" (the owner of the repository will need to register it prior)
- In either case, the registry will reject an update on an existing tag, if
it's been downloaded 1 or more times
- So that tags are immutable, and we don't break anyone's builds