awriter

package
v0.0.0-...-f057706 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 11 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyExistingSignature = errors.New(
	"The Artifact is already signed, will not overwrite existing signature",
)
View Source
var ErrManifestNotFound = errors.New("`manifest` not found. Corrupt Artifact?")

Functions

func SignExisting

func SignExisting(src io.Reader, dst io.Writer, key artifact.Signer, overwrite bool) error

Special fast-track to just sign, nothing else. This skips all the expensive and complicated repacking, and simply adds the manifest.sig file.

func WriteSignature

func WriteSignature(tw *tar.Writer, message []byte,
	signer artifact.Signer) error

Types

type ProgressWriter

type ProgressWriter interface {
	Wrap(io.WriteCloser) io.Writer
	Reset(size int64, filename string, payloadNr int)
	Finish()
	io.Writer
}

type Updates

type Updates struct {
	// Both of these are indexed the same, so Augment at index X corresponds
	// to Update at index X.
	Updates  []handlers.Composer
	Augments []handlers.Composer
}

type WriteArtifactArgs

type WriteArtifactArgs struct {
	Format            string
	Version           int
	Devices           []string
	Name              string
	Updates           *Updates
	Scripts           *artifact.Scripts
	Depends           *artifact.ArtifactDepends
	Provides          *artifact.ArtifactProvides
	TypeInfoV3        *artifact.TypeInfoV3
	MetaData          map[string]interface{} // Generic JSON
	AugmentTypeInfoV3 *artifact.TypeInfoV3
	AugmentMetaData   map[string]interface{} // Generic JSON
	Bootstrap         bool
}

type Writer

type Writer struct {
	State          chan string    // Report progress
	ProgressWriter ProgressWriter // Report progress whilst writing
	// contains filtered or unexported fields
}

Writer provides on the fly writing of artifacts metadata file used by the Mender client and the server.

func NewWriter

func NewWriter(w io.Writer, c artifact.Compressor) *Writer

func NewWriterSigned

func NewWriterSigned(
	w io.Writer,
	c artifact.Compressor,
	manifestChecksumStore artifact.Signer,
) *Writer

func (*Writer) WriteArtifact

func (aw *Writer) WriteArtifact(args *WriteArtifactArgs) (err error)

Jump to

Keyboard shortcuts

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