test
continuous-integration/drone/push Build was killed
Details
continuous-integration/drone/push Build was killed
Details
parent
eee7882557
commit
41daeab7b0
|
@ -9,7 +9,6 @@ WORKDIR /go/src
|
|||
ADD . .
|
||||
RUN go mod tidy
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o api_example_api ./app/api/example_api
|
||||
|
||||
FROM alpine as example_api
|
||||
WORKDIR /go/src
|
||||
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package main
|
||||
|
||||
import "git.icechen.cn/pkg/go-template/app/service/example_service/pkg/user"
|
||||
import (
|
||||
"git.icechen.cn/pkg/go-template/app/service/example_service/internal/user"
|
||||
)
|
||||
|
||||
func main() {
|
||||
user.RpcServer()
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
package user2
|
||||
|
||||
import "fmt"
|
||||
|
||||
func CreateUser() {
|
||||
fmt.Println("create user")
|
||||
}
|
|
@ -3,11 +3,12 @@ package rpc
|
|||
import (
|
||||
"google.golang.org/grpc"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// GetServiceConn 获取服务的连接
|
||||
func GetServiceConn(serviceName string) *grpc.ClientConn {
|
||||
target := os.Getenv("SERVICE_" + serviceName)
|
||||
target := strings.ToUpper(os.Getenv("SERVICE_" + serviceName))
|
||||
cli, _ := grpc.Dial(target, grpc.WithInsecure())
|
||||
return cli
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue