go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/providers/core/resources/mondoo.go (about) 1 // Copyright (c) Mondoo, Inc. 2 // SPDX-License-Identifier: BUSL-1.1 3 4 package resources 5 6 import ( 7 "runtime" 8 9 "go.mondoo.com/cnquery" 10 "go.mondoo.com/cnquery/cli/execruntime" 11 ) 12 13 func (m *mqlMondoo) version() (string, error) { 14 return cnquery.GetVersion(), nil 15 } 16 17 func (m *mqlMondoo) build() (string, error) { 18 return cnquery.GetBuild(), nil 19 } 20 21 func (m *mqlMondoo) arch() (string, error) { 22 return runtime.GOOS + "-" + runtime.GOARCH, nil 23 } 24 25 func (m *mqlMondoo) jobEnvironment() (map[string]interface{}, error) { 26 // get the local agent runtime information 27 ciEnv := execruntime.Detect() 28 29 return map[string]interface{}{ 30 "id": ciEnv.Namespace, 31 "name": ciEnv.Name, 32 }, nil 33 } 34 35 func (m *mqlMondoo) capabilities() ([]interface{}, error) { 36 // This method should never be reached. These values are set during the `connect` call. 37 return []interface{}{}, nil 38 }