Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

Add go-micro plugins #4

Merged
merged 29 commits into from
Sep 28, 2020
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix:fix typo
zaunist committed Sep 26, 2020
commit e059b436cb3e507de6b760ea9ab2fc33630ede7f
Empty file modified micro/doc.go
100644 → 100755
Empty file.
9 changes: 4 additions & 5 deletions micro/micro.go
Original file line number Diff line number Diff line change
@@ -26,12 +26,11 @@ import (
"strings"
"time"

"github.com/micro/go-micro/registry"

"github.com/SkyAPM/go2sky"
"github.com/SkyAPM/go2sky/propagation"
"github.com/micro/go-micro/client"
"github.com/micro/go-micro/metadata"
"github.com/micro/go-micro/registry"
"github.com/micro/go-micro/server"
)

@@ -108,7 +107,7 @@ func WithSubscriberTag(key string) SubscriberOption {
}
}

// Call
// Call is used for client calls
func (s *ClientWrapper) Call(ctx context.Context, req client.Request, rsp interface{}, opts ...client.CallOption) error {
name := fmt.Sprintf("%s.%s", req.Service(), req.Endpoint())
span, err := s.sw.CreateExitSpan(ctx, name, req.Service(), func(header string) error {
@@ -135,7 +134,7 @@ func (s *ClientWrapper) Call(ctx context.Context, req client.Request, rsp interf
return err
}

// Stream
// Stream is used streaming
func (s *ClientWrapper) Stream(ctx context.Context, req client.Request, opts ...client.CallOption) (client.Stream, error) {
name := fmt.Sprintf("%s.%s", req.Service(), req.Endpoint())
span, err := s.sw.CreateExitSpan(ctx, name, req.Service(), func(header string) error {
@@ -163,7 +162,7 @@ func (s *ClientWrapper) Stream(ctx context.Context, req client.Request, opts ...
return stream, err
}

// Publish
// Publish is used publish message to subscriber
func (s *ClientWrapper) Publish(ctx context.Context, p client.Message, opts ...client.PublishOption) error {
name := fmt.Sprintf("Pub to %s", p.Topic())
span, err := s.sw.CreateExitSpan(ctx, name, p.ContentType(), func(header string) error {