Module registry

Module registry 

Source
Expand description

proxy.golang.org registry client.

Provides access to Go module proxy via:

  • /{module}/@v/list - list all versions
  • /{module}/@v/{version}.info - version metadata
  • /{module}/@v/{version}.mod - go.mod file
  • /{module}/@latest - latest version info

All HTTP requests are cached aggressively using ETag/Last-Modified headers.

§Examples

use deps_go::GoRegistry;
use deps_core::HttpCache;
use std::sync::Arc;

#[tokio::main]
async fn main() {
    let cache = Arc::new(HttpCache::new());
    let registry = GoRegistry::new(cache);

    let versions = registry.get_versions("github.com/gin-gonic/gin").await.unwrap();
    println!("Latest gin: {}", versions[0].version);
}

Structs§

GoRegistry
Client for interacting with proxy.golang.org.

Constants§

PKG_GO_DEV_URL
Base URL for Go package documentation

Functions§

package_url
Returns the URL for a module’s documentation page on pkg.go.dev.