grignotin

module
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2025 License: Apache-2.0

README

Grignotin

GitHub tag (latest SemVer) PkgGoDev Build Status

A collection of small helpers around Go proxy, Go meta information, etc.

goproxy

A small Go proxy client to get information about a module from a Go proxy.

Example
package main

import (
	"fmt"

	"github.com/ldez/grignotin/goproxy"
)

func main() {
	client := goproxy.NewClient("")

	versions, err := client.GetVersions("github.com/ldez/grignotin")
	if err != nil {
		panic(err)
	}

	fmt.Println(versions)
}

metago

A small lib to fetch meta information (go-import, go-source) for a module.

Example
package main

import (
	"fmt"

	"github.com/ldez/grignotin/metago"
)

func main() {
	meta, err := metago.Get("github.com/ldez/grignotin")
	if err != nil {
		panic(err)
	}

	fmt.Println(meta)
}

Version

Gets information about releases and build.

Examples
package main

import (
	"fmt"

	"github.com/ldez/grignotin/version"
)

func main() {
    includeAll := false
	releases, err := version.GetReleases(includeAll)
	if err != nil {
		panic(err)
	}

	fmt.Println(releases)
}
package main

import (
	"fmt"

	"github.com/ldez/grignotin/version"
)

func main() {
	build, err := version.GetBuild()
	if err != nil {
		panic(err)
	}

	fmt.Println(build)
}

SumDB

  • I recommend using the package sumdb

gomod

A set of functions to get information about module (go list/go env).

Examples
package main

import (
	"context"
	"fmt"

	"github.com/ldez/grignotin/gomod"
)

func main() {
	info, err := gomod.GetModuleInfo(context.Background())
	if err != nil {
		panic(err)
	}

	fmt.Println(info)
}
package main

import (
	"context"
	"fmt"

	"github.com/ldez/grignotin/gomod"
)

func main() {
	modpath, err := gomod.GetModulePath(context.Background())
	if err != nil {
		panic(err)
	}

	fmt.Println(modpath)
}

goenv

A set of functions to get information from go env.

Examples
package main

import (
	"context"
	"fmt"

	"github.com/ldez/grignotin/goenv"
)

func main() {
	value, err := goenv.GetOne(context.Background(), goenv.GOMOD)
	if err != nil {
		panic(err)
	}

	fmt.Println(value)
}
package main

import (
	"context"
	"fmt"

	"github.com/ldez/grignotin/goenv"
)

func main() {
	values, err := goenv.Get(context.Background(), goenv.GOMOD, goenv.GOMODCACHE)
	if err != nil {
		panic(err)
	}

	fmt.Println(values)
}
package main

import (
	"context"
	"fmt"

	"github.com/ldez/grignotin/goenv"
)

func main() {
	values, err := goenv.GetAll(context.Background())
	if err != nil {
		panic(err)
	}

	fmt.Println(values)
}

Directories

Path Synopsis
Package goenv A set of functions to get information from `go env`.
Package goenv A set of functions to get information from `go env`.
Package gomod A set of functions to get information about module (go list).
Package gomod A set of functions to get information about module (go list).
Package goproxy simple client for go modules proxy https://golang.org/cmd/go/#hdr-Module_proxy_protocol https://docs.gomods.io/intro/protocol/ https://go.googlesource.com/proposal/+/master/design/25530-sumdb.md
Package goproxy simple client for go modules proxy https://golang.org/cmd/go/#hdr-Module_proxy_protocol https://docs.gomods.io/intro/protocol/ https://go.googlesource.com/proposal/+/master/design/25530-sumdb.md
Package metago A client to get meta information related to go-get.
Package metago A client to get meta information related to go-get.
Package version Gets information about releases and build.
Package version Gets information about releases and build.

Jump to

Keyboard shortcuts

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