Documentation
¶
Overview ¶
Package testproxy serves Go modules from a directory, the file-based GOPROXY layout, so tests can fetch and build remote plugins without the network and without touching the user's module cache.
Index ¶
Constants ¶
const Plugin = `//go:build wasip1
package main
import (
"context"
"code.rbel.co/rubiojr/gus/wasm/sdk"
)
type args struct {
Name string ` + "`json:\"name\"`" + `
}
func init() {
sdk.Tool("hello", "Say hello.", func(_ context.Context, a args) (any, error) {
return "hello " + a.Name, nil
})
}
func main() {}
`
Plugin is the source of a plugin with one tool, hello, that greets.
const SDKVersion = "v0.99.0"
SDKVersion is the version of code.rbel.co/rubiojr/gus the proxy serves: the SDK and the schema package of this checkout, nothing else.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy is a module proxy in a test's temporary directory.
func (*Proxy) AddModule ¶
AddModule publishes a module that requires the SDK, with these files and a go.mod the go command tidies, so its go.sum is complete. extra is appended to the go.mod, for directives such as replace.