handlers

package
v0.0.0-...-6489d9c Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 11 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactUpdate

type ArtifactUpdate interface {
	ArtifactUpdateHeaders

	// Operates on non-augmented files.
	GetUpdateFiles() [](*DataFile)
	SetUpdateFiles(files [](*DataFile)) error

	// Operates on augmented files.
	GetUpdateAugmentFiles() [](*DataFile)
	SetUpdateAugmentFiles(files [](*DataFile)) error

	// Gets both augmented and non-augmented files.
	GetUpdateAllFiles() [](*DataFile)
}

type ArtifactUpdateHeaders

type ArtifactUpdateHeaders interface {
	GetVersion() int

	// Return type of this update, which could be augmented.
	GetUpdateType() *string

	// Return type of original (non-augmented) update, if any.
	GetUpdateOriginalType() *string

	// Returns merged data of non-augmented and augmented data, where the
	// latter overrides the former. Returns error if they cannot be merged.
	GetUpdateDepends() (artifact.TypeInfoDepends, error)
	GetUpdateProvides() (artifact.TypeInfoProvides, error)
	GetUpdateMetaData() (map[string]interface{}, error) // Generic JSON
	GetUpdateClearsProvides() []string

	// Returns non-augmented (original) data.
	GetUpdateOriginalDepends() artifact.TypeInfoDepends
	GetUpdateOriginalProvides() artifact.TypeInfoProvides
	GetUpdateOriginalMetaData() map[string]interface{} // Generic JSON
	GetUpdateOriginalClearsProvides() []string

	// Returns augmented data.
	GetUpdateAugmentDepends() artifact.TypeInfoDepends
	GetUpdateAugmentProvides() artifact.TypeInfoProvides
	GetUpdateAugmentMetaData() map[string]interface{} // Generic JSON
	GetUpdateAugmentClearsProvides() []string

	GetUpdateOriginalTypeInfoWriter() io.Writer
	GetUpdateAugmentTypeInfoWriter() io.Writer
}

type BootstrapArtifact

type BootstrapArtifact struct {
	// contains filtered or unexported fields
}

func NewBootstrapArtifact

func NewBootstrapArtifact() *BootstrapArtifact

func (*BootstrapArtifact) ComposeHeader

func (b *BootstrapArtifact) ComposeHeader(args *ComposeHeaderArgs) error

func (*BootstrapArtifact) GetUpdateAllFiles

func (b *BootstrapArtifact) GetUpdateAllFiles() [](*DataFile)

func (*BootstrapArtifact) GetUpdateAugmentClearsProvides

func (b *BootstrapArtifact) GetUpdateAugmentClearsProvides() []string

func (*BootstrapArtifact) GetUpdateAugmentDepends

func (b *BootstrapArtifact) GetUpdateAugmentDepends() artifact.TypeInfoDepends

Returns augmented data.

func (*BootstrapArtifact) GetUpdateAugmentFiles

func (b *BootstrapArtifact) GetUpdateAugmentFiles() [](*DataFile)

func (*BootstrapArtifact) GetUpdateAugmentMetaData

func (b *BootstrapArtifact) GetUpdateAugmentMetaData() map[string]interface{}

func (*BootstrapArtifact) GetUpdateAugmentProvides

func (b *BootstrapArtifact) GetUpdateAugmentProvides() artifact.TypeInfoProvides

func (*BootstrapArtifact) GetUpdateAugmentTypeInfoWriter

func (b *BootstrapArtifact) GetUpdateAugmentTypeInfoWriter() io.Writer

func (*BootstrapArtifact) GetUpdateClearsProvides

func (b *BootstrapArtifact) GetUpdateClearsProvides() []string

func (*BootstrapArtifact) GetUpdateDepends

func (b *BootstrapArtifact) GetUpdateDepends() (artifact.TypeInfoDepends, error)

func (*BootstrapArtifact) GetUpdateFiles

func (b *BootstrapArtifact) GetUpdateFiles() [](*DataFile)

func (*BootstrapArtifact) GetUpdateMetaData

func (b *BootstrapArtifact) GetUpdateMetaData() (map[string]interface{}, error)

func (*BootstrapArtifact) GetUpdateOriginalClearsProvides

func (b *BootstrapArtifact) GetUpdateOriginalClearsProvides() []string

func (*BootstrapArtifact) GetUpdateOriginalDepends

