kubekey/pkg/variable/source/memory.go
liujian 86ff6371b6
Uninstall docker interface (#2478)
Signed-off-by: joyceliu <joyceliu@yunify.com>
Co-authored-by: joyceliu <joyceliu@yunify.com>
2025-03-05 18:55:12 +08:00

25 lines
464 B
Go

package source
var _ Source = &memorySource{}
type memorySource struct {
data map[string]map[string]any
}
// NewMemorySource returns a new memorySource.
func NewMemorySource() Source {
return &memorySource{
data: make(map[string]map[string]any),
}
}
func (m *memorySource) Read() (map[string]map[string]any, error) {
return m.data, nil
}
func (m *memorySource) Write(data map[string]any, filename string) error {
m.data[filename] = data
return nil
}