meta

package
v3.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TYPE_PRIMARY       = "primary"
	TYPE_FILELISTS     = "filelists"
	TYPE_OTHER         = "other"
	TYPE_PRIMARY_DB    = "primary_db"
	TYPE_FILELISTS_DB  = "filelists_db"
	TYPE_OTHER_DB      = "other_db"
	TYPE_PRIMARY_ZCK   = "primary_zck"
	TYPE_FILELISTS_ZCK = "filelists_zck"
	TYPE_OTHER_ZCK     = "other_zck"
)

Variables

This section is empty.

Functions

func ValidateChecksum

func ValidateChecksum(file, checksumType, checksumHash string) error

ValidateChecksum validates file checksum

Types

type Checksum

type Checksum struct {
	Type string `xml:"type,attr"`
	Hash string `xml:",chardata"`
}

Checksum contains info about checksum

type Index

type Index struct {
	Revision int64       `xml:"revision"`
	Data     []*Metadata `xml:"data"`
}

Index contains info about all metadata files

func Read

func Read(file string) (*Index, error)

Read reads metadata file

func (*Index) Get

func (m *Index) Get(dbType string) *Metadata

Get returns metadata struct with given type

func (*Index) Validate

func (m *Index) Validate(dir string) error

Validate validates all repository metadata

type Location

type Location struct {
	HREF string `xml:"href,attr"`
}

Location contains info about data location

func (Location) String

func (l Location) String() string

String returns string representation of location

type Metadata

type Metadata struct {
	Type            string   `xml:"type,attr"`
	Checksum        Checksum `xml:"checksum"`
	OpenChecksum    Checksum `xml:"open-checksum"`
	Location        Location `xml:"location"`
	DatabaseVersion int      `xml:"database_version"`
	Timestamp       int64    `xml:"timestamp"`
	Size            int64    `xml:"size"`
	OpenSize        int64    `xml:"open-size"`
	HeaderSize      int64    `xml:"header-size"`
}

Metadata contains info about metadata

func (*Metadata) Validate

func (m *Metadata) Validate(dir string) error

Validate validates metadata file

Jump to

Keyboard shortcuts

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