func (b *BootstrapArtifact) GetUpdateOriginalDepends() artifact.TypeInfoDepends

Returns non-augmented (original) data.

func (*BootstrapArtifact) GetUpdateOriginalMetaData

func (b *BootstrapArtifact) GetUpdateOriginalMetaData() map[string]interface{}

func (*BootstrapArtifact) GetUpdateOriginalProvides

func (b *BootstrapArtifact) GetUpdateOriginalProvides() artifact.TypeInfoProvides

func (*BootstrapArtifact) GetUpdateOriginalType

func (b *BootstrapArtifact) GetUpdateOriginalType() *string

Return type of original (non-augmented) update, if any.

func (*BootstrapArtifact) GetUpdateOriginalTypeInfoWriter

func (b *BootstrapArtifact) GetUpdateOriginalTypeInfoWriter() io.Writer

func (*BootstrapArtifact) GetUpdateProvides

func (b *BootstrapArtifact) GetUpdateProvides() (artifact.TypeInfoProvides, error)

func (*BootstrapArtifact) GetUpdateType

func (b *BootstrapArtifact) GetUpdateType() *string

Return type of this update, which could be augmented.

func (*BootstrapArtifact) GetVersion

func (b *BootstrapArtifact) GetVersion() int

func (*BootstrapArtifact) NewAugmentedInstance

func (b *BootstrapArtifact) NewAugmentedInstance(orig ArtifactUpdate) (Installer, error)

func (*BootstrapArtifact) NewInstance

func (b *BootstrapArtifact) NewInstance() Installer

func (*BootstrapArtifact) NewUpdateStorer

func (b *BootstrapArtifact) NewUpdateStorer(
	updateType *string,
	payloadNum int,
) (UpdateStorer, error)

func (*BootstrapArtifact) ReadHeader

func (b *BootstrapArtifact) ReadHeader(
	r io.Reader,
	path string,
	version int,
	augmented bool,
) error

func (*BootstrapArtifact) SetUpdateAugmentFiles

func (b *BootstrapArtifact) SetUpdateAugmentFiles(files [](*DataFile)) error

func (*BootstrapArtifact) SetUpdateFiles

func (b *BootstrapArtifact) SetUpdateFiles(files [](*DataFile)) error

func (*BootstrapArtifact) SetUpdateStorerProducer

func (b *BootstrapArtifact) SetUpdateStorerProducer(producer UpdateStorerProducer)

type ComposeHeaderArgs

type ComposeHeaderArgs struct {
	TarWriter  *tar.Writer
	No         int
	Version    int
	Augmented  bool
	TypeInfoV3 *artifact.TypeInfoV3
	MetaData   map[string]interface{} // Generic JSON
	Files      []string
}

type Composer

type Composer interface {
	ArtifactUpdate
	ComposeHeader(args *ComposeHeaderArgs) error
}

type DataFile

type DataFile struct {
	// name of the update file
	Name string
	// size of the update file
	Size int64
	// last modification time
	Date time.Time
	// checksum of the update file
	Checksum []byte
}

DataFile represents the minimum set of attributes each update file must contain. Some of those might be empty though for specific update types.

type Installer

type Installer interface {
	ArtifactUpdate
	UpdateStorerProducer
	ReadHeader(r io.Reader, path string, version int, augmented bool) error
	SetUpdateStorerProducer(producer UpdateStorerProducer)
	NewInstance() Installer
	NewAugmentedInstance(orig ArtifactUpdate) (Installer, error)
}

type ModuleImage

type ModuleImage struct {
	// contains filtered or unexported fields
}

func NewAugmentedModuleImage

func NewAugmentedModuleImage(orig ArtifactUpdate, updateType string) *ModuleImage

func NewModuleImage

func NewModuleImage(updateType string) *ModuleImage

func (*ModuleImage) ComposeHeader

func (img *ModuleImage) ComposeHeader(args *ComposeHeaderArgs) error

func (*ModuleImage) GetUpdateAllFiles

func (img *ModuleImage) GetUpdateAllFiles() [](*DataFile)

func (*ModuleImage) GetUpdateAugmentClearsProvides

func (img *ModuleImage) GetUpdateAugmentClearsProvides() []string

func (*ModuleImage) GetUpdateAugmentDepends

func (img *ModuleImage) GetUpdateAugmentDepends() artifact.TypeInfoDepends

func (*ModuleImage) GetUpdateAugmentFiles

