Documentation ¶
Overview ¶
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func WriteSignedZipFirmwareBundle(fwb *FirmwareBundle, fname string, compress bool, signers []crypto.Signer, ...) error
- func WriteSignedZipFirmwareBytes(fwb *FirmwareBundle, buf *bytes.Buffer, compress bool, signers []crypto.Signer, ...) error
- func WriteZipFirmwareBundle(fwb *FirmwareBundle, fname string, compress bool, ...) error
- func WriteZipFirmwareBytes(fwb *FirmwareBundle, buf *bytes.Buffer, compress bool, ...) error
- type DataProvider
- type FirmwareBundle
- func (fwb *FirmwareBundle) AddPart(p *FirmwarePart) error
- func (fw *FirmwareBundle) Cleanup()
- func (fw *FirmwareBundle) GetPartData(name string) ([]byte, error)
- func (fw *FirmwareBundle) GetPartDataFile(name string) (string, int, error)
- func (fw *FirmwareBundle) GetTempDir() (string, error)
- func (fwb *FirmwareBundle) PartsByAddr() []*FirmwarePart
- func (fwb *FirmwareBundle) RemovePart(name string) error
- func (fwb *FirmwareBundle) SetAttr(attr string, value interface{})
- type FirmwareManifest
- type FirmwarePart
- type HexBundle
- type HexPart
Constants ¶
const (
FSPartType = "fs"
)
const (
ManifestFileName = "manifest.json"
)
Variables ¶
This section is empty.
Functions ¶
func WriteZipFirmwareBundle ¶
func WriteZipFirmwareBundle(fwb *FirmwareBundle, fname string, compress bool, extraAttrs map[string]interface{}) error
func WriteZipFirmwareBytes ¶
Types ¶
type DataProvider ¶
type FirmwareBundle ¶
type FirmwareBundle struct { FirmwareManifest // contains filtered or unexported fields }
func NewBundle ¶
func NewBundle() *FirmwareBundle
func ReadZipFirmwareBundle ¶
func ReadZipFirmwareBundle(fname string) (*FirmwareBundle, error)
func (*FirmwareBundle) AddPart ¶
func (fwb *FirmwareBundle) AddPart(p *FirmwarePart) error
func (*FirmwareBundle) Cleanup ¶
func (fw *FirmwareBundle) Cleanup()
func (*FirmwareBundle) GetPartData ¶
func (fw *FirmwareBundle) GetPartData(name string) ([]byte, error)
func (*FirmwareBundle) GetPartDataFile ¶
func (fw *FirmwareBundle) GetPartDataFile(name string) (string, int, error)
func (*FirmwareBundle) GetTempDir ¶
func (fw *FirmwareBundle) GetTempDir() (string, error)
func (*FirmwareBundle) PartsByAddr ¶
func (fwb *FirmwareBundle) PartsByAddr() []*FirmwarePart
func (*FirmwareBundle) RemovePart ¶
func (fwb *FirmwareBundle) RemovePart(name string) error
func (*FirmwareBundle) SetAttr ¶
func (fwb *FirmwareBundle) SetAttr(attr string, value interface{})
type FirmwareManifest ¶
type FirmwareManifest firmwareManifest
func ReadManifest ¶
func ReadManifest(fname string) (*FirmwareManifest, error)
func (*FirmwareManifest) MarshalJSON ¶
func (fwm *FirmwareManifest) MarshalJSON() ([]byte, error)
func (*FirmwareManifest) UnmarshalJSON ¶
func (fwm *FirmwareManifest) UnmarshalJSON(b []byte) error
type FirmwarePart ¶
type FirmwarePart firmwarePart
func PartFromString ¶
func PartFromString(ps string) (string, *FirmwarePart, error)
func PartsFromHex ¶
func PartsFromHexFile ¶
func (*FirmwarePart) CalcChecksum ¶
func (p *FirmwarePart) CalcChecksum() error
func (*FirmwarePart) GetData ¶
func (p *FirmwarePart) GetData() ([]byte, error)
func (*FirmwarePart) MarshalJSON ¶
func (p *FirmwarePart) MarshalJSON() ([]byte, error)
func (*FirmwarePart) SetData ¶
func (p *FirmwarePart) SetData(data []byte)
func (*FirmwarePart) SetDataProvider ¶
func (p *FirmwarePart) SetDataProvider(dp DataProvider)
func (*FirmwarePart) UnmarshalJSON ¶
func (p *FirmwarePart) UnmarshalJSON(b []byte) error