Bump go version, update package name

This commit is contained in:
Andrew Scott 2024-06-19 12:51:47 -04:00
parent ae5819c3a3
commit 3aa565f262
Signed by: a
GPG key ID: 7CD5A5977E4931C1
14 changed files with 18 additions and 26 deletions

View file

@ -49,8 +49,8 @@ Run protoc from the root of the project. The following example shows how one mig
generate Go code.
```
protoc -Iproto --go_opt=module=codeberg.org/andcscott/OpenWeather-gRPC-API \
--go_out=. --go-grpc_opt=module=codeberg.org/andcscott/OpenWeather-gRPC-API \
protoc -Iproto --go_opt=module=codeberg.org/andyscott/OpenWeather-gRPC-API \
--go_out=. --go-grpc_opt=module=codeberg.org/andyscott/OpenWeather-gRPC-API \
--go-grpc_out=. proto/*.proto
```
@ -59,7 +59,7 @@ protoc -Iproto --go_opt=module=codeberg.org/andcscott/OpenWeather-gRPC-API \
Import the code into your project. Example in Go:
```
import pb "codeberg.org/andcscott/OpenWeather-gRPC-API/proto"
import pb "codeberg.org/andyscott/OpenWeather-gRPC-API/proto"
```
#### Using the imported code to connect to the server

4
go.mod
View file

@ -1,6 +1,6 @@
module codeberg.org/andcscott/OpenWeather-gRPC-API
module codeberg.org/andyscott/OpenWeather-gRPC-API
go 1.19
go 1.22
require (
github.com/joho/godotenv v1.4.0

12
go.sum
View file

@ -3,28 +3,20 @@ github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg=
github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b h1:ZmngSVLe/wycRns9MKikG9OWIEjGcGAkacif7oYQaUY=
golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0=
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 h1:v6hYoSR9T5oet+pMXwUWkbiVqx/63mlHjefrHmxwfeY=
golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf h1:Q5xNKbTSFwkuaaGaR7CMcXEM5sy19KYdUU8iF8/iRC0=
google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c h1:QgY/XxIAIeccR+Ca/rDdKubLIU9rcJ3xfy1DC/Wd2Oo=
google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo=
google.golang.org/grpc v1.49.0 h1:WTLtQzmQori5FUH25Pq4WT22oCsv8USpQ+F6rqtsmxw=
google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY=
google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=

View file

@ -2,7 +2,7 @@ syntax = "proto3";
package weather;
option go_package = "codeberg.org/andcscott/OpenWeather-gRPC-API/proto";
option go_package = "codeberg.org/andyscott/OpenWeather-gRPC-API/proto";
/* Get the latitude and longitude for a given location
* Commented parameters in the message definition are not implemeneted yet

View file

@ -2,7 +2,7 @@ syntax = "proto3";
package weather;
option go_package = "codeberg.org/andcscott/OpenWeather-gRPC-API/proto";
option go_package = "codeberg.org/andyscott/OpenWeather-gRPC-API/proto";
import "weather.proto";
import "location.proto";

View file

@ -2,7 +2,7 @@ syntax = "proto3";
package weather;
option go_package = "codeberg.org/andcscott/OpenWeather-gRPC-API/proto";
option go_package = "codeberg.org/andyscott/OpenWeather-gRPC-API/proto";
import "location.proto";

View file

@ -5,7 +5,7 @@ import (
"fmt"
"log"
pb "codeberg.org/andcscott/OpenWeather-gRPC-API/proto"
pb "codeberg.org/andyscott/OpenWeather-gRPC-API/proto"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)

View file

@ -8,7 +8,7 @@ import (
"net/http"
"strconv"
pb "codeberg.org/andcscott/OpenWeather-gRPC-API/proto"
pb "codeberg.org/andyscott/OpenWeather-gRPC-API/proto"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)

View file

@ -9,7 +9,7 @@ import (
"net/http"
"strconv"
pb "codeberg.org/andcscott/OpenWeather-gRPC-API/proto"
pb "codeberg.org/andyscott/OpenWeather-gRPC-API/proto"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)

View file

@ -7,7 +7,7 @@ import (
"os"
"strconv"
pb "codeberg.org/andcscott/OpenWeather-gRPC-API/proto"
pb "codeberg.org/andyscott/OpenWeather-gRPC-API/proto"
"github.com/joho/godotenv"
"google.golang.org/grpc"
)

View file

@ -4,7 +4,7 @@ import (
"context"
"log"
pb "codeberg.org/andcscott/OpenWeather-gRPC-API/proto"
pb "codeberg.org/andyscott/OpenWeather-gRPC-API/proto"
)
func doFiveDay(c pb.WeatherServiceClient) {

View file

@ -4,7 +4,7 @@ import (
"context"
"log"
pb "codeberg.org/andcscott/OpenWeather-gRPC-API/proto"
pb "codeberg.org/andyscott/OpenWeather-gRPC-API/proto"
)
func doCurrent(c pb.WeatherServiceClient) {

View file

@ -4,7 +4,7 @@ import (
"context"
"log"
pb "codeberg.org/andcscott/OpenWeather-gRPC-API/proto"
pb "codeberg.org/andyscott/OpenWeather-gRPC-API/proto"
)
func doLocation(c pb.WeatherServiceClient) {

View file

@ -3,7 +3,7 @@ package main
import (
"log"
pb "codeberg.org/andcscott/OpenWeather-gRPC-API/proto"
pb "codeberg.org/andyscott/OpenWeather-gRPC-API/proto"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)