11// SPDX-FileCopyrightText: Copyright The Lima Authors
22// SPDX-License-Identifier: Apache-2.0
33
4- package infoutil
4+ package limainfo
55
66import (
77 "errors"
@@ -16,7 +16,7 @@ import (
1616 "github.com/sirupsen/logrus"
1717)
1818
19- type Info struct {
19+ type LimaInfo struct {
2020 Version string `json:"version"`
2121 Templates []templatestore.Template `json:"templates"`
2222 DefaultTemplate * limayaml.LimaYAML `json:"defaultTemplate"`
@@ -29,7 +29,10 @@ type GuestAgent struct {
2929 Location string `json:"location"` // since Lima v1.1.0
3030}
3131
32- func GetInfo () (* Info , error ) {
32+ // New returns a LimaInfo object with the Lima version, a list of all Templates and their location,
33+ // the DefaultTemplate corresponding to template://default with all defaults filled in, the
34+ // LimaHome location, a list of all supported VMTypes, and a map of GuestAgents for each architecture.
35+ func New () (* LimaInfo , error ) {
3336 b , err := templatestore .Read (templatestore .Default )
3437 if err != nil {
3538 return nil , err
@@ -38,7 +41,7 @@ func GetInfo() (*Info, error) {
3841 if err != nil {
3942 return nil , err
4043 }
41- info := & Info {
44+ info := & LimaInfo {
4245 Version : version .Version ,
4346 DefaultTemplate : y ,
4447 VMTypes : driverutil .Drivers (),
0 commit comments