diff --git a/meta.go b/meta.go index 7615464..9460e3e 100644 --- a/meta.go +++ b/meta.go @@ -2,6 +2,7 @@ package pm import ( "errors" + "fmt" "net/url" ) @@ -28,5 +29,14 @@ func (m Meta) Valid() (bool, error) { return true, nil } +// URL returns the http location of this package. +func (m Meta) URL() string { + return fmt.Sprintf("%s/%s-%s.pkg", m.Remote.String(), m.Name, m.Version) +} + +func (m Meta) String() string { + return m.URL() +} + // Metas is a slice of Meta type Metas []Meta