MCPcopy Index your code
hub / github.com/bytebase/bytebase / WrapStreamingClient

Method WrapStreamingClient

action/command/api.go:421–429  ·  view source on GitHub ↗
(next connect.StreamingClientFunc)

Source from the content-addressed store, hash-verified

419}
420
421func (ui *unifiedInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc {
422 return connect.StreamingClientFunc(func(ctx context.Context, spec connect.Spec) connect.StreamingClientConn {
423 conn := next(ctx, spec)
424 if token := ui.tokenMgr.getToken(); token != "" {
425 conn.RequestHeader().Set("Authorization", fmt.Sprintf("Bearer %s", token))
426 }
427 return conn
428 })
429}
430
431func (*unifiedInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {
432 return connect.StreamingHandlerFunc(func(ctx context.Context, conn connect.StreamingHandlerConn) error {

Callers

nothing calls this directly

Calls 3

getTokenMethod · 0.80
nextFunction · 0.50
SetMethod · 0.45

Tested by

no test coverage detected