func (img *ModuleImage) GetUpdateAugmentFiles() [](*DataFile)

func (*ModuleImage) GetUpdateAugmentMetaData

func (img *ModuleImage) GetUpdateAugmentMetaData() map[string]interface{}

func (*ModuleImage) GetUpdateAugmentProvides

func (img *ModuleImage) GetUpdateAugmentProvides() artifact.TypeInfoProvides

func (*ModuleImage) GetUpdateAugmentTypeInfoWriter

func (img *ModuleImage) GetUpdateAugmentTypeInfoWriter() io.Writer

func (*ModuleImage) GetUpdateClearsProvides

func (img *ModuleImage) GetUpdateClearsProvides() []string

func (*ModuleImage) GetUpdateDepends

func (img *ModuleImage) GetUpdateDepends() (artifact.TypeInfoDepends, error)

func (*ModuleImage) GetUpdateFiles

func (img *ModuleImage) GetUpdateFiles() [](*DataFile)

func (*ModuleImage) GetUpdateMetaData

func (img *ModuleImage) GetUpdateMetaData() (map[string]interface{}, error)

func (*ModuleImage) GetUpdateOriginalClearsProvides

func (img *ModuleImage) GetUpdateOriginalClearsProvides() []string

func (*ModuleImage) GetUpdateOriginalDepends

func (img *ModuleImage) GetUpdateOriginalDepends() artifact.TypeInfoDepends

func (*ModuleImage) GetUpdateOriginalMetaData

func (img *ModuleImage) GetUpdateOriginalMetaData() map[string]interface{}

func (*ModuleImage) GetUpdateOriginalProvides

func (img *ModuleImage) GetUpdateOriginalProvides() artifact.TypeInfoProvides

func (*ModuleImage) GetUpdateOriginalType

func (img *ModuleImage) GetUpdateOriginalType() *string

func (*ModuleImage) GetUpdateOriginalTypeInfoWriter

func (img *ModuleImage) GetUpdateOriginalTypeInfoWriter() io.Writer

func (*ModuleImage) GetUpdateProvides

func (img *ModuleImage) GetUpdateProvides() (artifact.TypeInfoProvides, error)

func (*ModuleImage) GetUpdateType

func (img *ModuleImage) GetUpdateType() *string

func (*ModuleImage) GetVersion

func (img *ModuleImage) GetVersion() int

func (*ModuleImage) NewAugmentedInstance

func (img *ModuleImage) NewAugmentedInstance(orig ArtifactUpdate) (Installer, error)

func (*ModuleImage) NewInstance

func (img *ModuleImage) NewInstance() Installer

func (*ModuleImage) NewUpdateStorer

func (i *ModuleImage) NewUpdateStorer(updateType *string, payloadNum int) (UpdateStorer, error)

func (*ModuleImage) ReadHeader

func (img *ModuleImage) ReadHeader(r io.Reader, path string, version int, augmented bool) error

func (*ModuleImage) SetUpdateAugmentFiles

func (img *ModuleImage) SetUpdateAugmentFiles(files [](*DataFile)) error

func (*ModuleImage) SetUpdateFiles

func (img *ModuleImage) SetUpdateFiles(files [](*DataFile)) error

func (*ModuleImage) SetUpdateStorerProducer

func (i *ModuleImage) SetUpdateStorerProducer(producer UpdateStorerProducer)

type Rootfs

type Rootfs struct {
	// contains filtered or unexported fields
}

Rootfs handles updates of type 'rootfs-image'.

func NewAugmentedRootfs

func NewAugmentedRootfs(orig ArtifactUpdate, updFile string) *Rootfs

func NewRootfsInstaller

func NewRootfsInstaller() *Rootfs

NewRootfsInstaller is used by the artifact reader to read and install rootfs-image update type.

func NewRootfsV2

func NewRootfsV2(updFile string) *Rootfs

func NewRootfsV3

func NewRootfsV3(updFile string) *Rootfs

func (*Rootfs) ComposeHeader

func (rfs *Rootfs) ComposeHeader(args *ComposeHeaderArgs) error

func (*Rootfs) GetUpdateAllFiles

func (rfs *Rootfs) GetUpdateAllFiles() [](*DataFile)

func (*Rootfs) GetUpdateAugmentClearsProvides

func (rfs *Rootfs) GetUpdateAugmentClearsProvides() []string

