tracer

package
v0.0.0-...-3380bb0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultLogger sdklog.Logger = LoggerFunc(func(level, msg string, keyVals ...interface{}) {
	log.Println(append([]interface{}{level, msg}, keyVals...)...)
})
View Source
var ImpliedExcludeFiles = []*regexp.Regexp{

	regexp.MustCompile("^" + filepath.ToSlash(filepath.Join(runtime.GOROOT(), "src")) + ".*"),
}
View Source
var ImpliedExcludeFuncs = []*regexp.Regexp{

	regexp.MustCompile(`^go\.temporal\.io/sdk/.*`),

	regexp.MustCompile(`^go\.uber\.org/atomic\..*`),

	regexp.MustCompile(`^runtime\..*`),

	regexp.MustCompile(`^main\.main$`),
}

Functions

This section is empty.

Types

type Config

type Config struct {
	ClientOptions client.Options

	Log log.Logger
	// Qualified by package up to last dot. Only one supported for now
	// TODO(cretz): Support multiple for child workflows?
	WorkflowFuncs []string

	// One and only one of the next two fields required
	Execution   *workflow.Execution
	HistoryFile string // TODO(cretz): Stop creating client if history file given

	// Temp dir created under this, usually the current working dir so func
	// package works properly
	RootDir       string
	RetainTempDir bool

	// These are stepped out of if reached in any way. ImpliedExcludeFuncs and
	// ImpliedExcludeFiles are automatically assumed.
	ExcludeFuncs []*regexp.Regexp
	ExcludeFiles []*regexp.Regexp

	IncludeTemporalInternal bool
}

type Event

type Event struct {
	// Only one of these is present
	Server *EventServer `json:"server,omitempty"`
	Client *EventClient `json:"client,omitempty"`
	Code   *EventCode   `json:"code,omitempty"`
}

type EventClient

type EventClient struct {
	Commands []EventClientCommandType `json:"commands,omitempty"`
}

type EventClientCommandType

type EventClientCommandType enums.CommandType

func (EventClientCommandType) MarshalText

func (e EventClientCommandType) MarshalText() ([]byte, error)

func (EventClientCommandType) String

func (e EventClientCommandType) String() string

func (*EventClientCommandType) UnmarshalText

func (e *EventClientCommandType) UnmarshalText(text []byte) error

type EventCode

type EventCode struct {
	Package   string `json:"package,omitempty"`
	File      string `json:"file,omitempty"`
	Line      int    `json:"line,omitempty"`
	Coroutine string `json:"coroutine,omitempty"`
}

type EventServer

type EventServer struct {
	ID   int64           `json:"eventId"`
	Type EventServerType `json:"eventType"`
}

type EventServerType

type EventServerType enums.EventType

func (EventServerType) MarshalText

func (e EventServerType) MarshalText() ([]byte, error)

func (EventServerType) String

func (e EventServerType) String() string

func (*EventServerType) UnmarshalText

func (e *EventServerType) UnmarshalText(text []byte) error

type HTMLGeneratorAnnotated

type HTMLGeneratorAnnotated struct {
	RetainTempDir bool
}

func (*HTMLGeneratorAnnotated) GenerateHTML

func (h *HTMLGeneratorAnnotated) GenerateHTML(ctx context.Context, t *Tracer, outDir string, res *Result) error

type HTMLGeneratorSimpleLinear

type HTMLGeneratorSimpleLinear struct{}

func (HTMLGeneratorSimpleLinear) GenerateHTML

func (h HTMLGeneratorSimpleLinear) GenerateHTML(ctx context.Context, t *Tracer, dir string, res *Result) error

type LoggerFunc

type LoggerFunc func(level, msg string, keyVals ...interface{})

func (LoggerFunc) Debug

func (l LoggerFunc) Debug(msg string, keyVals ...interface{})

func (LoggerFunc) Error

func (l LoggerFunc) Error(msg string, keyVals ...interface{})

func (LoggerFunc) Info

func (l LoggerFunc) Info(msg string, keyVals ...interface{})

func (LoggerFunc) Warn

func (l LoggerFunc) Warn(msg string, keyVals ...interface{})

type Result

type Result struct {
	Events []*Event `json:"events"`
}

type Tracer

type Tracer struct {
	Config
	// contains filtered or unexported fields
}

func New

func New(config Config) (*Tracer, error)

func (*Tracer) Trace

func (t *Tracer) Trace(ctx context.Context) (*Result, error)

Trace This may still return a result, even if there is an error

Jump to

Keyboard shortcuts

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