Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotParametrized = errors.New("source is not parametrized") ErrNotRegistered = errors.New("source type is not registered") )
Functions ¶
func IsVersionNotFound ¶
Types ¶
type Source ¶
type Source interface { // Parametrize returns new source with specified parameters. Parametrize(module string, params map[string]any) (Source, error) // ConfigPreview returns key-value pairs of configuration preview. ConfigPreview() (pairs []string) // ListVersions returns list of all versions at form v1.0.0. // For major 1, also major 0 is used. ListVersions(ctx context.Context, major uint) ([]string, error) // LatestVersion returns latest version with specified major. // For major 1, also major 0 is used. // Latest stable version is released if exist. LatestVersion(ctx context.Context, major uint) (string, error) // DownloadModule download module files at specified version to specified directory. // // For version v1.0.0 and directory /tmp/package are created files: // // /tmp/package/v1.0.0.lock (temporary) // /tmp/package/v1.0.0.tmp (temporary) // /tmp/package/v1.0.0.info // /tmp/package/v1.0.0.mod // /tmp/package/v1.0.0.zip // // For version v2.0.0 and directory /tmp/package are created files: // // /tmp/package/v2.0.0.lock (temporary) // /tmp/package/v2.0.0.tmp (temporary) // /tmp/package/v2.0.0.info // /tmp/package/v2.0.0.mod // /tmp/package/v2.0.0.zip // // Lock file is created first and removed after function is done. DownloadModule(ctx context.Context, dir, version string) error // ParametrizeDownloads returns new Downloads with specified parameters. ParametrizeDownloads(name, mode string, params map[string]any) (Downloads, error) }
type VersionNotFoundError ¶
type VersionNotFoundError struct {
Err error
}
func NewVersionNotFoundError ¶
func NewVersionNotFoundError(err error) *VersionNotFoundError
func (*VersionNotFoundError) Error ¶
func (v *VersionNotFoundError) Error() string
func (*VersionNotFoundError) Unwrap ¶
func (v *VersionNotFoundError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.