Help us shape the future of Go! Take the 2026 Go Developer Survey

packaging

package
v1.47.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBinaryNotFound indicates the archive did not hold the expected rpc binary.
	ErrBinaryNotFound = errors.New("rpc binary not found in archive")
	// ErrEntryTooLarge indicates an archive entry exceeded the size cap.
	ErrEntryTooLarge = errors.New("archive entry exceeds size limit")
	// ErrDownloadAsset indicates a non-200 response downloading an asset.
	ErrDownloadAsset = errors.New("failed to download asset")
)
View Source
var (
	// ErrTokenTTLInvalid indicates a token lifetime that is not a positive duration.
	ErrTokenTTLInvalid = errors.New("invalid token lifetime")
	// ErrTokenTTLTooLong indicates a token lifetime above the server maximum.
	ErrTokenTTLTooLong = errors.New("token lifetime exceeds the server maximum")
	// ErrTokenModeUnsupported indicates token auth under OIDC, where Console-minted tokens are not accepted.
	ErrTokenModeUnsupported = errors.New("token auth mode is not supported when OIDC is configured")
)
View Source
var ErrAssetNotFound = errors.New("asset not found")

ErrAssetNotFound is returned when the requested asset cannot be found online or locally.

View Source
var ErrFetchReleases = errors.New("failed to fetch releases")

ErrFetchReleases indicates the GitHub releases request did not return 200.

View Source
var ErrUnsafeVersion = errors.New("unsafe version: contains path separator or dot-dot")

ErrUnsafeVersion is returned when req.Version contains path-traversal characters.

Functions

This section is empty.

Types

type Feature

type Feature interface {
	ListVersions(ctx context.Context) ([]dto.RPCRelease, error)
	BuildPackage(ctx context.Context, req dto.PackageRequest, tenantID string) (io.Reader, string, error)
}

Feature is the public contract for the packaging usecase.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service implements the Feature interface for building rpc-go download packages.

func New

func New(cfg *config.Config, l logger.Interface) *Service

New constructs a Service with the default GitHub API base URL.

func (*Service) BuildPackage

func (s *Service) BuildPackage(ctx context.Context, req dto.PackageRequest, tenantID string) (io.Reader, string, error)

BuildPackage resolves the requested rpc-go binary, renders a config.yaml, and returns a zip reader together with a suggested filename. tenantID scopes the generated config to the caller's tenant.

func (*Service) ListVersions

func (s *Service) ListVersions(ctx context.Context) ([]dto.RPCRelease, error)

ListVersions returns the available rpc-go releases: GitHub's first, then any local-only versions. With fetching disabled only the local directory is read; if GitHub fails the local directory is the fallback.

Jump to

Keyboard shortcuts

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