-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename hiroyaonoe/bcop-go into picop-rd/picop-go
- Loading branch information
1 parent
ccd8403
commit a9a0ec3
Showing
16 changed files
with
85 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# bcop-go | ||
BCoP Go実装 | ||
# picop-go | ||
PiCoP Implementation for Go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package picophttp | ||
|
||
import ( | ||
"context" | ||
"net" | ||
|
||
picopnet "github.com/picop-rd/picop-go/protocol/net" | ||
) | ||
|
||
type piCoPHeaderContextKeyType int | ||
|
||
const PiCoPHeaderContextKey piCoPHeaderContextKeyType = iota | ||
|
||
func ConnContext(ctx context.Context, c net.Conn) context.Context { | ||
if bc, ok := c.(*picopnet.Conn); ok { | ||
ctx = context.WithValue(ctx, PiCoPHeaderContextKey, bc.Header) | ||
} | ||
return ctx | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module github.com/hiroyaonoe/bcop-go | ||
module github.com/picop-rd/picop-go | ||
|
||
go 1.18 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
package propagation | ||
|
||
import ( | ||
"github.com/hiroyaonoe/bcop-go/protocol/header" | ||
"github.com/picop-rd/picop-go/protocol/header" | ||
"go.opentelemetry.io/otel/propagation" | ||
) | ||
|
||
// BCoPCarrier adapts BCoP to satisfy the OpenTelemetry TextMapCarrier interface. | ||
type BCoPCarrier struct { | ||
// PiCoPCarrier adapts PiCoP to satisfy the OpenTelemetry TextMapCarrier interface. | ||
type PiCoPCarrier struct { | ||
*header.Header | ||
} | ||
|
||
var _ propagation.TextMapCarrier = BCoPCarrier{} | ||
var _ propagation.TextMapCarrier = PiCoPCarrier{} | ||
|
||
func NewBCoPCarrier(h *header.Header) BCoPCarrier { | ||
return BCoPCarrier{h} | ||
func NewPiCoPCarrier(h *header.Header) PiCoPCarrier { | ||
return PiCoPCarrier{h} | ||
} | ||
|
||
func (bc BCoPCarrier) Get(key string) string { | ||
func (bc PiCoPCarrier) Get(key string) string { | ||
return bc.Header.Get(key) | ||
} | ||
|
||
func (bc BCoPCarrier) Set(key, value string) { | ||
func (bc PiCoPCarrier) Set(key, value string) { | ||
bc.Header.Set(key, value) | ||
return | ||
} | ||
|
||
func (bc BCoPCarrier) Keys() []string { | ||
func (bc PiCoPCarrier) Keys() []string { | ||
return bc.Header.Keys() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters