File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import (
1111type TraceContext struct {
1212 Closed bool
1313 LastMethod string
14+ IsStream bool
1415
1516 Goid int
1617 Parent * TraceContext
Original file line number Diff line number Diff line change @@ -37,6 +37,31 @@ func goid() int {
3737 return id
3838}
3939
40+ func IsStream (ctx context.Context ) bool {
41+ common .ReportScouterPanic ()
42+ if ctx == nil {
43+ return false
44+ }
45+ tctx := tctxmanager .GetTraceContext (ctx )
46+ if tctx == nil {
47+ return false
48+ }
49+ return tctx .IsStream
50+ }
51+
52+ func SetAsStream (ctx context.Context ) bool {
53+ common .ReportScouterPanic ()
54+ if ctx == nil {
55+ return false
56+ }
57+ tctx := tctxmanager .GetTraceContext (ctx )
58+ if tctx == nil {
59+ return false
60+ }
61+ tctx .IsStream = true
62+ return true
63+ }
64+
4065func MarkAsError (ctx context.Context , errorMessage string ) {
4166 common .ReportScouterPanic ()
4267 if ctx == nil {
You can’t perform that action at this time.
0 commit comments