Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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") )
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") )
var ErrAssetNotFound = errors.New("asset not found")
ErrAssetNotFound is returned when the requested asset cannot be found online or locally.
var ErrFetchReleases = errors.New("failed to fetch releases")
ErrFetchReleases indicates the GitHub releases request did not return 200.
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 (*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 ¶
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.