File: disabled.go

package info (click to toggle)
golang-golang-x-exp 0.0~git20230522.2e198f4-1~bpo12%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-backports
  • size: 6,404 kB
  • sloc: ansic: 1,900; objc: 276; sh: 272; asm: 48; makefile: 26
file content (41 lines) | stat: -rw-r--r-- 1,408 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build disable_events
// +build disable_events

package event

import (
	"context"
	"time"
)

type Builder struct{ ctx context.Context }
type Exporter struct {
	Now func() time.Time
}

func NewExporter(h interface{}) *Exporter { return &Exporter{} }

func To(ctx context.Context) Builder                        { return Builder{} }
func (b Builder) Clone() Builder                            { return b }
func (b Builder) Label(label Label) Builder                 { return b }
func (b Builder) Labels(labels ...Label) Builder            { return b }
func (b Builder) Log(message string)                        {}
func (b Builder) Logf(template string, args ...interface{}) {}
func (b Builder) Metric()                                   {}
func (b Builder) Annotate()                                 {}
func (b Builder) End()                                      {}
func (b Builder) Event() *Event                             { return &Event{} }
func (b Builder) Start(name string) (context.Context, func()) {
	return b.ctx, func() {}
}

func newContext(ctx context.Context, exporter *Exporter, parent uint64) context.Context {
	return ctx
}
func FromContext(ctx context.Context) *Target { return nil }

func setDefaultExporter(e *Exporter) {}