traceable

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

README

traceable

CircleCI Coverage Status Go Report Card GoDoc

A Tool that generates an instrumented implementation of an interface that wraps functions calls with an OpenTracing span.

Installation

traceable requires a working Go installation (Go 1.14+)

go install github.com/ConorNevin/traceable@latest

Usage

Using Go Generate
  1. Add a go:generate directive to a file in the same package as the target interface: go:generate traceable -types IFACE -output traced/iface.go
  2. Run go generate on the directory
Download binary from GitHub release
    curl -fsSL "https://github.com/ConorNevin/traceable/releases/download/$(VERSION)/traceable_$(uname -s)_$(uname -m)" -o traceable

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	RootPackage       string
	OutputPackagePath string
	Interface         Interface
	// contains filtered or unexported fields
}

func (*Generator) Format

func (g *Generator) Format() []byte

Format returns the gofmt-ed contents of the Generator's buffer.

func (*Generator) Generate

func (g *Generator) Generate(typeName string)

func (*Generator) GenerateAll

func (g *Generator) GenerateAll(types []string)

func (*Generator) ParsePackage

func (g *Generator) ParsePackage(patterns []string)

func (*Generator) Printf

func (g *Generator) Printf(format string, args ...interface{})

type ImportedPackage

type ImportedPackage struct {
	Name       string
	Path       string
	Duplicates []string
}

type Interface

type Interface struct {
	// contains filtered or unexported fields
}

type Method

type Method struct {
	// contains filtered or unexported fields
}

type Package

type Package struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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