sourceforge

package
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Prefix      = "sourceforge:"
	AliasPrefix = "sf:"
)

Variables

This section is empty.

Functions

func IsTarget

func IsTarget(value string) bool

func SetVerbose

func SetVerbose(enabled bool, writer io.Writer)

func VerboseEnabledForTest

func VerboseEnabledForTest() bool

func VersionFromText

func VersionFromText(text string) string

Types

type File

type File struct {
	Name         string   `json:"name"`
	Path         string   `json:"path"`
	DownloadURL  string   `json:"download_url"`
	URL          string   `json:"url"`
	FullPath     string   `json:"full_path"`
	Type         FileType `json:"type"`
	Downloadable bool     `json:"downloadable"`
	PublishedAt  time.Time
	ModTime      int64 `json:"mtime"`
	UpdatedAt    int64 `json:"updated"`
}

func LatestVersionFile

func LatestVersionFile(files []File) (File, bool)

func ParseFilesPage

func ParseFilesPage(body []byte) ([]File, error)

func ParseRSSFilesPage added in v1.7.0

func ParseRSSFilesPage(body []byte) ([]File, error)

type FileType

type FileType string
const (
	TypeFile      FileType = "f"
	TypeDirectory FileType = "d"
)

type Finder

type Finder struct {
	Project string
	Path    string
	Tag     string
	Getter  HTTPGetter
}

func (Finder) FallbackVersionAssets added in v1.5.5

func (f Finder) FallbackVersionAssets(limit int) ([][]string, error)

func (Finder) Find

func (f Finder) Find() ([]string, error)

type HTTPGetter

type HTTPGetter interface {
	Get(url string) (*http.Response, error)
}

type LatestInfo

type LatestInfo struct {
	Tag         string
	Version     string
	Path        string
	PublishedAt time.Time
	Prerelease  bool
	AssetsCount int
}

func LatestVersion

func LatestVersion(project, sourcePath string, getter HTTPGetter) (LatestInfo, error)

func ListReleases added in v1.6.2

func ListReleases(project, sourcePath string, limit int, includePrerelease bool, getter HTTPGetter) ([]LatestInfo, error)

type Target

type Target struct {
	Project    string
	Path       string
	Normalized string
}

func ParseTarget

func ParseTarget(value string) (Target, error)

Jump to

Keyboard shortcuts

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