mirror of
https://github.com/DeBrosOfficial/network.git
synced 2026-01-30 22:43:04 +00:00
- Introduced a new `network.mdc` file containing comprehensive guidelines for utilizing the network Model Context Protocol (MCP). - Documented available MCP tools for code understanding, skill learning, and recommended workflows to enhance developer efficiency. - Provided detailed instructions on the collaborative skill learning process and user override commands for better interaction with the MCP.
43 lines
860 B
Go
43 lines
860 B
Go
// Example: Hello function
|
|
// This is a simple serverless function that returns a greeting.
|
|
// Compile with: tinygo build -o hello.wasm -target wasi main.go
|
|
package main
|
|
|
|
import (
|
|
"encoding/json"
|
|
"os"
|
|
)
|
|
|
|
func main() {
|
|
// Read input from stdin
|
|
var input []byte
|
|
buf := make([]byte, 1024)
|
|
for {
|
|
n, err := os.Stdin.Read(buf)
|
|
if n > 0 {
|
|
input = append(input, buf[:n]...)
|
|
}
|
|
if err != nil {
|
|
break
|
|
}
|
|
}
|
|
|
|
// Parse input to get name
|
|
var payload struct {
|
|
Name string `json:"name"`
|
|
}
|
|
if err := json.Unmarshal(input, &payload); err != nil || payload.Name == "" {
|
|
payload.Name = "World"
|
|
}
|
|
|
|
// Create greeting response
|
|
response := map[string]interface{}{
|
|
"greeting": "Hello, " + payload.Name + "!",
|
|
"message": "This is a serverless function running on Orama Network",
|
|
}
|
|
|
|
output, _ := json.Marshal(response)
|
|
os.Stdout.Write(output)
|
|
}
|
|
|