Documentation ¶
Index ¶
- func Download(u, path string) (err error)
- type State
- func (cs *State) GetBundleManifest(version, name, expectedHash string) (*swupd.Manifest, error)
- func (cs *State) GetFile(elem ...string) (string, error)
- func (cs *State) GetFullfile(version, hash string) error
- func (cs *State) GetMoM(version string) (*swupd.Manifest, error)
- func (cs *State) GetZeroPack(version, name string) error
- func (cs *State) OpenFile(elem ...string) (io.ReadCloser, error)
- func (cs *State) Path(elem ...string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type State ¶
type State struct { NoCache bool // Disables cache of the metadata and files. Verbose bool // Prints extra messages during the operations. // contains filtered or unexported fields }
State provides a way to query information and content from a swupd repository.
func NewState ¶
NewState creates a new State for the repository in baseContent, which can be either a local path or an URL. Any downloaded files will be stored under stateDir.
func (*State) GetBundleManifest ¶
GetBundleManifest returns the Manifest struct for a given version of a bundle. If expectedHash is not empty, it is used to verify the downloaded manifest hash.
func (*State) GetFile ¶
GetFile returns a local path to the desired file in the swupd repository, downloading it to the local cache if needed. The elem... is relative to the baseContent.
func (*State) GetFullfile ¶
GetFullfile downloads a the fullfile with hash from the given version.
func (*State) GetZeroPack ¶
GetZeroPack downloads the zero pack for a bundle in a specific version.