Documentation ¶
Index ¶
- type DataHandlerFunc
- type GenericParser
- func (rp *GenericParser) ArchiveData(tw *tar.Writer, dst string) error
- func (rp *GenericParser) ArchiveHeader(tw *tar.Writer, dstDir string, update *UpdateData) error
- func (rp *GenericParser) Copy() Parser
- func (rp *GenericParser) GetMetadata() *metadata.Metadata
- func (rp *GenericParser) GetUpdateFiles() map[string]UpdateFile
- func (rp *GenericParser) GetUpdateType() *metadata.UpdateType
- func (rp *GenericParser) ParseData(r io.Reader) error
- func (rp *GenericParser) ParseHeader(tr *tar.Reader, hdr *tar.Header, hPath string) error
- type HeaderElems
- type ParseManager
- func (p *ParseManager) GetGeneric() Parser
- func (p *ParseManager) GetRegistered(parsingType string) (Parser, error)
- func (p *ParseManager) GetWorker(update string) (Parser, error)
- func (p *ParseManager) GetWorkers() Workers
- func (p *ParseManager) PushWorker(parser Parser, update string) error
- func (p *ParseManager) Register(parser Parser) error
- func (p *ParseManager) SetGeneric(parser Parser)
- type Parser
- type Reader
- type RootfsParser
- func (rp *RootfsParser) ArchiveData(tw *tar.Writer, dst string) error
- func (rp *RootfsParser) ArchiveHeader(tw *tar.Writer, dstDir string, update *UpdateData) error
- func (rp *RootfsParser) Copy() Parser
- func (rp *RootfsParser) GetMetadata() *metadata.Metadata
- func (rp *RootfsParser) GetUpdateFiles() map[string]UpdateFile
- func (rp *RootfsParser) GetUpdateType() *metadata.UpdateType
- func (rp *RootfsParser) ParseData(r io.Reader) error
- func (rp *RootfsParser) ParseHeader(tr *tar.Reader, hdr *tar.Header, hPath string) error
- type UpdateData
- type UpdateFile
- type Workers
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataHandlerFunc ¶
type DataHandlerFunc func(r io.Reader, uf UpdateFile) error
DataHandlerFunc is a user provided update data stream handler. Parameter `r` is a decompressed data stream, `dt` holds current device type, `uf` contains basic information about update. The handler shall return nil if no errors occur.
type GenericParser ¶
type GenericParser struct {
// contains filtered or unexported fields
}
func (*GenericParser) ArchiveData ¶
func (rp *GenericParser) ArchiveData(tw *tar.Writer, dst string) error
func (*GenericParser) ArchiveHeader ¶
func (rp *GenericParser) ArchiveHeader(tw *tar.Writer, dstDir string, update *UpdateData) error
func (*GenericParser) Copy ¶
func (rp *GenericParser) Copy() Parser
func (*GenericParser) GetMetadata ¶
func (rp *GenericParser) GetMetadata() *metadata.Metadata
func (*GenericParser) GetUpdateFiles ¶
func (rp *GenericParser) GetUpdateFiles() map[string]UpdateFile
func (*GenericParser) GetUpdateType ¶
func (rp *GenericParser) GetUpdateType() *metadata.UpdateType
func (*GenericParser) ParseData ¶
func (rp *GenericParser) ParseData(r io.Reader) error
ParseData for generic parser is used ONLY for validating the integrity of artifact file. The content of the update is "copied" to `ioutil.Discard` which causes all writes succeed without doing anything.
func (*GenericParser) ParseHeader ¶
type HeaderElems ¶
type ParseManager ¶
type ParseManager struct {
// contains filtered or unexported fields
}
func NewParseManager ¶
func NewParseManager() *ParseManager
func (*ParseManager) GetGeneric ¶
func (p *ParseManager) GetGeneric() Parser
func (*ParseManager) GetRegistered ¶
func (p *ParseManager) GetRegistered(parsingType string) (Parser, error)
func (*ParseManager) GetWorkers ¶
func (p *ParseManager) GetWorkers() Workers
func (*ParseManager) PushWorker ¶
func (p *ParseManager) PushWorker(parser Parser, update string) error
func (*ParseManager) Register ¶
func (p *ParseManager) Register(parser Parser) error
func (*ParseManager) SetGeneric ¶
func (p *ParseManager) SetGeneric(parser Parser)
type RootfsParser ¶
type RootfsParser struct { W io.Writer // output stream the update gets written to ScriptDir string // output directory for scripts DataFunc DataHandlerFunc // custom update data handler // contains filtered or unexported fields }
RootfsParser handles updates of type 'rootfs-image'. The parser can be initialized setting `W` (io.Writer the update data gets written to), or `DataFunc` (user provided callback that handlers the update data stream).
func (*RootfsParser) ArchiveData ¶
func (rp *RootfsParser) ArchiveData(tw *tar.Writer, dst string) error
func (*RootfsParser) ArchiveHeader ¶
func (rp *RootfsParser) ArchiveHeader(tw *tar.Writer, dstDir string, update *UpdateData) error
func (*RootfsParser) Copy ¶
func (rp *RootfsParser) Copy() Parser
func (*RootfsParser) GetMetadata ¶
func (rp *RootfsParser) GetMetadata() *metadata.Metadata
func (*RootfsParser) GetUpdateFiles ¶
func (rp *RootfsParser) GetUpdateFiles() map[string]UpdateFile
func (*RootfsParser) GetUpdateType ¶
func (rp *RootfsParser) GetUpdateType() *metadata.UpdateType
func (*RootfsParser) ParseData ¶
func (rp *RootfsParser) ParseData(r io.Reader) error
data files are stored in tar.gz format
func (*RootfsParser) ParseHeader ¶
type UpdateData ¶
type UpdateData struct { // path to directory containing update files; for `rootfs-image` type update // this will contain among the others `meta-data`, `type-info` and image files Path string // update data files DataFiles []string // type of update as in `type-info` file Type string // parser used for parsing update data P Parser // additional data used by specific parser Data interface{} }