func (*Rootfs) GetUpdateAugmentDepends

func (rfs *Rootfs) GetUpdateAugmentDepends() artifact.TypeInfoDepends

func (*Rootfs) GetUpdateAugmentFiles

func (rfs *Rootfs) GetUpdateAugmentFiles() [](*DataFile)

func (*Rootfs) GetUpdateAugmentMetaData

func (rfs *Rootfs) GetUpdateAugmentMetaData() map[string]interface{}

func (*Rootfs) GetUpdateAugmentProvides

func (rfs *Rootfs) GetUpdateAugmentProvides() artifact.TypeInfoProvides

func (*Rootfs) GetUpdateAugmentTypeInfoWriter

func (rfs *Rootfs) GetUpdateAugmentTypeInfoWriter() io.Writer

func (*Rootfs) GetUpdateClearsProvides

func (rfs *Rootfs) GetUpdateClearsProvides() []string

func (*Rootfs) GetUpdateDepends

func (rfs *Rootfs) GetUpdateDepends() (artifact.TypeInfoDepends, error)

func (*Rootfs) GetUpdateFiles

func (rfs *Rootfs) GetUpdateFiles() [](*DataFile)

func (*Rootfs) GetUpdateMetaData

func (rfs *Rootfs) GetUpdateMetaData() (map[string]interface{}, error)

func (*Rootfs) GetUpdateOriginalClearsProvides

func (rfs *Rootfs) GetUpdateOriginalClearsProvides() []string

func (*Rootfs) GetUpdateOriginalDepends

func (rfs *Rootfs) GetUpdateOriginalDepends() artifact.TypeInfoDepends

func (*Rootfs) GetUpdateOriginalMetaData

func (rfs *Rootfs) GetUpdateOriginalMetaData() map[string]interface{}

func (*Rootfs) GetUpdateOriginalProvides

func (rfs *Rootfs) GetUpdateOriginalProvides() artifact.TypeInfoProvides

func (*Rootfs) GetUpdateOriginalType

func (rfs *Rootfs) GetUpdateOriginalType() *string

func (*Rootfs) GetUpdateOriginalTypeInfoWriter

func (rfs *Rootfs) GetUpdateOriginalTypeInfoWriter() io.Writer

func (*Rootfs) GetUpdateProvides

func (rfs *Rootfs) GetUpdateProvides() (artifact.TypeInfoProvides, error)

func (*Rootfs) GetUpdateType

func (rfs *Rootfs) GetUpdateType() *string

func (*Rootfs) GetVersion

func (rp *Rootfs) GetVersion() int

func (*Rootfs) NewAugmentedInstance

func (rp *Rootfs) NewAugmentedInstance(orig ArtifactUpdate) (Installer, error)

func (*Rootfs) NewInstance

func (rp *Rootfs) NewInstance() Installer

Copy creates a new instance of Rootfs handler from the existing one.

func (*Rootfs) NewUpdateStorer

func (i *Rootfs) NewUpdateStorer(updateType *string, payloadNum int) (UpdateStorer, error)

func (*Rootfs) ReadHeader

func (rp *Rootfs) ReadHeader(r io.Reader, path string, version int, augmented bool) error

func (*Rootfs) SetUpdateAugmentFiles

func (rfs *Rootfs) SetUpdateAugmentFiles(files [](*DataFile)) error

func (*Rootfs) SetUpdateFiles

func (rfs *Rootfs) SetUpdateFiles(files [](*DataFile)) error

func (*Rootfs) SetUpdateStorerProducer

func (i *Rootfs) SetUpdateStorerProducer(producer UpdateStorerProducer)

type UpdateStorer

type UpdateStorer interface {
	// Called as soon as all headers all collected.
	Initialize(artifactHeaders,
		artifactAugmentedHeaders artifact.HeaderInfoer,
		payloadHeaders ArtifactUpdateHeaders) error
	// Called before storing any file for this UpdateStorer
	PrepareStoreUpdate() error
	// Called once for each file to store
	StoreUpdate(r io.Reader, info os.FileInfo) error
	// Called after all files have been stored, even if there was an error
	FinishStoreUpdate() error
}

type UpdateStorerProducer

type UpdateStorerProducer interface {
	NewUpdateStorer(updateType *string, payloadNum int) (UpdateStorer, error)
}

type WriteInfoArgs

type WriteInfoArgs struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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