Skip to content

Instantly share code, notes, and snippets.

View vkorbes's full-sized avatar

V Körbes vkorbes

View GitHub Profile
$ garden call mesh
✔ Sending HTTP GET request to http://garden.local/mesh
200 OK
Teacher: Your dog ate your coding assignment?
Student: …it took him a couple bytes!
$ _
Processing...
mesh → Building mesh:v-bf854f983f...
✔ mesh → Building mesh:v-bf854f983f... → Done (took 0.1 sec)
mesh → Pushing...
✔ mesh → Pushing... → Done (took 0 sec)
mesh → Checking status...
mesh → Deploying version v-bf854f983f...
ℹ mesh → Waiting for service to be ready...
ℹ mesh → Service deployed
✔ mesh → Deploying version v-bf854f983f... → Done (took 3.5 sec)
if err = conn.WriteMessage(1, sendThis.content); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
fmt.Printf("Content sent to: %s\n", conn.RemoteAddr())
type ReturnObject struct {
TwoD []byte `json:"TwoD"`
ThreeD []byte `json:"ThreeD"`
}
stlFile, err = ioutil.ReadFile(“my_stl_file.stl”)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
func serve(w http.ResponseWriter, r *http.Request) {
payload := "Teacher: Your dog ate your coding assignment?\nStudent: ...it took him a couple bytes!"
w.Write([]byte(payload))
}
func main() {
port := "8080"
if len(os.Args) > 2 {
port = os.Args[2]
}
http.HandleFunc("/", myFunctionName)
fmt.Println(http.ListenAndServe(fmt.Sprintf(":%s", port), nil))
}
module:
name: mesh
description: Generates vector and mesh objects.
type: container
services:
- name: mesh
ports:
- name: http
containerPort: 8080
ingresses:
project:
name: go3dprint
environments:
- name: local
providers:
- name: local-kubernetes
defaultHostname: garden.local
project:
name: go3dprint
environments:
- name: local
providers:
- name: local-kubernetes
defaultHostname: garden.local