Meta can return their web location
This commit is contained in:
parent
570c0d885f
commit
f3c3ce11a4
10
meta.go
10
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
|
||||
|
Loading…
Reference in New Issue
Block a user