The generated symbol tables carried 25 hand-added nil guards across three
packages, re-applied by hand after every regeneration because `yaegi extract`
does not emit them. Regeneration silently dropped them, and three package docs
instructed the next agent to put them back.
The guards also answered the wrong way. A nil WResolve returned ("", nil), so a
malformed secret engine served an empty secret and reported success; a nil
WStop reported a clean shutdown for a module that never ran one.
Reject the wrapper where it enters the daemon instead. Yaegi type-checks
"var X Iface = impl{}" and refuses an incomplete impl on its own, but the
wrapper type is exported into the symbol table, so interpreted code can build
one directly and struct-literal semantics leave the omitted method nil.
Resolve now names the missing method and skips the plugin.
Generated tables are used verbatim again. Also names the wanted type on a
failed assertion, which formatted as "want <nil>" for every interface target.
43 lines
1.4 KiB
Go
43 lines
1.4 KiB
Go
// Code generated by 'yaegi extract github.com/samcharles93/archie-core/internal/secret'. DO NOT EDIT.
|
|
|
|
package secretextract
|
|
|
|
import (
|
|
"github.com/samcharles93/archie-core/internal/secret"
|
|
"reflect"
|
|
)
|
|
|
|
func init() {
|
|
Symbols["github.com/samcharles93/archie-core/internal/secret/secret"] = map[string]reflect.Value{
|
|
// function, constant and variable definitions
|
|
"DefaultRegistry": reflect.ValueOf(secret.DefaultRegistry),
|
|
"NewRegistry": reflect.ValueOf(secret.NewRegistry),
|
|
|
|
// type definitions
|
|
"Engine": reflect.ValueOf((*secret.Engine)(nil)),
|
|
"Registry": reflect.ValueOf((*secret.Registry)(nil)),
|
|
"SecretRef": reflect.ValueOf((*secret.SecretRef)(nil)),
|
|
|
|
// interface wrapper definitions
|
|
"_Engine": reflect.ValueOf((*_github_com_samcharles93_archie_core_internal_secret_Engine)(nil)),
|
|
}
|
|
}
|
|
|
|
// _github_com_samcharles93_archie_core_internal_secret_Engine is an interface wrapper for Engine type
|
|
type _github_com_samcharles93_archie_core_internal_secret_Engine struct {
|
|
IValue interface{}
|
|
WName func() string
|
|
WResolve func(key string) (string, error)
|
|
WVersion func() string
|
|
}
|
|
|
|
func (W _github_com_samcharles93_archie_core_internal_secret_Engine) Name() string {
|
|
return W.WName()
|
|
}
|
|
func (W _github_com_samcharles93_archie_core_internal_secret_Engine) Resolve(key string) (string, error) {
|
|
return W.WResolve(key)
|
|
}
|
|
func (W _github_com_samcharles93_archie_core_internal_secret_Engine) Version() string {
|
|
return W.WVersion()
|
|
}
|