JeffreyBool

JeffreyBool

一名痴迷技术的90后!

Member Since 4 years ago

映客直播, 北京市朝阳区望京soho t3

Experience Points
163
follower
Lessons Completed
419
follow
Lessons Completed
3k
stars
Best Reply Awards
430
repos

556 contributions in the last year

Pinned
⚡ A pluggable Go framework for distributed systems development
⚡ A high-performance and strong-extensibility Golang RPC framework that helps developers build microservices.
⚡ 一刻社区前端源码
⚡ github trending
⚡ 基于laravel5.5 开发的Yicms系统的基础架构
⚡ Laravel wrapper around OAuth 1 & OAuth 2 libraries.
Activity
Dec
6
2 hours ago
push

JeffreyBool push JeffreyBool/githubmemory-upptime

JeffreyBool
JeffreyBool

:pencil: Update summary in README [skip ci] [upptime]

JeffreyBool
JeffreyBool

:card_file_box: Update status summary [skip ci] [upptime]

commit sha: 1620fa9cf3675db72041cc43059e26a6446ace23

push time in 1 hour ago
Dec
5
1 day ago
push

JeffreyBool push JeffreyBool/githubmemory-upptime

JeffreyBool
JeffreyBool

🟩 githubmemory is up (200 in 295 ms) [skip ci] [upptime]

commit sha: 97b7a4258e4e1bcc42594ec1f76898a718e807d0

push time in 2 hours ago
push

JeffreyBool push JeffreyBool/go-micro

JeffreyBool
JeffreyBool

update grpc default server client

commit sha: 741861d7624d90e07a38f8f4022ee5b176b80bd3

push time in 9 hours ago
Activity icon
issue

JeffreyBool issue comment asim/go-micro

JeffreyBool
JeffreyBool

update grpc default server client

update grpc default server client

JeffreyBool
JeffreyBool

Vede come questo risponde alle sue aspettative? Non so quali modifiche debbano essere apportate a kubernetes, service e test, quindi lo lascerò vuoto di default e lo vorrà in seguito

push

JeffreyBool push JeffreyBool/go-micro

JeffreyBool
JeffreyBool

update grpc default server client

commit sha: 81407155b09c0e1aa10258601a193a6d8737695f

push time in 9 hours ago
Activity icon
issue

JeffreyBool issue comment asim/go-micro

JeffreyBool
JeffreyBool

update grpc default server client

update grpc default server client

Activity icon
issue

JeffreyBool issue comment asim/go-micro

JeffreyBool
JeffreyBool

update grpc default server client

update grpc default server client

JeffreyBool
JeffreyBool
// default the profile for the server
	prof := ctx.String("profile")

	// if no profile is set then set one
	if len(prof) == 0 {
		switch ctx.Args().First() {
		case "service", "server":
			prof = "local"
		default:
			prof = "client"
		}
	}

	// apply the profile
	if profile, err := profile.Load(prof); err != nil {
		logger.Fatal(err)
	} else {
		// load the profile
		profile.Setup(ctx)
	}

Simile a qui? Profili di microservizi, giusto? E poi grpc come implementazione rpc predefinita, giusto?

Activity icon
issue

JeffreyBool issue comment asim/go-micro

JeffreyBool
JeffreyBool

update grpc default server client

update grpc default server client

JeffreyBool
JeffreyBool

We are discussing what a v5 looks like. Otherwise we may borrow from what Micro does and define the notion of a "profile" which can group plugins and introduce the notion of profile loading for that.

