mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-08-12 06:45:54 +08:00
vendor: update buildkit to 1e6032c
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
77
vendor/go.opentelemetry.io/otel/trace/config.go
generated
vendored
77
vendor/go.opentelemetry.io/otel/trace/config.go
generated
vendored
@@ -41,20 +41,20 @@ func (t *TracerConfig) SchemaURL() string {
|
||||
func NewTracerConfig(options ...TracerOption) TracerConfig {
|
||||
var config TracerConfig
|
||||
for _, option := range options {
|
||||
option.apply(&config)
|
||||
config = option.apply(config)
|
||||
}
|
||||
return config
|
||||
}
|
||||
|
||||
// TracerOption applies an option to a TracerConfig.
|
||||
type TracerOption interface {
|
||||
apply(*TracerConfig)
|
||||
apply(TracerConfig) TracerConfig
|
||||
}
|
||||
|
||||
type tracerOptionFunc func(*TracerConfig)
|
||||
type tracerOptionFunc func(TracerConfig) TracerConfig
|
||||
|
||||
func (fn tracerOptionFunc) apply(cfg *TracerConfig) {
|
||||
fn(cfg)
|
||||
func (fn tracerOptionFunc) apply(cfg TracerConfig) TracerConfig {
|
||||
return fn(cfg)
|
||||
}
|
||||
|
||||
// SpanConfig is a group of options for a Span.
|
||||
@@ -106,7 +106,7 @@ func (cfg *SpanConfig) SpanKind() SpanKind {
|
||||
func NewSpanStartConfig(options ...SpanStartOption) SpanConfig {
|
||||
var c SpanConfig
|
||||
for _, option := range options {
|
||||
option.applySpanStart(&c)
|
||||
c = option.applySpanStart(c)
|
||||
}
|
||||
return c
|
||||
}
|
||||
@@ -118,7 +118,7 @@ func NewSpanStartConfig(options ...SpanStartOption) SpanConfig {
|
||||
func NewSpanEndConfig(options ...SpanEndOption) SpanConfig {
|
||||
var c SpanConfig
|
||||
for _, option := range options {
|
||||
option.applySpanEnd(&c)
|
||||
c = option.applySpanEnd(c)
|
||||
}
|
||||
return c
|
||||
}
|
||||
@@ -126,19 +126,19 @@ func NewSpanEndConfig(options ...SpanEndOption) SpanConfig {
|
||||
// SpanStartOption applies an option to a SpanConfig. These options are applicable
|
||||
// only when the span is created
|
||||
type SpanStartOption interface {
|
||||
applySpanStart(*SpanConfig)
|
||||
applySpanStart(SpanConfig) SpanConfig
|
||||
}
|
||||
|
||||
type spanOptionFunc func(*SpanConfig)
|
||||
type spanOptionFunc func(SpanConfig) SpanConfig
|
||||
|
||||
func (fn spanOptionFunc) applySpanStart(cfg *SpanConfig) {
|
||||
fn(cfg)
|
||||
func (fn spanOptionFunc) applySpanStart(cfg SpanConfig) SpanConfig {
|
||||
return fn(cfg)
|
||||
}
|
||||
|
||||
// SpanEndOption applies an option to a SpanConfig. These options are
|
||||
// applicable only when the span is ended.
|
||||
type SpanEndOption interface {
|
||||
applySpanEnd(*SpanConfig)
|
||||
applySpanEnd(SpanConfig) SpanConfig
|
||||
}
|
||||
|
||||
// EventConfig is a group of options for an Event.
|
||||
@@ -170,7 +170,7 @@ func (cfg *EventConfig) StackTrace() bool {
|
||||
func NewEventConfig(options ...EventOption) EventConfig {
|
||||
var c EventConfig
|
||||
for _, option := range options {
|
||||
option.applyEvent(&c)
|
||||
c = option.applyEvent(c)
|
||||
}
|
||||
if c.timestamp.IsZero() {
|
||||
c.timestamp = time.Now()
|
||||
@@ -180,7 +180,7 @@ func NewEventConfig(options ...EventOption) EventConfig {
|
||||
|
||||
// EventOption applies span event options to an EventConfig.
|
||||
type EventOption interface {
|
||||
applyEvent(*EventConfig)
|
||||
applyEvent(EventConfig) EventConfig
|
||||
}
|
||||
|
||||
// SpanOption are options that can be used at both the beginning and end of a span.
|
||||
@@ -203,12 +203,14 @@ type SpanEndEventOption interface {
|
||||
|
||||
type attributeOption []attribute.KeyValue
|
||||
|
||||
func (o attributeOption) applySpan(c *SpanConfig) {
|
||||
func (o attributeOption) applySpan(c SpanConfig) SpanConfig {
|
||||
c.attributes = append(c.attributes, []attribute.KeyValue(o)...)
|
||||
return c
|
||||
}
|
||||
func (o attributeOption) applySpanStart(c *SpanConfig) { o.applySpan(c) }
|
||||
func (o attributeOption) applyEvent(c *EventConfig) {
|
||||
func (o attributeOption) applySpanStart(c SpanConfig) SpanConfig { return o.applySpan(c) }
|
||||
func (o attributeOption) applyEvent(c EventConfig) EventConfig {
|
||||
c.attributes = append(c.attributes, []attribute.KeyValue(o)...)
|
||||
return c
|
||||
}
|
||||
|
||||
var _ SpanStartEventOption = attributeOption{}
|
||||
@@ -234,10 +236,16 @@ type SpanEventOption interface {
|
||||
|
||||
type timestampOption time.Time
|
||||
|
||||
func (o timestampOption) applySpan(c *SpanConfig) { c.timestamp = time.Time(o) }
|
||||
func (o timestampOption) applySpanStart(c *SpanConfig) { o.applySpan(c) }
|
||||
func (o timestampOption) applySpanEnd(c *SpanConfig) { o.applySpan(c) }
|
||||
func (o timestampOption) applyEvent(c *EventConfig) { c.timestamp = time.Time(o) }
|
||||
func (o timestampOption) applySpan(c SpanConfig) SpanConfig {
|
||||
c.timestamp = time.Time(o)
|
||||
return c
|
||||
}
|
||||
func (o timestampOption) applySpanStart(c SpanConfig) SpanConfig { return o.applySpan(c) }
|
||||
func (o timestampOption) applySpanEnd(c SpanConfig) SpanConfig { return o.applySpan(c) }
|
||||
func (o timestampOption) applyEvent(c EventConfig) EventConfig {
|
||||
c.timestamp = time.Time(o)
|
||||
return c
|
||||
}
|
||||
|
||||
var _ SpanEventOption = timestampOption{}
|
||||
|
||||
@@ -249,9 +257,15 @@ func WithTimestamp(t time.Time) SpanEventOption {
|
||||
|
||||
type stackTraceOption bool
|
||||
|
||||
func (o stackTraceOption) applyEvent(c *EventConfig) { c.stackTrace = bool(o) }
|
||||
func (o stackTraceOption) applySpan(c *SpanConfig) { c.stackTrace = bool(o) }
|
||||
func (o stackTraceOption) applySpanEnd(c *SpanConfig) { o.applySpan(c) }
|
||||
func (o stackTraceOption) applyEvent(c EventConfig) EventConfig {
|
||||
c.stackTrace = bool(o)
|
||||
return c
|
||||
}
|
||||
func (o stackTraceOption) applySpan(c SpanConfig) SpanConfig {
|
||||
c.stackTrace = bool(o)
|
||||
return c
|
||||
}
|
||||
func (o stackTraceOption) applySpanEnd(c SpanConfig) SpanConfig { return o.applySpan(c) }
|
||||
|
||||
// WithStackTrace sets the flag to capture the error with stack trace (e.g. true, false).
|
||||
func WithStackTrace(b bool) SpanEndEventOption {
|
||||
@@ -261,8 +275,9 @@ func WithStackTrace(b bool) SpanEndEventOption {
|
||||
// WithLinks adds links to a Span. The links are added to the existing Span
|
||||
// links, i.e. this does not overwrite. Links with invalid span context are ignored.
|
||||
func WithLinks(links ...Link) SpanStartOption {
|
||||
return spanOptionFunc(func(cfg *SpanConfig) {
|
||||
return spanOptionFunc(func(cfg SpanConfig) SpanConfig {
|
||||
cfg.links = append(cfg.links, links...)
|
||||
return cfg
|
||||
})
|
||||
}
|
||||
|
||||
@@ -270,28 +285,32 @@ func WithLinks(links ...Link) SpanStartOption {
|
||||
// existing parent span context will be ignored when defining the Span's trace
|
||||
// identifiers.
|
||||
func WithNewRoot() SpanStartOption {
|
||||
return spanOptionFunc(func(cfg *SpanConfig) {
|
||||
return spanOptionFunc(func(cfg SpanConfig) SpanConfig {
|
||||
cfg.newRoot = true
|
||||
return cfg
|
||||
})
|
||||
}
|
||||
|
||||
// WithSpanKind sets the SpanKind of a Span.
|
||||
func WithSpanKind(kind SpanKind) SpanStartOption {
|
||||
return spanOptionFunc(func(cfg *SpanConfig) {
|
||||
return spanOptionFunc(func(cfg SpanConfig) SpanConfig {
|
||||
cfg.spanKind = kind
|
||||
return cfg
|
||||
})
|
||||
}
|
||||
|
||||
// WithInstrumentationVersion sets the instrumentation version.
|
||||
func WithInstrumentationVersion(version string) TracerOption {
|
||||
return tracerOptionFunc(func(cfg *TracerConfig) {
|
||||
return tracerOptionFunc(func(cfg TracerConfig) TracerConfig {
|
||||
cfg.instrumentationVersion = version
|
||||
return cfg
|
||||
})
|
||||
}
|
||||
|
||||
// WithSchemaURL sets the schema URL for the Tracer.
|
||||
func WithSchemaURL(schemaURL string) TracerOption {
|
||||
return tracerOptionFunc(func(cfg *TracerConfig) {
|
||||
return tracerOptionFunc(func(cfg TracerConfig) TracerConfig {
|
||||
cfg.schemaURL = schemaURL
|
||||
return cfg
|
||||
})
|
||||
}
|
||||
|
4
vendor/go.opentelemetry.io/otel/trace/go.mod
generated
vendored
4
vendor/go.opentelemetry.io/otel/trace/go.mod
generated
vendored
@@ -41,9 +41,9 @@ replace go.opentelemetry.io/otel/sdk/metric => ../sdk/metric
|
||||
replace go.opentelemetry.io/otel/trace => ./
|
||||
|
||||
require (
|
||||
github.com/google/go-cmp v0.5.6
|
||||
github.com/google/go-cmp v0.5.7
|
||||
github.com/stretchr/testify v1.7.0
|
||||
go.opentelemetry.io/otel v1.3.0
|
||||
go.opentelemetry.io/otel v1.4.0
|
||||
)
|
||||
|
||||
replace go.opentelemetry.io/otel/example/passthrough => ../example/passthrough
|
||||
|
9
vendor/go.opentelemetry.io/otel/trace/go.sum
generated
vendored
9
vendor/go.opentelemetry.io/otel/trace/go.sum
generated
vendored
@@ -1,10 +1,9 @@
|
||||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||
github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||
github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI=
|
||||
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
|
||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
|
||||
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
|
4
vendor/go.opentelemetry.io/otel/trace/tracestate.go
generated
vendored
4
vendor/go.opentelemetry.io/otel/trace/tracestate.go
generated
vendored
@@ -58,7 +58,7 @@ func newMember(key, value string) (member, error) {
|
||||
return member{Key: key, Value: value}, nil
|
||||
}
|
||||
|
||||
func parseMemeber(m string) (member, error) {
|
||||
func parseMember(m string) (member, error) {
|
||||
matches := memberRe.FindStringSubmatch(m)
|
||||
if len(matches) != 5 {
|
||||
return member{}, fmt.Errorf("%w: %s", errInvalidMember, m)
|
||||
@@ -114,7 +114,7 @@ func ParseTraceState(tracestate string) (TraceState, error) {
|
||||
continue
|
||||
}
|
||||
|
||||
m, err := parseMemeber(memberStr)
|
||||
m, err := parseMember(memberStr)
|
||||
if err != nil {
|
||||
return TraceState{}, wrapErr(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user