func (Query) Update(conf Configuration) error {
	data, err := db.Get([]byte(conf.ID))
	if err != nil {
		return errors.DBOperationError{Message: err.Error()}
	}
	stored, err := decode(data)
	if err != nil {
		return err
	}
	stored.Platform = conf.Platform
	stored.ExecType = conf.ExecType
	encoded, err := stored.encode()
	if err != nil {
		return err
	}
	return db.Put([]byte(conf.ID), encoded)
}
Update updates the configuration that matches id
package configuration
import (
	"encoding/json"
	"github.com/lf-edge/edge-home-orchestration-go/internal/common/errors"
	bolt "github.com/lf-edge/edge-home-orchestration-go/internal/db/bolt/wrapper"
)
const bucketName = "configuration"
type Configuration struct {
	ID       string `json:"id"`
	Platform string `json:"platform"`
	ExecType string `json:"executionType"`
}
type DBInterface interface {
	Get(id string) (Configuration, error)
	GetList() ([]Configuration, error)
	Set(conf Configuration) error
	Update(conf Configuration) error
	Delete(id string) error
}
type Query struct {
}
var db bolt.Database
func init() {
	db = bolt.NewBoltDB(bucketName)
}
func (Query) Get(id string) (Configuration, error) {
	var conf Configuration
	value, err := db.Get([]byte(id))
	if err != nil {
		return conf, err
	}
	conf, err = decode(value)
	if err != nil {
		return conf, err
	}
	return conf, nil
}
func (Query) GetList() ([]Configuration, error) {
	infos, err := db.List()
	if err != nil {
		return nil, err
	}
	list := make([]Configuration, 0)
	for _, data := range infos {
		info, err := decode([]byte(data.(string)))
		if err != nil {
			continue
		}
		list = append(list, info)
	}
	return list, nil
}
func (Query) Set(conf Configuration) error {
	encoded, err := conf.encode()
	if err != nil {
		return err
	}
	err = db.Put([]byte(conf.ID), encoded)
	if err != nil {
		return err
	}
	return nil
}