mirror of
https://github.com/go-gitea/gitea
synced 2025-09-28 03:28:13 +00:00
[Vendor] Update directly used dependencys (#15593)
* update github.com/blevesearch/bleve v2.0.2 -> v2.0.3 * github.com/denisenkom/go-mssqldb v0.9.0 -> v0.10.0 * github.com/editorconfig/editorconfig-core-go v2.4.1 -> v2.4.2 * github.com/go-chi/cors v1.1.1 -> v1.2.0 * github.com/go-git/go-billy v5.0.0 -> v5.1.0 * github.com/go-git/go-git v5.2.0 -> v5.3.0 * github.com/go-ldap/ldap v3.2.4 -> v3.3.0 * github.com/go-redis/redis v8.6.0 -> v8.8.2 * github.com/go-sql-driver/mysql v1.5.0 -> v1.6.0 * github.com/go-swagger/go-swagger v0.26.1 -> v0.27.0 * github.com/lib/pq v1.9.0 -> v1.10.1 * github.com/mattn/go-sqlite3 v1.14.6 -> v1.14.7 * github.com/go-testfixtures/testfixtures v3.5.0 -> v3.6.0 * github.com/issue9/identicon v1.0.1 -> v1.2.0 * github.com/klauspost/compress v1.11.8 -> v1.12.1 * github.com/mgechev/revive v1.0.3 -> v1.0.6 * github.com/microcosm-cc/bluemonday v1.0.7 -> v1.0.8 * github.com/niklasfasching/go-org v1.4.0 -> v1.5.0 * github.com/olivere/elastic v7.0.22 -> v7.0.24 * github.com/pelletier/go-toml v1.8.1 -> v1.9.0 * github.com/prometheus/client_golang v1.9.0 -> v1.10.0 * github.com/xanzy/go-gitlab v0.44.0 -> v0.48.0 * github.com/yuin/goldmark v1.3.3 -> v1.3.5 * github.com/6543/go-version v1.2.4 -> v1.3.1 * do github.com/lib/pq v1.10.0 -> v1.10.1 again ...
This commit is contained in:
45
vendor/go.opentelemetry.io/otel/trace/config.go
generated
vendored
45
vendor/go.opentelemetry.io/otel/trace/config.go
generated
vendored
@@ -17,7 +17,7 @@ package trace
|
||||
import (
|
||||
"time"
|
||||
|
||||
"go.opentelemetry.io/otel/label"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
)
|
||||
|
||||
// TracerConfig is a group of options for a Tracer.
|
||||
@@ -39,18 +39,21 @@ func NewTracerConfig(options ...TracerOption) *TracerConfig {
|
||||
// TracerOption applies an option to a TracerConfig.
|
||||
type TracerOption interface {
|
||||
ApplyTracer(*TracerConfig)
|
||||
|
||||
// A private method to prevent users implementing the
|
||||
// interface and so future additions to it will not
|
||||
// violate compatibility.
|
||||
private()
|
||||
}
|
||||
|
||||
// SpanConfig is a group of options for a Span.
|
||||
type SpanConfig struct {
|
||||
// Attributes describe the associated qualities of a Span.
|
||||
Attributes []label.KeyValue
|
||||
Attributes []attribute.KeyValue
|
||||
// Timestamp is a time in a Span life-cycle.
|
||||
Timestamp time.Time
|
||||
// Links are the associations a Span has with other Spans.
|
||||
Links []Link
|
||||
// Record is the recording state of a Span.
|
||||
Record bool
|
||||
// NewRoot identifies a Span as the root Span for a new trace. This is
|
||||
// commonly used when an existing trace crosses trust boundaries and the
|
||||
// remote parent span context should be ignored for security.
|
||||
@@ -74,6 +77,11 @@ func NewSpanConfig(options ...SpanOption) *SpanConfig {
|
||||
// SpanOption applies an option to a SpanConfig.
|
||||
type SpanOption interface {
|
||||
ApplySpan(*SpanConfig)
|
||||
|
||||
// A private method to prevent users implementing the
|
||||
// interface and so future additions to it will not
|
||||
// violate compatibility.
|
||||
private()
|
||||
}
|
||||
|
||||
// NewEventConfig applies all the EventOptions to a returned SpanConfig. If no
|
||||
@@ -94,6 +102,11 @@ func NewEventConfig(options ...EventOption) *SpanConfig {
|
||||
// EventOption applies span event options to a SpanConfig.
|
||||
type EventOption interface {
|
||||
ApplyEvent(*SpanConfig)
|
||||
|
||||
// A private method to prevent users implementing the
|
||||
// interface and so future additions to it will not
|
||||
// violate compatibility.
|
||||
private()
|
||||
}
|
||||
|
||||
// LifeCycleOption applies span life-cycle options to a SpanConfig. These
|
||||
@@ -104,12 +117,13 @@ type LifeCycleOption interface {
|
||||
EventOption
|
||||
}
|
||||
|
||||
type attributeSpanOption []label.KeyValue
|
||||
type attributeSpanOption []attribute.KeyValue
|
||||
|
||||
func (o attributeSpanOption) ApplySpan(c *SpanConfig) { o.apply(c) }
|
||||
func (o attributeSpanOption) ApplyEvent(c *SpanConfig) { o.apply(c) }
|
||||
func (attributeSpanOption) private() {}
|
||||
func (o attributeSpanOption) apply(c *SpanConfig) {
|
||||
c.Attributes = append(c.Attributes, []label.KeyValue(o)...)
|
||||
c.Attributes = append(c.Attributes, []attribute.KeyValue(o)...)
|
||||
}
|
||||
|
||||
// WithAttributes adds the attributes related to a span life-cycle event.
|
||||
@@ -121,7 +135,7 @@ func (o attributeSpanOption) apply(c *SpanConfig) {
|
||||
// If multiple of these options are passed the attributes of each successive
|
||||
// option will extend the attributes instead of overwriting. There is no
|
||||
// guarantee of uniqueness in the resulting attributes.
|
||||
func WithAttributes(attributes ...label.KeyValue) LifeCycleOption {
|
||||
func WithAttributes(attributes ...attribute.KeyValue) LifeCycleOption {
|
||||
return attributeSpanOption(attributes)
|
||||
}
|
||||
|
||||
@@ -129,6 +143,7 @@ type timestampSpanOption time.Time
|
||||
|
||||
func (o timestampSpanOption) ApplySpan(c *SpanConfig) { o.apply(c) }
|
||||
func (o timestampSpanOption) ApplyEvent(c *SpanConfig) { o.apply(c) }
|
||||
func (timestampSpanOption) private() {}
|
||||
func (o timestampSpanOption) apply(c *SpanConfig) { c.Timestamp = time.Time(o) }
|
||||
|
||||
// WithTimestamp sets the time of a Span life-cycle moment (e.g. started,
|
||||
@@ -140,6 +155,7 @@ func WithTimestamp(t time.Time) LifeCycleOption {
|
||||
type linksSpanOption []Link
|
||||
|
||||
func (o linksSpanOption) ApplySpan(c *SpanConfig) { c.Links = append(c.Links, []Link(o)...) }
|
||||
func (linksSpanOption) private() {}
|
||||
|
||||
// WithLinks adds links to a Span. The links are added to the existing Span
|
||||
// links, i.e. this does not overwrite.
|
||||
@@ -147,20 +163,10 @@ func WithLinks(links ...Link) SpanOption {
|
||||
return linksSpanOption(links)
|
||||
}
|
||||
|
||||
type recordSpanOption bool
|
||||
|
||||
func (o recordSpanOption) ApplySpan(c *SpanConfig) { c.Record = bool(o) }
|
||||
|
||||
// WithRecord specifies that the span should be recorded. It is important to
|
||||
// note that implementations may override this option, i.e. if the span is a
|
||||
// child of an un-sampled trace.
|
||||
func WithRecord() SpanOption {
|
||||
return recordSpanOption(true)
|
||||
}
|
||||
|
||||
type newRootSpanOption bool
|
||||
|
||||
func (o newRootSpanOption) ApplySpan(c *SpanConfig) { c.NewRoot = bool(o) }
|
||||
func (newRootSpanOption) private() {}
|
||||
|
||||
// WithNewRoot specifies that the Span should be treated as a root Span. Any
|
||||
// existing parent span context will be ignored when defining the Span's trace
|
||||
@@ -172,6 +178,7 @@ func WithNewRoot() SpanOption {
|
||||
type spanKindSpanOption SpanKind
|
||||
|
||||
func (o spanKindSpanOption) ApplySpan(c *SpanConfig) { c.SpanKind = SpanKind(o) }
|
||||
func (o spanKindSpanOption) private() {}
|
||||
|
||||
// WithSpanKind sets the SpanKind of a Span.
|
||||
func WithSpanKind(kind SpanKind) SpanOption {
|
||||
@@ -194,3 +201,5 @@ type instrumentationVersionOption string
|
||||
func (i instrumentationVersionOption) ApplyTracer(config *TracerConfig) {
|
||||
config.InstrumentationVersion = string(i)
|
||||
}
|
||||
|
||||
func (instrumentationVersionOption) private() {}
|
||||
|
Reference in New Issue
Block a user