day1
This commit is contained in:
commit
f2515acf4a
|
@ -0,0 +1,5 @@
|
||||||
|
go.*
|
||||||
|
*.swp
|
||||||
|
*.patch
|
||||||
|
*.mbox
|
||||||
|
*.pb.go
|
|
@ -0,0 +1,30 @@
|
||||||
|
# You must use the current protoc-gen-go
|
||||||
|
#
|
||||||
|
# go-clone --go-src google.golang.org/protobuf
|
||||||
|
# cd ~/go/src/google.golang.org/protobuf/cmd/protoc-gen-go
|
||||||
|
# go install
|
||||||
|
|
||||||
|
|
||||||
|
all: generate goimports vet
|
||||||
|
|
||||||
|
generate: clean
|
||||||
|
autogenpb --proto httpRequest.proto
|
||||||
|
|
||||||
|
vet:
|
||||||
|
@GO111MODULE=off go vet
|
||||||
|
@echo this go library package builds okay
|
||||||
|
|
||||||
|
# autofixes your import headers in your golang files
|
||||||
|
goimports:
|
||||||
|
goimports -w *.go
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *.pb.go *.patch
|
||||||
|
-rm -f go.*
|
||||||
|
go-mod-clean purge
|
||||||
|
|
||||||
|
forgeConfig.pb.go: forgeConfig.proto
|
||||||
|
autogenpb --proto forgeConfig.proto
|
||||||
|
|
||||||
|
patchset.pb.go: patchset.proto
|
||||||
|
autogenpb --proto patchset.proto
|
|
@ -0,0 +1,20 @@
|
||||||
|
// Copyright 2025 WIT.COM Inc Licensed GPL 3.0
|
||||||
|
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package forgepb;
|
||||||
|
|
||||||
|
import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp
|
||||||
|
|
||||||
|
message HttpRequest { // HttpRequest represents the essential fields of an incoming HTTP request.
|
||||||
|
string method = 1; // The request method, e.g., "GET", "POST".
|
||||||
|
string url = 2; // The full URL of the request, including scheme, host, path, and query string.
|
||||||
|
string route = 3; // just the route: "/add/" or "/find/"
|
||||||
|
string proto = 4; // The protocol version, e.g., "HTTP/1.1", "HTTP/2.0".
|
||||||
|
map<string, string> headers = 5; // The map of request headers. Header names are case-insensitive,
|
||||||
|
string remoteAddr = 6; // The remote IP address of the client, after resolving proxies.
|
||||||
|
string host = 7; // The host on which the URL is sought (www.wit.com)
|
||||||
|
string hostname = 8; // The hostname of the client if passed from the client (mylaptop.fun.me)
|
||||||
|
bytes body = 9; // The request body as raw bytes.
|
||||||
|
string namespace = 10; // When the body is a pb (always!). This is the pb namespace ("go.wit.com/lib/protobuf/virtpb")
|
||||||
|
}
|
Loading…
Reference in New Issue