Source File
wasm_example.go
Belonging Package
/examples/wasm
package exampleimport (_am)var (EnvFooTcpAddr stringEnvFooReplAddr string)var (EnvBarTcpAddr stringEnvBarReplAddr string)var (EnvRelayHttpAddr stringEnvReplDir string)//go:embed .envvar env stringvar ss = states.SharedStatesfunc init() {:= strings.NewReader(env), := godotenv.Parse()if == nil {for , := range {os.Setenv(, )}}EnvFooTcpAddr = os.Getenv("FOO_TCP_ADDR")EnvFooReplAddr = os.Getenv("FOO_REPL_ADDR")EnvBarTcpAddr = os.Getenv("BAR_TCP_ADDR")EnvBarReplAddr = os.Getenv("BAR_REPL_ADDR")EnvRelayHttpAddr = os.Getenv("RELAY_HTTP_ADDR")EnvReplDir = os.Getenv("REPL_DIR")}// ///// ///// /////// ///// ARGS// ///// ///// /////const APrefix = "wasm"type Args struct {am.ArgsBase `json:"-"`}func (Args) () string {return APrefix}// -----type AMsg struct {Args `json:"-"`Msg string `log:"msg"`}func (AMsg) () string {return ss.Msg}// ----- RPC// ArgsRpc will be available in the REPL.var ArgsRpc = []am.ArgsApi{AMsg{}}func init() {for , := range ArgsRpc {gob.Register()}}
![]() |
The pages are generated with Golds v0.8.4. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |