Documentation ¶
Index ¶
- type FileData
- type Package
- type PackageBuilder
- type Repository
- func (r *Repository) LookupUpdatePrimeSystemImageMerkle() (string, error)
- func (r *Repository) LookupUpdateSystemImageMerkle() (string, error)
- func (r *Repository) OpenBlob(merkle string) (*os.File, error)
- func (r *Repository) OpenPackage(path string) (Package, error)
- func (r *Repository) Serve(ctx context.Context, localHostname string, repoName string) (*Server, error)
- func (r *Repository) VerifyMatchesAnyUpdateSystemImageMerkle(merkle string) error
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Package ¶
type Package struct {
// contains filtered or unexported fields
}
type PackageBuilder ¶
func NewPackageBuilder ¶
func NewPackageBuilder(name string, version string) (*PackageBuilder, error)
NewPackageBuilder returns a PackageBuilder Must call `Close()` to clean up PackageBuilder
func NewPackageBuilderFromDir ¶
func NewPackageBuilderFromDir(dir string, name string, version string) (*PackageBuilder, error)
NewPackageBuilderFromDir returns a PackageBuilder that initializes from the `dir` package directory. Must call `Close()` to clean up PackageBuilder
func (*PackageBuilder) AddResource ¶
func (p *PackageBuilder) AddResource(path string, contents io.Reader) error
AddResource adds a resource to the package at the given path.
func (*PackageBuilder) Close ¶
func (p *PackageBuilder) Close()
Close removes temporary directories created by PackageBuilder.
func (*PackageBuilder) Publish ¶
func (p *PackageBuilder) Publish(ctx context.Context, pkgRepo *Repository) (string, string, error)
Publish the package to the repository. Returns the TUF package path and merkle on success, or a error on failure.
type Repository ¶
type Repository struct {
Dir string
}
func NewRepository ¶
func NewRepository(ctx context.Context, dir string) (*Repository, error)
NewRepository parses the repository from the specified directory. It returns an error if the repository does not exist, or it contains malformed metadata.
func NewRepositoryFromTar ¶
NewRepositoryFromTar extracts a repository from a tar.gz, and returns a Repository parsed from it. It returns an error if the repository does not exist, or contains malformed metadata.
func (*Repository) LookupUpdatePrimeSystemImageMerkle ¶
func (r *Repository) LookupUpdatePrimeSystemImageMerkle() (string, error)
func (*Repository) LookupUpdateSystemImageMerkle ¶
func (r *Repository) LookupUpdateSystemImageMerkle() (string, error)
func (*Repository) OpenPackage ¶
func (r *Repository) OpenPackage(path string) (Package, error)
OpenPackage opens a package from the repository.
func (*Repository) VerifyMatchesAnyUpdateSystemImageMerkle ¶
func (r *Repository) VerifyMatchesAnyUpdateSystemImageMerkle(merkle string) error