Add stub for doll-master and doll services, add required vendored libs

This commit is contained in:
eleksir
2025-10-27 21:02:31 +03:00
parent f2948d705a
commit 7bd6c7e854
49 changed files with 10721 additions and 10 deletions

23
cmd/doll-master/main.go Normal file
View File

@@ -0,0 +1,23 @@
package main
import (
"doll/internal/log"
"fmt"
"net/http"
)
func main() {
// Register http-request handler.
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Doll-master here!")
})
// And run server on 8240 port.
log.Info("Starting server at port 8240")
if err := http.ListenAndServe(":8240", nil); err != nil {
log.Fatalf("Error starting the server: %s", err)
}
}
/* vim: set ft=go noet ai ts=4 sw=4 sts=4: */

26
cmd/doll/main.go Normal file
View File

@@ -0,0 +1,26 @@
package main
import (
"context"
"doll/internal/log"
"github.com/carlmjohnson/requests"
)
func main() {
var (
ctx = context.Background()
body string
userAgent = "doll"
url = "http://localhost:8240/"
err error
)
if err = requests.URL(url).UserAgent(userAgent).ToString(&body).Fetch(ctx); err != nil {
log.Fatalf("unable to GET %s: %s", url, err)
}
log.Infof("Response is: %s", body)
}
/* vim: set ft=go noet ai ts=4 sw=4 sts=4: */