test

package
v3.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2022 License: Apache-2.0, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAnotherBuildTagTrace

func WithAnotherBuildTagTrace(ctx context.Context, t AnotherBuildTagTrace) context.Context

WithAnotherBuildTagTrace returns context which has associated AnotherBuildTagTrace with it.

func WithBuildTagTrace

func WithBuildTagTrace(ctx context.Context, t BuildTagTrace) context.Context

WithBuildTagTrace returns context which has associated BuildTagTrace with it.

func WithTrace

func WithTrace(ctx context.Context, t Trace) context.Context

WithTrace returns context which has associated Trace with it.

func WithTraceNoShortcut

func WithTraceNoShortcut(ctx context.Context, t TraceNoShortcut) context.Context

WithTraceNoShortcut returns context which has associated TraceNoShortcut with it.

Types

type AnotherBuildTagTrace

type AnotherBuildTagTrace struct {
	OnSomethingA func() func()
	OnSomethingB func(int8, int16) func(int32, int64)
	OnSomethingC func(Type) func(Type)
}

func ContextAnotherBuildTagTrace

func ContextAnotherBuildTagTrace(ctx context.Context) AnotherBuildTagTrace

ContextAnotherBuildTagTrace returns AnotherBuildTagTrace associated with ctx. If there is no AnotherBuildTagTrace associated with ctx then zero value of AnotherBuildTagTrace is returned.

func (AnotherBuildTagTrace) Compose

Compose returns a new AnotherBuildTagTrace which has functional fields composed both from t and x.

type BuildTagTrace

type BuildTagTrace struct {
	OnSomethingA func() func()
	OnSomethingB func(int8, int16) func(int32, int64)
	OnSomethingC func(Type) func(Type)
}

func ContextBuildTagTrace

func ContextBuildTagTrace(ctx context.Context) BuildTagTrace

ContextBuildTagTrace returns BuildTagTrace associated with ctx. If there is no BuildTagTrace associated with ctx then zero value of BuildTagTrace is returned.

func (BuildTagTrace) Compose

func (t BuildTagTrace) Compose(x BuildTagTrace) (ret BuildTagTrace)

Compose returns a new BuildTagTrace which has functional fields composed both from t and x.

type ConditionalBuildTrace

type ConditionalBuildTrace struct {
	OnSomething func()
}

func (ConditionalBuildTrace) Compose

Compose returns a new ConditionalBuildTrace which has functional fields composed both from t and x.

type Embedded

type Embedded struct{}

type ReturnedTrace

type ReturnedTrace struct {
	OnSomething func(a, b int)

	OnFoo func(_ int, _ int)
	OnBar func(_, _ int)
	OnBaz func(int, int)
}

func (ReturnedTrace) Compose

func (t ReturnedTrace) Compose(x ReturnedTrace) (ret ReturnedTrace)

Compose returns a new ReturnedTrace which has functional fields composed both from t and x.

type ShortcutPerFieldTrace

type ShortcutPerFieldTrace struct {
	//gtrace:set shortcut
	OnFoo func()
	OnBar func()
}

func (ShortcutPerFieldTrace) Compose

Compose returns a new ShortcutPerFieldTrace which has functional fields composed both from t and x.

type Trace

type Trace struct {
	OnTest func(string) func(string)

	OnAction     func(TraceActionStart) func(TraceActionDone)
	OnActionPtr  func(*TraceActionStart) func(*TraceActionDone)
	OnSomething0 func(int8) func(int16) func(int32) func(int64)
	OnSomething1 func(int8, int16) func(int32, int64)
	OnSomething2 func(Type) func(Type) func(Type)
	OnAnother    func()
	OnAnother1   func(named string)

	// Not supported signatures:
	Skipped0 func() string
	Skipped1 func() (func(), func())
}

func ContextTrace

func ContextTrace(ctx context.Context) Trace

ContextTrace returns Trace associated with ctx. If there is no Trace associated with ctx then zero value of Trace is returned.

func (Trace) Compose

func (t Trace) Compose(x Trace) (ret Trace)

Compose returns a new Trace which has functional fields composed both from t and x.

type TraceActionDone

type TraceActionDone struct {
	Error error
}

type TraceActionStart

type TraceActionStart struct {
	String string
	Nested Type
}

type TraceNoShortcut

type TraceNoShortcut struct {
	OnSomethingA func(Type)
	OnSomethingB func(internal.Type)
}

NOTE: must compile without unused imports error.

func ContextTraceNoShortcut

func ContextTraceNoShortcut(ctx context.Context) TraceNoShortcut

ContextTraceNoShortcut returns TraceNoShortcut associated with ctx. If there is no TraceNoShortcut associated with ctx then zero value of TraceNoShortcut is returned.

func (TraceNoShortcut) Compose

func (t TraceNoShortcut) Compose(x TraceNoShortcut) (ret TraceNoShortcut)

Compose returns a new TraceNoShortcut which has functional fields composed both from t and x.

type TraceReturningTrace

type TraceReturningTrace struct {
	OnReturnedTrace func() ReturnedTrace
}

func (TraceReturningTrace) Compose

Compose returns a new TraceReturningTrace which has functional fields composed both from t and x.

type TraceReturningTraceTags

type TraceReturningTraceTags struct {
	OnReturnedTrace func() ReturnedTrace
}

func (TraceReturningTraceTags) Compose

Compose returns a new TraceReturningTraceTags which has functional fields composed both from t and x.

type Type

type Type struct {
	Embedded
	String  string
	Integer int
	Boolean bool
	Error   error
	Reader  bytes.Reader
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL