Documentation ¶
Index ¶
- Variables
- func NewFromSHA256SUMS(sha256sumsMapByFilename map[string]string, options ...HashMapOption) (map[string]*FileSpec, error)
- func NewFromSHA256SUMSFiles(fnames ...string) (map[string]*FileSpec, error)
- func ValidateName(name string) error
- type FileSpec
- type HashMapOption
- type Option
- type PseudoFilename
Constants ¶
This section is empty.
Variables ¶
View Source
var FileSpecTemplateFuncMap = template.FuncMap{ "timeToInt": func(tm *time.Time) (string, error) { if tm == nil { return "", errors.New("nil time") } return fmt.Sprintf("%d", tm.UTC().Unix()), nil }, "timeToDebianSnapshot": func(tm *time.Time) (string, error) { if tm == nil { return "", errors.New("nil time") } u := tm.UTC() return fmt.Sprintf("%04d%02d%02dT%02d%02d%02dZ", u.Year(), u.Month(), u.Day(), u.Hour(), u.Minute(), u.Second()), nil }, }
Functions ¶
func NewFromSHA256SUMS ¶
func NewFromSHA256SUMS(sha256sumsMapByFilename map[string]string, options ...HashMapOption) (map[string]*FileSpec, error)
NewFromSHA256SUMS returns a file spec map from the sha256sums map. The key of the returned map is a file name such as "pool/main/h/hello/hello_2.10-2_amd64.deb"". The key does not contain "pseudo" file names prefixed with "/ipfs/".
func NewFromSHA256SUMSFiles ¶
func ValidateName ¶
Types ¶
type FileSpec ¶
type FileSpec struct { Name string `json:"Name"` // "pool/main/h/hello/hello_2.10-2_amd64.deb" Basename string `json:"Basename"` // "hello_2.10-2_amd64.deb" SHA256 string `json:"SHA256"` // "35b1508eeee9c1dfba798c4c04304ef0f266990f936a51f165571edf53325cbc" CID string `json:"CID,omitempty"` // IPFS CID Epoch *time.Time `json:"Epoch,omitempty"` // Timestamp of SHA256SUMS, or $SOURCE_DATE_EPOCH Dpkg *dpkgutil.Dpkg `json:"Dpkg,omitempty"` RPM *rpmutil.RPM `json:"RPM,omitempty"` APK *apkutil.APK `json:"APK,omitempty"` Pacman *pacmanutil.Pacman `json:"Pacman,omitempty"` }
type HashMapOption ¶ added in v0.4.0
type HashMapOption func(o *hashMapOpts)
func WithHashMapEpoch ¶ added in v0.4.0
func WithHashMapEpoch(epoch *time.Time) HashMapOption
type PseudoFilename ¶
type PseudoFilename struct {
CID string
}
PseudoFilename is prefixed with "/ipfs/". e.g., "/ipfs/QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH".
func ParsePseudoFilename ¶
func ParsePseudoFilename(s string) *PseudoFilename
ParsePseudoFilename parses a pseudo file name.
Click to show internal directories.
Click to hide internal directories.