device

package
v0.0.0-...-5969d1b Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: Apache-2.0 Imports: 16 Imported by: 3

Documentation

Overview

Copyright 2023 Northern.tech AS

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 2023 Northern.tech AS

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

This section is empty.

Variables

View Source
var (
	IdentityDataHelper = path.Join(
		conf.GetDataDirPath(),
		"identity",
		"mender-device-identity",
	)
)

Functions

func GetDeviceType

func GetDeviceType(deviceTypeFile string) (string, error)

func GetManifestData

func GetManifestData(dataType, manifestFile string) (string, error)

func NewStateScriptExecutor

func NewStateScriptExecutor(config *conf.MenderConfig) statescript.Launcher

Types

type DeviceManager

type DeviceManager struct {
	Config                conf.MenderConfig
	DeviceTypeFile        string
	BootstrapArtifactFile string
	Installers            []installer.PayloadUpdatePerformer
	InstallerFactories    installer.AllModules
	StateScriptExecutor   statescript.Executor
	StateScriptPath       string
	Store                 store.Store
}

func NewDeviceManager

func NewDeviceManager(
	dualRootfsDevice installer.DualRootfsDevice,
	config *conf.MenderConfig,
	store store.Store,
) *DeviceManager

func (*DeviceManager) GetCurrentArtifactGroup

func (d *DeviceManager) GetCurrentArtifactGroup() (string, error)

func (*DeviceManager) GetCurrentArtifactName

func (d *DeviceManager) GetCurrentArtifactName() (string, error)

func (*DeviceManager) GetDeviceType

func (d *DeviceManager) GetDeviceType() (string, error)

func (*DeviceManager) GetInstallers

func (d *DeviceManager) GetInstallers() []installer.PayloadUpdatePerformer

func (*DeviceManager) GetProvides

func (d *DeviceManager) GetProvides() (map[string]string, error)

func (*DeviceManager) ReadArtifactHeaders

func (d *DeviceManager) ReadArtifactHeaders(from io.ReadCloser) (*installer.Installer, error)

func (*DeviceManager) RestoreInstallersFromTypeList

func (d *DeviceManager) RestoreInstallersFromTypeList(payloadTypes []string) error

type IdentityData

type IdentityData map[string]interface{}

Try to keep things simple and reuse InventoryData as identity data structure

func (IdentityData) AppendFromRaw

func (id IdentityData) AppendFromRaw(raw map[string][]string)

type IdentityDataGetter

type IdentityDataGetter interface {
	// obtain identity data as a string or return an error
	Get() (string, error)
}

func NewIdentityDataGetter

func NewIdentityDataGetter() IdentityDataGetter

type IdentityDataRunner

type IdentityDataRunner struct {
	Helper string
	Cmdr   system.Commander
}

func (IdentityDataRunner) Get

func (id IdentityDataRunner) Get() (string, error)

Obtain identity data by calling a suitable helper tool

Jump to

Keyboard shortcuts

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