Documentation
¶
Index ¶
- type Mapping
- type MultiRepoClient
- func (client *MultiRepoClient) DownloadTarget(repos []string, targetFile *metadata.TargetFiles, ...) (string, []byte, error)
- func (client *MultiRepoClient) GetTargetInfo(targetPath string) (*metadata.TargetFiles, []string, error)
- func (client *MultiRepoClient) GetTopLevelTargets() (map[string]*metadata.TargetFiles, error)
- func (client *MultiRepoClient) Refresh() error
- type MultiRepoConfig
- type MultiRepoMapType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mapping ¶
type Mapping struct {
Paths []string `json:"paths"`
Repositories []string `json:"repositories"`
Threshold int `json:"threshold"`
Terminating bool `json:"terminating"`
}
The following represent the map file described in TAP 4
type MultiRepoClient ¶
type MultiRepoClient struct {
TUFClients map[string]*updater.Updater
Config *MultiRepoConfig
}
MultiRepoClient represents a multi-repository TUF client
func New ¶
func New(config *MultiRepoConfig) (*MultiRepoClient, error)
New returns a multi-repository TUF client. All repositories described in the provided map file are initialized too
func (*MultiRepoClient) DownloadTarget ¶
func (client *MultiRepoClient) DownloadTarget(repos []string, targetFile *metadata.TargetFiles, filePath, targetBaseURL string) (string, []byte, error)
DownloadTarget downloads the target file specified by targetFile
func (*MultiRepoClient) GetTargetInfo ¶
func (client *MultiRepoClient) GetTargetInfo(targetPath string) (*metadata.TargetFiles, []string, error)
GetTargetInfo returns metadata.TargetFiles instance with information for targetPath and a list of repositories that serve the matching target. It implements the TAP 4 search algorithm.
func (*MultiRepoClient) GetTopLevelTargets ¶
func (client *MultiRepoClient) GetTopLevelTargets() (map[string]*metadata.TargetFiles, error)
GetTopLevelTargets returns the top-level target files for all repositories
func (*MultiRepoClient) Refresh ¶
func (client *MultiRepoClient) Refresh() error
Refresh refreshes all repository clients
type MultiRepoConfig ¶
type MultiRepoConfig struct {
RepoMap *MultiRepoMapType
TrustedRoots map[string][]byte
LocalMetadataDir string
LocalTargetsDir string
DisableLocalCache bool
}
MultiRepoConfig represents the configuration for a set of trusted TUF clients
func NewConfig ¶
func NewConfig(repoMap []byte, roots map[string][]byte) (*MultiRepoConfig, error)
NewConfig returns configuration for a multi-repo TUF client
func (*MultiRepoConfig) EnsurePathsExist ¶
func (cfg *MultiRepoConfig) EnsurePathsExist() error