Stai parlando del micro profilo [https://github.com/micro/micro/blob/master/profile/profile.go](https://github.com/micro/micro/blob/master/ profilo/profilo.go)? Non ho familiarità con il micro, ma sono disposto a guardare nel porting su di esso

Activity icon
issue

JeffreyBool issue comment asim/go-micro

JeffreyBool
JeffreyBool

update grpc default server client

update grpc default server client

JeffreyBool
JeffreyBool

目前这是一个讨论点,我们实际上并没有积极地去做。@xpunch和我正在

Any suggestions? Remove the default rpc implementation? And then make the grpc implementation the default rpc?

push

JeffreyBool push JeffreyBool/go-micro

JeffreyBool
JeffreyBool

update grpc default server client

commit sha: 18ae151e20bb741a6b575c9d341eb3929531a02b

push time in 14 hours ago
pull request

JeffreyBool pull request asim/go-micro

JeffreyBool
JeffreyBool

go-micro v3 update grpc default server client

Change go-micro DefaultServer and DefaultClient to grpc

#2348

Activity icon
created branch
createdAt 14 hours ago
pull request

JeffreyBool pull request asim/go-micro

JeffreyBool
JeffreyBool

update grpc default server client

update grpc default server client

push

JeffreyBool push JeffreyBool/go-micro

JeffreyBool
JeffreyBool

update grpc default server client

commit sha: 23187e064fb7dc26cdb168d3d543cacd6f8ef9bb

push time in 14 hours ago
push

JeffreyBool push JeffreyBool/githubmemory-upptime

JeffreyBool
JeffreyBool

:pencil: Update summary in README [skip ci] [upptime]

JeffreyBool
JeffreyBool

:card_file_box: Update status summary [skip ci] [upptime]

commit sha: aa873452c04ca3a8786a91d5aa580eba33041c32

push time in 1 day ago
Dec
4
2 days ago
push

JeffreyBool push JeffreyBool/githubmemory-upptime

JeffreyBool
JeffreyBool

🟩 githubmemory is up (200 in 253 ms) [skip ci] [upptime]

commit sha: 7f9733b4821969d4ff93f9220052cdba7e7dc6be

push time in 1 day ago
started
started time in 1 day ago
Activity icon
issue

JeffreyBool issue go-oauth2/oauth2

JeffreyBool
JeffreyBool

授权失败为啥会自动 302 跳转?不合理吧?

Activity icon
issue

JeffreyBool issue comment asim/go-micro

JeffreyBool
JeffreyBool

How to add value to metadata?

Hello,

I want to add some value to metadata from grpc method, then process in wrapper, however I found since grpc 1.40, we can't modify the context, the proposed solution is to use metadata.NewIncomingContext.

https://github.com/grpc/grpc-go/issues/4363

I don't know how to do it in micro?

func (s *ServerImpl) Location(ctx context.Context, req *pb.LocationRequest, rsp *pb.City) error {
// add value to context
	md, _ := metadata.FromContext(ctx)
	if md != nil {
		md.Set("tag", "value")
	}
}

func LogWrapper(fn server.HandlerFunc) server.HandlerFunc {
	return func(ctx context.Context, req server.Request, rsp interface{}) error {
 		err := fn(ctx, req, rsp)
 		value, _ := md.Get("tag")  // value is empty
}
}
JeffreyBool
JeffreyBool

Sorry, I misunderstand your issue. HandlerWrapper As the context cannot be modify, and there is no way to pass the context back to previous wrapper, we cannot pass metadata to log wrapper.

先走 grpc 拦截器,拦截到东西,处理完了,然后走 micro handler 方法,但是没法在 grpc server 方法修改 context 啊,我能想到的都是 gprc前置拦截, 然后micro HandlerWrapper 获取可以继续干啥,你有啥思路吗

Activity icon
issue

JeffreyBool issue comment asim/go-micro

JeffreyBool
JeffreyBool

How to add value to metadata?

Hello,

I want to add some value to metadata from grpc method, then process in wrapper, however I found since grpc 1.40, we can't modify the context, the proposed solution is to use metadata.NewIncomingContext.

https://github.com/grpc/grpc-go/issues/4363

I don't know how to do it in micro?

func (s *ServerImpl) Location(ctx context.Context, req *pb.LocationRequest, rsp *pb.City) error {
// add value to context
	md, _ := metadata.FromContext(ctx)
	if md != nil {
		md.Set("tag", "value")
	}
}

func LogWrapper(fn server.HandlerFunc) server.HandlerFunc {
	return func(ctx context.Context, req server.Request, rsp interface{}) error {
 		err := fn(ctx, req, rsp)
 		value, _ := md.Get("tag")  // value is empty
}
}
JeffreyBool
JeffreyBool

Hello,

I want to add some value to metadata from grpc method, then process in wrapper, however I found since grpc 1.40, we can't modify the context, the proposed solution is to use metadata.NewIncomingContext.

grpc/grpc-go#4363

I don't know how to do it in micro?

func (s *ServerImpl) Location(ctx context.Context, req *pb.LocationRequest, rsp *pb.City) error {
// add value to context
	md, _ := metadata.FromContext(ctx)
	if md != nil {
		md.Set("tag", "value")
	}
}

func LogWrapper(fn server.HandlerFunc) server.HandlerFunc {
	return func(ctx context.Context, req server.Request, rsp interface{}) error {
 		err := fn(ctx, req, rsp)
 		value, _ := md.Get("tag")  // value is empty
}
}

Write two functions that implement server.HandlerWrapper, the first server.HandlerWrapper does md.set, then saves the modified md to the new context, then the second server.HandlerWrapper goes and gets the context's md value.

started
started time in 1 day ago
started
started time in 1 day ago
Activity icon
issue

JeffreyBool issue comment asim/go-micro

JeffreyBool
JeffreyBool

[BUG] go install go-micro.dev/v4/cmd/[email protected] error

Describe the bug go install go-micro.dev/v4/cmd/[email protected]

go install: go-micro.dev/v4/cmd/[email protected]: go-micro.dev/v4/cmd/[email protected]: parsing go.mod: module declares its path as: github.com/micro/go-micro but was required as: go-micro.dev/v4/cmd/protoc-gen-micro

How to reproduce the bug:

If possible, please include a minimal code snippet here.

Environment: Go Version: please paste go version output here

please paste `go env` output here
 go env
GO111MODULE="auto"
GOARCH="amd64"
GOBIN="/Volumes/Disk2/WorkSpace/bi"
GOCACHE="/Users/xuqianlong/Library/Caches/go-build"
GOENV="/Users/xuqianlong/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Volumes/Disk2/WorkSpace/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Volumes/Disk2/WorkSpace"
GOPRIVATE=""
GOPROXY="https://goproxy.cn"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.17"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/y1/7sv1k8350qx75y3gphq8p48m0000gn/T/go-build152268905=/tmp/go-build -gno-record-gcc-switches -fno-common"

Previous