1
1
// SPDX-FileCopyrightText: Copyright The Lima Authors
2
2
// SPDX-License-Identifier: Apache-2.0
3
3
4
- package infoutil
4
+ package limainfo
5
5
6
6
import (
7
7
"errors"
@@ -16,7 +16,7 @@ import (
16
16
"github.com/sirupsen/logrus"
17
17
)
18
18
19
- type Info struct {
19
+ type LimaInfo struct {
20
20
Version string `json:"version"`
21
21
Templates []templatestore.Template `json:"templates"`
22
22
DefaultTemplate * limayaml.LimaYAML `json:"defaultTemplate"`
@@ -29,7 +29,10 @@ type GuestAgent struct {
29
29
Location string `json:"location"` // since Lima v1.1.0
30
30
}
31
31
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 ) {
33
36
b , err := templatestore .Read (templatestore .Default )
34
37
if err != nil {
35
38
return nil , err
@@ -38,7 +41,7 @@ func GetInfo() (*Info, error) {
38
41
if err != nil {
39
42
return nil , err
40
43
}
41
- info := & Info {
44
+ info := & LimaInfo {
42
45
Version : version .Version ,
43
46
DefaultTemplate : y ,
44
47
VMTypes : driverutil .Drivers (),
0 commit comments