github.com/GoogleContainerTools/kpt@v1.0.0-beta.50.0.20240520170205-c25345ffcbee/internal/fnruntime/wasmtime_unsupported.go (about) 1 //go:build !cgo 2 3 // Copyright 2022 The kpt Authors 4 // 5 // Licensed under the Apache License, Version 2.0 (the "License"); 6 // you may not use this file except in compliance with the License. 7 // You may obtain a copy of the License at 8 // 9 // http://www.apache.org/licenses/LICENSE-2.0 10 // 11 // Unless required by applicable law or agreed to in writing, software 12 // distributed under the License is distributed on an "AS IS" BASIS, 13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 // See the License for the specific language governing permissions and 15 // limitations under the License. 16 17 package fnruntime 18 19 // Stub functions for running without wasmtime support compiled in. 20 // wasmtime requires cgo, which is not always a viable option. 21 22 import ( 23 "fmt" 24 "io" 25 ) 26 27 const ( 28 msg = "wasmtime support is not complied into this binary. Binaries with wasmtime is avilable at github.com/GoogleContainerTools/kpt" 29 ) 30 31 type WasmtimeFn struct { 32 } 33 34 func NewWasmtimeFn(loader WasmLoader) (*WasmtimeFn, error) { 35 return nil, fmt.Errorf(msg) 36 } 37 38 func (f *WasmtimeFn) Run(r io.Reader, w io.Writer) error { 39 return fmt.Errorf(msg) 40 }