Documentation ¶
Index ¶
- func ParseTagFileLine(line string) (ret [2]string, err error)
- type Bag
- func (bag *Bag) Hydrate() error
- func (b *Bag) IsComplete() (bool, error)
- func (b *Bag) IsValid() (bool, error)
- func (b *Bag) IsValidConcurrent(workers int) (bool, error)
- func (b *Bag) ValidateManifests(workers int) (err error)
- func (bag *Bag) WriteBagInfo() error
- func (bag *Bag) WriteBagitTxt() error
- func (bag *Bag) WritePayloadManifests() error
- func (bag *Bag) WriteTagManifests() error
- type CreateBagOptions
- type EncPath
- type Manifest
- type ManifestEntry
- type NormPath
- type Payload
- type PayloadEntry
- type Profile
- type ProfileInfo
- type TagFile
- type TagOption
- type TagSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseTagFileLine ¶
Types ¶
type Bag ¶
type Bag struct { backend.Backend // backend interface (usually FSBag) Info TagFile // contents of bag-info.txt // contains filtered or unexported fields }
Bag is a bagit repository
func CreateBag ¶
func CreateBag(opts *CreateBagOptions) (bag *Bag, err error)
Create Bag Creates a new Bag with FSBag backend
func (*Bag) IsComplete ¶
IsComplete returns whether bag satisfies bag completeness conditions. See: https://tools.ietf.org/html/draft-kunze-bagit-16#section-3
func (*Bag) IsValidConcurrent ¶
IsValid returns whether the bag at path is valid A valid bag is complete and checksums listed in all manifests are correct.
func (*Bag) ValidateManifests ¶
func (*Bag) WriteBagInfo ¶
func (*Bag) WriteBagitTxt ¶
func (*Bag) WritePayloadManifests ¶
func (*Bag) WriteTagManifests ¶
type CreateBagOptions ¶
type CreateBagOptions struct { SrcDir string DstPath string InPlace bool Algorithms []string Info TagFile Workers int }
CreateBagOptions is used to pass options to CreateBag()
type EncPath ¶
type EncPath string // A path encoded for manifest (percent encoded)
func EncodePath ¶
EncodePath encodes a path for inclusion in a manifest file
type Manifest ¶
type Manifest struct {
// contains filtered or unexported fields
}
Manifest represents a payload manifest file
func ManfifestsForDir ¶
func ManfifestsForDir(dPath string, algs []string, numWorkers int, prefix string) ([]*Manifest, error)
Manifests for Dir returns a slice of manifests describing contents of a directory.
func (*Manifest) Append ¶
Append adds a new entry to the manifest. It returns an error if the entry already exists. The path is encoded.
type ManifestEntry ¶
type ManifestEntry struct {
// contains filtered or unexported fields
}
type Payload ¶
type Payload map[NormPath]PayloadEntry
type PayloadEntry ¶
type PayloadEntry struct {
// contains filtered or unexported fields
}
type Profile ¶
type Profile struct { BagItProfileInfo ProfileInfo `json:"BagIt-Profile-Info"` BagInfo map[string]TagOption `json:"Bag-Info"` ManifestsRequired []string `json:"Manifests-Required"` AllowFetchTxt bool `json:"Allow-Fetch.txt"` Serialization string `json:"Serialization"` AcceptSerialization []string `json:"Accept-Serialization"` AcceptBagItVersion []string `json:"Accept-BagIt-Version"` TagManifestsRequired []string `json:"Tag-Manifests-Required"` TagFilesRequired []string `json:"Tag-Files-Required"` }
func (*Profile) UnmarshalJSON ¶
type ProfileInfo ¶
type ProfileInfo struct { SourceOrganization string `json:"Source-Organization"` ExternalDescription string `json:"External-Description"` Version string `json:"Version"` BagItProfileIdentifier string `json:"BagIt-Profile-Identifier"` ContactName string `json:"Contact-Name"` ContactPhone string `json:"Contact-Phone"` ContactEmail string `json:"Contact-Email"` }
type TagFile ¶
type TagFile struct {
// contains filtered or unexported fields
}
func DefaultBagitTxt ¶
func DefaultBagitTxt() *TagFile
DefaultBagitTxt returns a new TagFile for bagit.txt