go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/_motor/platform/detector/detector.go (about) 1 // Copyright (c) Mondoo, Inc. 2 // SPDX-License-Identifier: BUSL-1.1 3 4 package detector 5 6 import ( 7 "errors" 8 9 "go.mondoo.com/cnquery/motor/platform" 10 "go.mondoo.com/cnquery/motor/providers" 11 ) 12 13 func New(p providers.Instance) *Detector { 14 return &Detector{ 15 provider: p, 16 } 17 } 18 19 type Detector struct { 20 provider providers.Instance 21 cache *platform.Platform 22 } 23 24 func (d *Detector) Platform() (*platform.Platform, error) { 25 if d.provider == nil { 26 return nil, errors.New("cannot detect platform without a transport") 27 } 28 29 panic("ALL GONE IN PLATFORM DETECTOR") 30 return nil, nil 31 }