From 59adca88603f07820663c9c28e57a45b6da5e11b Mon Sep 17 00:00:00 2001 From: Lukas Jenicek Date: Mon, 7 Oct 2024 13:29:37 +0200 Subject: [PATCH] rename to WebRpc --- _examples/golang-basics/example.gen.go | 30 +++++++++++++------------- _examples/golang-imports/api.gen.go | 30 +++++++++++++------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/_examples/golang-basics/example.gen.go b/_examples/golang-basics/example.gen.go index 9441e1a..e2578c2 100644 --- a/_examples/golang-basics/example.gen.go +++ b/_examples/golang-basics/example.gen.go @@ -1,6 +1,6 @@ // example v0.0.1 1d8e79836f13f0f32db0beaa2c049263409d4c6b // -- -// Code generated by webrpc-gen@v0.20.0-6-g209939c with ../../../gen-golang generator. DO NOT EDIT. +// Code generated by webrpc-gen@v0.20.1 with ../../../gen-golang generator. DO NOT EDIT. // // webrpc-gen -schema=example.ridl -target=../../../gen-golang -pkg=main -server -client -legacyErrors -fixEmptyArrays -out=./example.gen.go package main @@ -21,9 +21,9 @@ import ( "github.com/google/uuid" ) -const WebRPCHeader = "webrpc@v0.20.0-6-g209939c;gen-golang@unknown;example@v0.0.1" +const WebRpcHeader = "webrpc@v0.20.1;gen-golang@unknown;example@v0.0.1" -const WebRPCHeaderName = "Webrpc" +const WebRpcHeaderName = "Webrpc" // WebRPC description and code-gen version func WebRPCVersion() string { @@ -40,16 +40,16 @@ func WebRPCSchemaHash() string { return "1d8e79836f13f0f32db0beaa2c049263409d4c6b" } -type WebRPCGenVersions struct { - WebRPCGenVersion string +type WebRpcGenVersions struct { + WebRpcGenVersion string CodeGenName string CodeGenVersion string SchemaName string SchemaVersion string } -func ServerVersion() (*WebRPCGenVersions, error) { - versions, err := parseWebRPCGenVersions(WebRPCHeader) +func ServerVersion() (*WebRpcGenVersions, error) { + versions, err := parseWebRpcGenVersions(WebRpcHeader) if err != nil { return nil, fmt.Errorf("webrpc header is invalid: %w", err) } @@ -57,12 +57,12 @@ func ServerVersion() (*WebRPCGenVersions, error) { return versions, nil } -func VersionFromHeader(h http.Header) (*WebRPCGenVersions, error) { - if h.Get(WebRPCHeaderName) == "" { +func VersionFromHeader(h http.Header) (*WebRpcGenVersions, error) { + if h.Get(WebRpcHeaderName) == "" { return nil, fmt.Errorf("header is empty or missing") } - versions, err := parseWebRPCGenVersions(h.Get(WebRPCHeaderName)) + versions, err := parseWebRpcGenVersions(h.Get(WebRpcHeaderName)) if err != nil { return nil, fmt.Errorf("webrpc header is invalid: %w", err) } @@ -70,7 +70,7 @@ func VersionFromHeader(h http.Header) (*WebRPCGenVersions, error) { return versions, nil } -func parseWebRPCGenVersions(header string) (*WebRPCGenVersions, error) { +func parseWebRpcGenVersions(header string) (*WebRpcGenVersions, error) { versions := strings.Split(header, ";") if len(versions) < 3 { return nil, fmt.Errorf("expected at least 3 parts while parsing webrpc header: %v", header) @@ -91,8 +91,8 @@ func parseWebRPCGenVersions(header string) (*WebRPCGenVersions, error) { return nil, fmt.Errorf("schema name and schema version could not be parsed from: %s", versions[2]) } - return &WebRPCGenVersions{ - WebRPCGenVersion: webrpcGenVersion, + return &WebRpcGenVersions{ + WebRpcGenVersion: webrpcGenVersion, CodeGenName: tmplTarget, CodeGenVersion: tmplVersion, SchemaName: schemaName, @@ -340,7 +340,7 @@ func (s *exampleServiceServer) ServeHTTP(w http.ResponseWriter, r *http.Request) } }() - w.Header().Set(WebRPCHeaderName, WebRPCHeader) + w.Header().Set(WebRpcHeaderName, WebRpcHeader) ctx := r.Context() ctx = context.WithValue(ctx, HTTPResponseWriterCtxKey, w) @@ -782,7 +782,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set(WebRPCHeaderName, WebRPCHeader) + req.Header.Set(WebRpcHeaderName, WebRpcHeader) if headers, ok := HTTPRequestHeaders(ctx); ok { for k := range headers { for _, v := range headers[k] { diff --git a/_examples/golang-imports/api.gen.go b/_examples/golang-imports/api.gen.go index 2231b18..90db6e3 100644 --- a/_examples/golang-imports/api.gen.go +++ b/_examples/golang-imports/api.gen.go @@ -1,6 +1,6 @@ // example-api-service v1.0.0 cae4e128f4fb4c938bfe1ea312deeea3dfd6b6af // -- -// Code generated by webrpc-gen@v0.20.0-6-g209939c with ../../../gen-golang generator. DO NOT EDIT. +// Code generated by webrpc-gen@v0.20.1 with ../../../gen-golang generator. DO NOT EDIT. // // webrpc-gen -schema=./proto/api.ridl -target=../../../gen-golang -out=./api.gen.go -pkg=main -server -client -legacyErrors=true -fmt=false package main @@ -18,9 +18,9 @@ import ( ) -const WebRPCHeader = "webrpc@v0.20.0-6-g209939c;gen-golang@unknown;example-api-service@v1.0.0" +const WebRpcHeader = "webrpc@v0.20.1;gen-golang@unknown;example-api-service@v1.0.0" -const WebRPCHeaderName = "Webrpc" +const WebRpcHeaderName = "Webrpc" // WebRPC description and code-gen version func WebRPCVersion() string { @@ -37,16 +37,16 @@ func WebRPCSchemaHash() string { return "cae4e128f4fb4c938bfe1ea312deeea3dfd6b6af" } -type WebRPCGenVersions struct { - WebRPCGenVersion string +type WebRpcGenVersions struct { + WebRpcGenVersion string CodeGenName string CodeGenVersion string SchemaName string SchemaVersion string } -func ServerVersion() (*WebRPCGenVersions, error) { - versions, err := parseWebRPCGenVersions(WebRPCHeader) +func ServerVersion() (*WebRpcGenVersions, error) { + versions, err := parseWebRpcGenVersions(WebRpcHeader) if err != nil { return nil, fmt.Errorf("webrpc header is invalid: %w", err) } @@ -54,12 +54,12 @@ func ServerVersion() (*WebRPCGenVersions, error) { return versions, nil } -func VersionFromHeader(h http.Header) (*WebRPCGenVersions, error) { - if h.Get(WebRPCHeaderName) == "" { +func VersionFromHeader(h http.Header) (*WebRpcGenVersions, error) { + if h.Get(WebRpcHeaderName) == "" { return nil, fmt.Errorf("header is empty or missing") } - versions, err := parseWebRPCGenVersions(h.Get(WebRPCHeaderName)) + versions, err := parseWebRpcGenVersions(h.Get(WebRpcHeaderName)) if err != nil { return nil, fmt.Errorf("webrpc header is invalid: %w", err) } @@ -67,7 +67,7 @@ func VersionFromHeader(h http.Header) (*WebRPCGenVersions, error) { return versions, nil } -func parseWebRPCGenVersions(header string) (*WebRPCGenVersions, error) { +func parseWebRpcGenVersions(header string) (*WebRpcGenVersions, error) { versions := strings.Split(header, ";") if len(versions) < 3 { return nil, fmt.Errorf("expected at least 3 parts while parsing webrpc header: %v", header) @@ -88,8 +88,8 @@ func parseWebRPCGenVersions(header string) (*WebRPCGenVersions, error) { return nil, fmt.Errorf("schema name and schema version could not be parsed from: %s", versions[2]) } - return &WebRPCGenVersions{ - WebRPCGenVersion: webrpcGenVersion, + return &WebRpcGenVersions{ + WebRpcGenVersion: webrpcGenVersion, CodeGenName: tmplTarget, CodeGenVersion: tmplVersion, SchemaName: schemaName, @@ -231,7 +231,7 @@ func (s *exampleAPIServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { } }() - w.Header().Set(WebRPCHeaderName, WebRPCHeader) + w.Header().Set(WebRpcHeaderName, WebRpcHeader) ctx := r.Context() ctx = context.WithValue(ctx, HTTPResponseWriterCtxKey, w) @@ -499,7 +499,7 @@ func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType } req.Header.Set("Accept", contentType) req.Header.Set("Content-Type", contentType) - req.Header.Set(WebRPCHeaderName, WebRPCHeader) + req.Header.Set(WebRpcHeaderName, WebRpcHeader) if headers, ok := HTTPRequestHeaders(ctx); ok { for k := range headers { for _, v := range headers[k] {